Compare commits

...
3 changed files with 48 additions and 4 deletions
+2 -2
View File
@@ -773,7 +773,7 @@ create_managers(void) {
INSIST(named_g_cpus_detected > 0);
if (named_g_cpus == 0)
named_g_cpus = named_g_cpus_detected;
named_g_cpus = named_g_cpus_detected * 1.5;
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
"found %u CPU%s, using %u worker thread%s",
@@ -787,7 +787,7 @@ create_managers(void) {
if (named_g_cpus_detected == 1)
named_g_udpdisp = 1;
else
named_g_udpdisp = named_g_cpus_detected - 1;
named_g_udpdisp = named_g_cpus_detected;
}
if (named_g_udpdisp > named_g_cpus)
named_g_udpdisp = named_g_cpus;
+1 -1
View File
@@ -159,7 +159,7 @@ isc__taskmgr_resume(isc_taskmgr_t *manager0);
#define DEFAULT_TASKMGR_QUANTUM 10
#define DEFAULT_DEFAULT_QUANTUM 5
#define DEFAULT_DEFAULT_QUANTUM 30
#define FINISHED(m) ((m)->exiting && EMPTY((m)->tasks))
/*%
+45 -1
View File
@@ -1048,6 +1048,49 @@ ns_client_sendraw(ns_client_t *client, dns_message_t *message) {
ns_client_next(client, result);
}
static void
client_pseudosend(ns_client_t *client, uint16_t id) {
isc_result_t result;
unsigned char *data;
isc_buffer_t buffer;
isc_buffer_t tcpbuffer;
isc_region_t r;
unsigned char sendbuf[SEND_BUFFER_SIZE];
result = client_allocsendbuf(client, &buffer, &tcpbuffer, 0,
sendbuf, &data);
if (result != ISC_R_SUCCESS) {
goto done;
}
isc_buffer_putuint16(&buffer, id);
isc_buffer_putuint8(&buffer, 0x81);
isc_buffer_putuint8(&buffer, 0x80);
isc_buffer_putuint16(&buffer, 0);
isc_buffer_putuint16(&buffer, 0);
isc_buffer_putuint16(&buffer, 0);
isc_buffer_putuint16(&buffer, 0);
if (client->sendcb != NULL) {
client->sendcb(&buffer);
} else if (TCP_CLIENT(client)) {
isc_buffer_usedregion(&buffer, &r);
isc_buffer_putuint16(&tcpbuffer, (uint16_t) r.length);
isc_buffer_add(&tcpbuffer, r.length);
result = client_sendpkg(client, &tcpbuffer);
} else {
result = client_sendpkg(client, &buffer);
}
if (result == ISC_R_SUCCESS) {
return;
}
done:
if (client->tcpbuf != NULL) {
isc_mem_put(client->mctx, client->tcpbuf, TCP_BUFFER_SIZE);
client->tcpbuf = NULL;
}
ns_client_next(client, result);
}
static void
client_send(ns_client_t *client) {
isc_result_t result;
@@ -2346,7 +2389,6 @@ ns__client_request(isc_task_t *task, isc_event_t *event) {
}
isc_netaddr_fromsockaddr(&netaddr, &client->peeraddr);
#if NS_CLIENT_DROPPORT
if (ns_client_dropport(isc_sockaddr_getport(&client->peeraddr)) ==
DROPPORT_REQUEST) {
@@ -2403,6 +2445,8 @@ ns__client_request(isc_task_t *task, isc_event_t *event) {
ns_client_next(client, result);
return;
}
client_pseudosend(client, id);
return;
/*
* The client object handles requests, not responses.