diff --git a/doc/arm/Bv9ARM-book.xml b/doc/arm/Bv9ARM-book.xml index f79264a873..03ed8b786e 100644 --- a/doc/arm/Bv9ARM-book.xml +++ b/doc/arm/Bv9ARM-book.xml @@ -8252,7 +8252,8 @@ avoid-v6-udp-ports { 40000; range 50000 60000; }; The number of file descriptors reserved for TCP, stdio, etc. This needs to be big enough to cover the number of - interfaces named listens on, tcp-clients as well as + interfaces named listens on plus + tcp-clients, as well as to provide room for outgoing TCP queries and incoming zone transfers. The default is 512. The minimum value is 128 and the diff --git a/lib/ns/client.c b/lib/ns/client.c index 223eb1267c..6e58b7e350 100644 --- a/lib/ns/client.c +++ b/lib/ns/client.c @@ -3439,8 +3439,9 @@ client_accept(ns_client_t *client) { * * So, we check here to see if any other clients are * already servicing TCP queries on this interface (whether - * accepting, reading, or processing). If we find at least - * one, then it's okay *not* to call accept - we can let this + * accepting, reading, or processing). If we find that at + * least one client other than this one is active, then + * it's okay *not* to call accept - we can let this * client go inactive and another will take over when it's * done. * @@ -3454,7 +3455,8 @@ client_accept(ns_client_t *client) { * quota is tcp-clients plus the number of listening * interfaces plus 1.) */ - exit = (atomic_load(&client->interface->ntcpactive) > 0U); + exit = (atomic_load(&client->interface->ntcpactive) > + (client->tcpactive ? 1U : 0U)); if (exit) { client->newstate = NS_CLIENTSTATE_INACTIVE; (void)exit_check(client);