2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-05 00:55:24 +00:00

Fix a crash (in dig) when closing HTTP socket with unused session

This commit fixes a crash (caused by an assert) when closing an HTTP/2
socket with unused HTTP/2 session.
This commit is contained in:
Artem Boldariev
2021-08-10 17:02:19 +03:00
parent d0399afd3a
commit 8a655320c8
2 changed files with 72 additions and 1 deletions

View File

@@ -2671,7 +2671,14 @@ http_close_direct(isc_nmsocket_t *sock) {
atomic_store(&sock->active, false);
session = sock->h2.session;
if (session != NULL && session->handle) {
if (session != NULL && session->sending == 0 && !session->reading) {
/*
* The socket is going to be closed too early without been
* used even once (might happen in a case of low level
* error).
*/
finish_http_session(session);
} else if (session != NULL && session->handle) {
http_do_bio(session, NULL, NULL, NULL);
}
}