]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Do not call http_do_bio() in isc__nm_http_request()
authorArtem Boldariev <artem@boldariev.com>
Wed, 28 Jul 2021 13:44:46 +0000 (16:44 +0300)
committerArtem Boldariev <artem@boldariev.com>
Thu, 12 Aug 2021 11:28:16 +0000 (14:28 +0300)
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.

lib/isc/netmgr/http.c

index 4e77a2ba82987b1cda40f0b6d85d0871cc0c35d8..11eefc165cfd8a9679e8d7f2836a28e48409ff15 100644 (file)
@@ -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: