If dnslisten_readcb gets a read callback it needs to verify that the
outer socket wasn't closed in the meantime, and issue a CANCELED callback
if it was.
REQUIRE(VALID_NMSOCK(dnssock));
REQUIRE(dnssock->tid == isc_nm_tid());
REQUIRE(VALID_NMHANDLE(handle));
+ if (eresult == ISC_R_SUCCESS &&
+ (!isc__nmsocket_active(dnssock) || dnssock->outerhandle == NULL))
+ {
+ eresult = ISC_R_CANCELED;
+ }
if (region == NULL || eresult != ISC_R_SUCCESS) {
/* Connection closed */