From 53271e1e52be96d8747228870338ee8d81e01ce9 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 22 Dec 2013 19:23:01 +0900 Subject: [PATCH] nghttp: Close fd on disconnect --- src/nghttp.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nghttp.cc b/src/nghttp.cc index 1f43ba53..a0a6b127 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -547,10 +547,12 @@ struct HttpClient { void disconnect() { + int fd = -1; state = STATE_IDLE; nghttp2_session_del(session); session = nullptr; if(ssl) { + fd = SSL_get_fd(ssl); SSL_shutdown(ssl); } if(bev) { @@ -570,6 +572,10 @@ struct HttpClient { SSL_free(ssl); ssl = nullptr; } + if(fd != -1) { + shutdown(fd, SHUT_WR); + close(fd); + } } int on_upgrade_connect()