diff options
author | Yossi Gottlieb <yossigo@gmail.com> | 2019-09-16 17:15:34 +0300 |
---|---|---|
committer | Yossi Gottlieb <yossigo@gmail.com> | 2019-09-16 17:30:35 +0300 |
commit | d41443bd3d87adfb32dc28ee02d3aa81e515e255 (patch) | |
tree | 3faeda53cc2b833b6f31778d3c84f78290a50335 /hiredis.c | |
parent | bd2c8fedf75f4e60225dfd6c735068a88666839a (diff) |
Fix: redisReconnect() should clear SSL context.
We should not attempt to keep the context and re-establish the
TLS connection for several reasons:
1. Maintain symmetry between redisConnect() and redisReconnect(), so in
both cases an extra step is required to initiate SSL.
2. The caller may also wish to reconfigure the SSL session and needs a
chance to do that.
3. It is not a practical thing to do on an async non-blocking connection
context.
Diffstat (limited to 'hiredis.c')
-rw-r--r-- | hiredis.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -708,6 +708,11 @@ int redisReconnect(redisContext *c) { c->err = 0; memset(c->errstr, '\0', strlen(c->errstr)); + if (c->privdata && c->funcs->free_privdata) { + c->funcs->free_privdata(c->privdata); + c->privdata = NULL; + } + redisNetClose(c); sdsfree(c->obuf); |