mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Refactor the normal vs error path in control_senddone()
The code flow in control_senddone() was modified to be simpler to follow and superfluous INSIST() was zapped from control_recvmessage().
This commit is contained in:
parent
de25743e00
commit
5964eb4796
1 changed files with 4 additions and 6 deletions
|
|
@ -262,10 +262,11 @@ control_senddone(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
|
|||
/* Everything is peachy, continue reading from the socket */
|
||||
isccc_ccmsg_readmessage(&conn->ccmsg, control_recvmessage,
|
||||
conn);
|
||||
goto done;
|
||||
/* Detach the sending reference */
|
||||
controlconnection_detach(&conn);
|
||||
return;
|
||||
}
|
||||
|
||||
/* This is the error path */
|
||||
if (result != ISC_R_SHUTTINGDOWN) {
|
||||
char socktext[ISC_SOCKADDR_FORMATSIZE];
|
||||
isc_sockaddr_t peeraddr = isc_nmhandle_peeraddr(handle);
|
||||
|
|
@ -277,9 +278,9 @@ control_senddone(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
|
|||
socktext, isc_result_totext(result));
|
||||
}
|
||||
|
||||
/* Shutdown the reading */
|
||||
conn_shutdown(conn);
|
||||
|
||||
done:
|
||||
/* Detach the sending reference */
|
||||
controlconnection_detach(&conn);
|
||||
}
|
||||
|
|
@ -559,9 +560,6 @@ cleanup:
|
|||
case ISC_R_EOF:
|
||||
break;
|
||||
default:
|
||||
/* We can't get here on normal path */
|
||||
INSIST(result != ISC_R_SUCCESS);
|
||||
|
||||
log_invalid(&conn->ccmsg, result);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue