bool exiting;
isc_refcount_t references;
controlkeylist_t keys;
- isc_mutex_t connections_lock;
controlconnectionlist_t connections;
isc_socktype_t type;
uint32_t perm;
static void
free_listener(controllistener_t *listener) {
- INSIST(listener->exiting);
- INSIST(ISC_LIST_EMPTY(listener->connections));
-
+ REQUIRE(isc_tid() == 0);
+ REQUIRE(listener->exiting);
+ REQUIRE(ISC_LIST_EMPTY(listener->connections));
REQUIRE(listener->sock == NULL);
free_controlkeylist(&listener->keys, listener->mctx);
if (listener->acl != NULL) {
dns_acl_detach(&listener->acl);
}
- isc_mutex_destroy(&listener->connections_lock);
isc_mem_putanddetach(&listener->mctx, listener, sizeof(*listener));
}
static void
shutdown_listener(controllistener_t *listener) {
+ REQUIRE(isc_tid() == 0);
if (!listener->exiting) {
char socktext[ISC_SOCKADDR_FORMATSIZE];
if (result != ISC_R_SUCCESS) {
control_recvmessage(handle, result, conn);
}
+
+ REQUIRE(isc_tid() == 0);
controlconnection_detach(&conn);
}
r.base = conn->buffer->base;
r.length = conn->buffer->used;
+ REQUIRE(isc_tid() == 0);
controlconnection_ref(conn);
isccc_ccmsg_sendmessage(&conn->ccmsg, &r, control_senddone, conn);
conn->request, listener->readonly, &conn->text);
control_respond(conn);
}
+
+ REQUIRE(isc_tid() == 0);
controlconnection_detach(&conn);
}
/*
* Trigger the command.
*/
+ REQUIRE(isc_tid() == 0);
controlconnection_ref(conn);
isc_async_run(named_g_mainloop, control_command, conn);
cleanup:
conn->shuttingdown = true;
+
+ REQUIRE(isc_tid() == 0);
controlconnection_detach(&conn);
}
static void
conn_free(controlconnection_t *conn) {
+ REQUIRE(isc_tid() == 0);
+
controllistener_t *listener = conn->listener;
conn_cleanup(conn);
isc_buffer_free(&conn->buffer);
}
- LOCK(&listener->connections_lock);
ISC_LIST_UNLINK(listener->connections, conn, link);
- UNLOCK(&listener->connections_lock);
#ifdef ENABLE_AFL
if (named_g_fuzz_type == isc_fuzz_rndc) {
named_fuzz_notify();
static void
newconnection(controllistener_t *listener, isc_nmhandle_t *handle) {
+ REQUIRE(isc_tid() == 0);
+
controlconnection_t *conn = isc_mem_get(listener->mctx, sizeof(*conn));
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_CONTROL, ISC_LOG_DEBUG(3),
/* Set a 32 KiB upper limit on incoming message. */
isccc_ccmsg_setmaxsize(&conn->ccmsg, 32768);
- LOCK(&listener->connections_lock);
ISC_LIST_INITANDAPPEND(listener->connections, conn, link);
- UNLOCK(&listener->connections_lock);
isccc_ccmsg_readmessage(&conn->ccmsg, control_recvmessage, conn);
}
.address = *addr,
.type = type };
isc_mem_attach(mctx, &listener->mctx);
- isc_mutex_init(&listener->connections_lock);
ISC_LINK_INIT(listener, link);
ISC_LIST_INIT(listener->keys);
ISC_LIST_INIT(listener->connections);