diff --git a/lib/isc/netmgr/http.c b/lib/isc/netmgr/http.c index a787e2d310..4cde316236 100644 --- a/lib/isc/netmgr/http.c +++ b/lib/isc/netmgr/http.c @@ -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 */