nghttp: Close fd on disconnect
This commit is contained in:
parent
c4539046be
commit
53271e1e52
|
@ -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 {
|
||||||
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()
|
||||||
|
|
Loading…
Reference in New Issue