2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-28 13:08:06 +00:00

Fix an abort in DoH (client-side) when writing on closing sock

The commit fixes a corner case in client-side DoH code, when a write
attempt is done on a closing socket (session).

The change ensures that the write call-back will be called with a
proper error code (see failed_send_cb() call in client_httpsend()).
This commit is contained in:
Artem Boldariev 2022-05-10 19:46:12 +03:00
parent 245f7cec2e
commit 9abb00bb5f

View File

@ -1509,7 +1509,12 @@ client_send(isc_nmhandle_t *handle, const isc_region_t *region) {
REQUIRE(region != NULL);
REQUIRE(region->base != NULL);
REQUIRE(region->length <= MAX_DNS_MESSAGE_SIZE);
REQUIRE(cstream != NULL);
if (session->closed) {
return (ISC_R_CANCELED);
}
INSIST(cstream != NULL);
if (cstream->post) {
/* POST */