use isc_nm_cancelread() in isccc_ccmsg_cancelread()

when shuttting down a control channel connection, if no valid
message has arrived, cancel the read.
This commit is contained in:
Evan Hunt
2020-06-05 17:48:27 -07:00
parent 1fdaf3465d
commit f2e681e418
2 changed files with 5 additions and 7 deletions

View File

@@ -408,9 +408,10 @@ control_recvmessage(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
isccc_time_t exp;
uint32_t nonce;
conn->ccmsg_valid = false;
/* Is the server shutting down? */
if (listener->controls->shuttingdown) {
conn->ccmsg_valid = false;
return;
}
@@ -419,7 +420,6 @@ control_recvmessage(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
log_invalid(&conn->ccmsg, result);
}
conn->ccmsg_valid = false;
return;
}
@@ -445,7 +445,6 @@ control_recvmessage(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
REGION_SIZE(conn->secret));
if (result != ISCCC_R_BADAUTH) {
log_invalid(&conn->ccmsg, result);
conn->ccmsg_valid = false;
return;
}
}
@@ -518,6 +517,8 @@ control_recvmessage(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
isc_buffer_allocate(listener->mctx, &conn->text, 2 * 2048);
conn->ccmsg_valid = true;
if (conn->nonce == 0) {
/*
* Establish nonce.

View File

@@ -208,10 +208,7 @@ void
isccc_ccmsg_cancelread(isccc_ccmsg_t *ccmsg) {
REQUIRE(VALID_CCMSG(ccmsg));
#if 0
/* XXX: not sure if this is needed with the netmgr */
isc_socket_cancel(ccmsg->sock, NULL, ISC_SOCKCANCEL_RECV);
#endif
isc_nm_cancelread(ccmsg->handle);
}
void