don't set SHUTTINGDOWN until after calling the request callbacks

if we set ISC_HTTPDMGR_SHUTTINGDOWN in the http manager before
calling the pending request callbacks, it can trigger an assertion.
This commit is contained in:
Evan Hunt
2023-05-23 14:33:28 -07:00
parent 45b3a4a4cb
commit 512e5e786b

View File

@@ -940,15 +940,17 @@ isc_httpdmgr_shutdown(isc_httpdmgr_t **httpdmgrp) {
isc_nm_stoplistening(httpdmgr->sock);
LOCK(&httpdmgr->lock);
httpdmgr->flags |= ISC_HTTPDMGR_SHUTTINGDOWN;
isc_httpd_t *httpd, *next;
isc_httpd_t *httpd = NULL, *next = NULL;
ISC_LIST_FOREACH_SAFE (httpdmgr->running, httpd, link, next) {
if (httpd->handle != NULL) {
httpd_request(httpd->handle, ISC_R_SUCCESS, NULL,
httpd);
}
}
httpdmgr->flags |= ISC_HTTPDMGR_SHUTTINGDOWN;
UNLOCK(&httpdmgr->lock);
isc_nmsocket_close(&httpdmgr->sock);