diff --git a/memcached.c b/memcached.c index cc0d89026..8a1ab2537 100644 --- a/memcached.c +++ b/memcached.c @@ -743,6 +743,7 @@ conn *conn_new(const int sfd, enum conn_states init_state, c->io_queues_submitted = 0; c->item = 0; + c->ssl = NULL; c->noreply = false; diff --git a/memcached.h b/memcached.h index 6d3a1b72e..0c250e1c9 100644 --- a/memcached.h +++ b/memcached.h @@ -835,8 +835,8 @@ struct conn { bool rbuf_malloced; /** read buffer was malloc'ed for ascii mget, needs free() */ bool item_malloced; /** item for conn_nread state is a temporary malloc */ uint8_t ssl_enabled; -#ifdef TLS void *ssl; +#ifdef TLS char *ssl_wbuf; #endif enum conn_states state; diff --git a/thread.c b/thread.c index e326d6347..7e545b8c5 100644 --- a/thread.c +++ b/thread.c @@ -631,6 +631,7 @@ static void thread_libevent_process(evutil_socket_t fd, short which, void *arg) } if (item->ssl) { ssl_conn_close(item->ssl); + item->ssl = NULL; } close(item->sfd); }