Commit 53271e1e authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttp: Close fd on disconnect

parent c4539046
...@@ -547,10 +547,12 @@ struct HttpClient { ...@@ -547,10 +547,12 @@ struct HttpClient {
void disconnect() void disconnect()
{ {
int fd = -1;
state = STATE_IDLE; state = STATE_IDLE;
nghttp2_session_del(session); nghttp2_session_del(session);
session = nullptr; session = nullptr;
if(ssl) { if(ssl) {
fd = SSL_get_fd(ssl);
SSL_shutdown(ssl); SSL_shutdown(ssl);
} }
if(bev) { if(bev) {
...@@ -570,6 +572,10 @@ struct HttpClient { ...@@ -570,6 +572,10 @@ struct HttpClient {
SSL_free(ssl); SSL_free(ssl);
ssl = nullptr; ssl = nullptr;
} }
if(fd != -1) {
shutdown(fd, SHUT_WR);
close(fd);
}
} }
int on_upgrade_connect() int on_upgrade_connect()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment