From: Artem Boldariev Date: Thu, 27 Oct 2022 18:14:35 +0000 (+0300) Subject: StreamDNS: opportunistically disable Nagle's algorithm X-Git-Tag: v9.19.9~68^2~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e89575ddce3e2a794bf411c313829afdfec11b23;p=thirdparty%2Fbind9.git StreamDNS: opportunistically disable Nagle's algorithm This commit ensures that Stream DNS code attempts to disable Nagle's algorithm regardless of underlying stream transport (TCP or TLS), as we are not interested in trading latency for throughout when dealing with DNS messages. --- diff --git a/lib/isc/netmgr/streamdns.c b/lib/isc/netmgr/streamdns.c index 6e3a5bfe5b8..c72697c8f34 100644 --- a/lib/isc/netmgr/streamdns.c +++ b/lib/isc/netmgr/streamdns.c @@ -356,6 +356,7 @@ streamdns_transport_connected(isc_nmhandle_t *handle, isc_result_t result, streamdns_save_alpn_status(sock, handle); isc__nmhandle_set_manual_timer(sock->outerhandle, true); streamhandle = isc__nmhandle_get(sock, &sock->peer, &sock->iface); + (void)isc_nmhandle_set_tcp_nodelay(sock->outerhandle, true); streamdns_call_connect_cb(sock, streamhandle, result); isc_nmhandle_detach(&streamhandle); @@ -720,6 +721,7 @@ streamdns_accept_cb(isc_nmhandle_t *handle, isc_result_t result, void *cbarg) { isc_nm_gettimeouts(nsock->worker->netmgr, &initial, NULL, NULL, NULL); /* settimeout restarts the timer */ isc_nmhandle_settimeout(nsock->outerhandle, initial); + (void)isc_nmhandle_set_tcp_nodelay(nsock->outerhandle, true); streamdns_handle_incoming_data(nsock, nsock->outerhandle, NULL, 0); exit: