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