REQUIRE(VALID_HTTPD(httpd));
REQUIRE(httpd->handle == handle);
- REQUIRE(httpd->readhandle == handle);
-
- isc_nm_read_stop(httpd->readhandle);
if (eresult != ISC_R_SUCCESS) {
goto close_readhandle;
}
+ REQUIRE(httpd->readhandle == handle);
+ REQUIRE((mgr->flags & ISC_HTTPDMGR_SHUTTINGDOWN) == 0);
+
+ isc_nm_read_stop(httpd->readhandle);
+
/*
* If we are being called from httpd_senddone(), the last HTTP request
* was processed successfully, reset the last_len to 0, even if there's
return;
close_readhandle:
+ isc_nm_read_stop(httpd->readhandle);
isc_nmhandle_close(httpd->readhandle);
isc_nmhandle_detach(&httpd->readhandle);
}
httpd = ISC_LIST_HEAD(httpdmgr->running);
while (httpd != NULL) {
- isc_nm_read_stop(httpd->readhandle);
- isc_nmhandle_detach(&httpd->readhandle);
+ if (httpd->readhandle != NULL) {
+ httpd_request(httpd->readhandle, ISC_R_SHUTTINGDOWN,
+ NULL, httpdmgr);
+ }
httpd = ISC_LIST_NEXT(httpd, link);
}
UNLOCK(&httpdmgr->lock);
REQUIRE(VALID_HTTPD(httpd));
+ if ((httpd->mgr->flags & ISC_HTTPDMGR_SHUTTINGDOWN) != 0) {
+ goto detach;
+ }
+
if (eresult == ISC_R_SUCCESS && (httpd->flags & HTTPD_CLOSE) == 0) {
/*
* Calling httpd_request() with region NULL restarts
isc_nmhandle_close(handle);
}
+detach:
isc_nmhandle_detach(&handle);
-
isc__httpd_sendreq_free(req);
}