diff --git a/lib/isc/netmgr/tcpdns.c b/lib/isc/netmgr/tcpdns.c index de45754443..67e5a95cb4 100644 --- a/lib/isc/netmgr/tcpdns.c +++ b/lib/isc/netmgr/tcpdns.c @@ -1269,12 +1269,18 @@ isc__nm_async_tcpdnssend(isc__networker_t *worker, isc__netievent_t *ev0) { goto fail; } + if (!sock->client && sock->reading) { + sock->reading_throttled = true; + isc__nm_stop_reading(sock); + } + isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_NETMGR, ISC_LOG_DEBUG(3), - "throttling TCP connection, the other side is not " - "reading the data, switching to uv_write()"); - sock->reading_throttled = true; - isc__nm_stop_reading(sock); + "%sthe other side is not " + "reading the data, switching to uv_write()", + !sock->client && sock->reading + ? "throttling TCP connection, " + : ""); r = uv_write(&uvreq->uv_req.write, &sock->uv_handle.stream, bufs, nbufs, tcpdns_send_cb); diff --git a/lib/isc/netmgr/tlsdns.c b/lib/isc/netmgr/tlsdns.c index e0517da008..127e09a8a7 100644 --- a/lib/isc/netmgr/tlsdns.c +++ b/lib/isc/netmgr/tlsdns.c @@ -1377,13 +1377,18 @@ tls_cycle_output(isc_nmsocket_t *sock) { break; } - isc_log_write( - isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_NETMGR, - ISC_LOG_DEBUG(3), - "throttling TCP connection, the other side is not " - "reading the data, switching to uv_write()"); - sock->reading_throttled = true; - isc__nm_stop_reading(sock); + if (!sock->client && sock->reading) { + sock->reading_throttled = true; + isc__nm_stop_reading(sock); + } + + isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, + ISC_LOGMODULE_NETMGR, ISC_LOG_DEBUG(3), + "%sthe other side is not " + "reading the data, switching to uv_write()", + !sock->client && sock->reading + ? "throttling TCP connection, " + : ""); r = uv_write(&req->uv_req.write, &sock->uv_handle.stream, &req->uvbuf, 1, tls_write_cb);