From: Artem Boldariev Date: Wed, 28 Jul 2021 13:44:46 +0000 (+0300) Subject: Do not call http_do_bio() in isc__nm_http_request() X-Git-Tag: v9.17.18~40^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a05728beb0155049abb4ec913f40e651c1ba7973;p=thirdparty%2Fbind9.git Do not call http_do_bio() in isc__nm_http_request() The function should not be called here because it is, in general, supposed to be called at the end of the transport level callbacks to perform I/O, and thus, calling it here is clearly a mistake because it breaks other code expectations. As a result of the call to http_do_bio() from within isc__nm_http_request() the unit tests were running slower than expected in some situations. In this particular situation http_do_bio() is going to be called at the end of the transport_connect_cb() (initially), or http_readcb(), sending all of the scheduled requests at once. This change affects only the test suite because it is the only place in the codebase where isc__nm_http_request() is used in order to ensure that the server is able to handle multiple HTTP/2 streams at once. --- diff --git a/lib/isc/netmgr/http.c b/lib/isc/netmgr/http.c index 4e77a2ba829..11eefc165cf 100644 --- a/lib/isc/netmgr/http.c +++ b/lib/isc/netmgr/http.c @@ -1625,6 +1625,7 @@ isc__nm_http_request(isc_nmhandle_t *handle, isc_region_t *region, REQUIRE(VALID_NMHANDLE(handle)); REQUIRE(VALID_NMSOCK(handle->sock)); REQUIRE(handle->sock->tid == isc_nm_tid()); + REQUIRE(atomic_load(&handle->sock->client)); REQUIRE(cb != NULL); @@ -1640,7 +1641,6 @@ isc__nm_http_request(isc_nmhandle_t *handle, isc_region_t *region, goto error; } - http_do_bio(sock->h2.session, NULL, NULL, NULL); return (ISC_R_SUCCESS); error: