diff options
author | Linus Nordberg <linus@nordberg.se> | 2013-08-26 16:52:14 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2013-09-02 13:54:39 +0200 |
commit | 2d867ce2e2f0cb8251e16f620a33312054270e8f (patch) | |
tree | 553058410bc9bbb0dc0e08c8fcb8ae925abdd64d /tls.c | |
parent | ae2819597fcd50eea01f7429032fef24c3492228 (diff) |
When timing out while reading from a TLS server, shutdown the socket properly.
Also signal the "client writer" (clientwr()).
Together, this should result in TLS connections being cleaned up properly.
Patch by Fabian Mauchle.
Diffstat (limited to 'tls.c')
-rw-r--r-- | tls.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -290,8 +290,17 @@ void *tlsclientrd(void *arg) { } } } + debug(DBG_INFO, "tlsclientrd: exiting for %s", server->conf->name); ERR_remove_state(0); + SSL_shutdown(server->ssl); + shutdown(server->sock, SHUT_RDWR); + close(server->sock); + + /* Wake up clientwr(). */ server->clientrdgone = 1; + pthread_mutex_lock(&server->newrq_mutex); + pthread_cond_signal(&server->newrq_cond); + pthread_mutex_unlock(&server->newrq_mutex); return NULL; } |