2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-02 15:45:25 +00:00

allow multiple messages on the command channel socket

This commit is contained in:
Brian Wellington
2001-03-31 01:24:25 +00:00
parent eeb77542a8
commit 091329e690

View File

@@ -77,6 +77,7 @@ static isc_mutex_t listeners_lock;
static isc_once_t once = ISC_ONCE_INIT; static isc_once_t once = ISC_ONCE_INIT;
static void control_newconn(isc_task_t *task, isc_event_t *event); static void control_newconn(isc_task_t *task, isc_event_t *event);
static void control_recvmessage(isc_task_t *task, isc_event_t *event);
static void static void
initialize_mutex(void) { initialize_mutex(void) {
@@ -228,6 +229,7 @@ control_senddone(isc_task_t *task, isc_event_t *event) {
controlconnection_t *conn = event->ev_arg; controlconnection_t *conn = event->ev_arg;
controllistener_t *listener = conn->listener; controllistener_t *listener = conn->listener;
isc_socket_t *sock = (isc_socket_t *)sevent->ev_sender; isc_socket_t *sock = (isc_socket_t *)sevent->ev_sender;
isc_result_t result;
REQUIRE(conn->sending); REQUIRE(conn->sending);
@@ -249,9 +251,14 @@ control_senddone(isc_task_t *task, isc_event_t *event) {
socktext, isc_result_totext(sevent->result)); socktext, isc_result_totext(sevent->result));
} }
isc_event_free(&event); isc_event_free(&event);
isc_socket_detach(&conn->sock);
maybe_free_connection(conn); result = isccc_ccmsg_readmessage(&conn->ccmsg, listener->task,
maybe_free_listener(listener); control_recvmessage, conn);
if (result != ISC_R_SUCCESS) {
isc_socket_detach(&conn->sock);
maybe_free_connection(conn);
maybe_free_listener(listener);
}
} }
static inline void static inline void
@@ -290,7 +297,8 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
key = ISC_LIST_HEAD(listener->keys); key = ISC_LIST_HEAD(listener->keys);
if (conn->ccmsg.result != ISC_R_SUCCESS) { if (conn->ccmsg.result != ISC_R_SUCCESS) {
if (conn->ccmsg.result != ISC_R_CANCELED) if (conn->ccmsg.result != ISC_R_CANCELED &&
conn->ccmsg.result != ISC_R_EOF)
log_invalid(&conn->ccmsg, conn->ccmsg.result); log_invalid(&conn->ccmsg, conn->ccmsg.result);
goto cleanup; goto cleanup;
} }
@@ -345,8 +353,6 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
goto cleanup; goto cleanup;
conn->sending = ISC_TRUE; conn->sending = ISC_TRUE;
isccc_ccmsg_invalidate(&conn->ccmsg);
conn->ccmsg_valid = ISC_FALSE;
if (request != NULL) if (request != NULL)
isccc_sexpr_free(&request); isccc_sexpr_free(&request);
if (request != NULL) if (request != NULL)