bind9/lib/ns
Ondřej Surý bf9fd2a6ff
Reset the TCP connection on a failed send
When sending fails, the ns__client_request() would not reset the
connection and continue as nothing is happening.  This comes from the
model that we don't care about failed UDP sends because datagrams are
unreliable anyway, but it greatly affects TCP connections with
keep-alive.

The worst case scenario is as follows:

1. the 3-way TCP handshake gets completed
2. the libuv calls the "uv_connection_cb" callback
3. the TCP connection gets queue because of the tcp-clients quota
4. the TCP client sends as many DNS messages as the buffers allow
5. the TCP connection gets dropped by the client due to the timeout
6. the TCP connection gets accepted by the server
7. the data already sent by the client gets read
8. all sending fails immediately because the TCP connection is dead
9. we consume all the data in the buffer in a very tight loop

As it doesn't make sense to trying to process more data on the TCP
connection when the sending is failing, drop the connection immediately
on the first sending error.
2024-07-03 09:07:20 +02:00
..
include Remove ns_query_init() cannot fail, remove the error paths 2024-07-03 09:05:51 +02:00
.gitignore Add support for User Statically Defined Tracing (USDT) probes 2023-08-21 18:39:53 +02:00
client.c Reset the TCP connection on a failed send 2024-07-03 09:07:20 +02:00
hooks.c Remove do-nothing header <isc/print.h> 2023-02-15 16:44:47 +00:00
interfacemgr.c Fix flawed logic when detecting same listener type 2024-01-12 17:59:53 +02:00
listenlist.c Integrate TLS cipher suites support into BIND 2024-01-12 13:27:59 +02:00
log.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
Makefile.am Add support for User Statically Defined Tracing (USDT) probes 2023-08-21 18:39:53 +02:00
notify.c convert TSIG keyring storage from RBT to hash table 2023-06-14 08:14:38 +00:00
probes.d Add a probe when the response rate limiting drops or slips query 2023-08-21 18:39:53 +02:00
query.c Remove ns_query_init() cannot fail, remove the error paths 2024-07-03 09:05:51 +02:00
server.c Add a quota for SIG(0) signature checks 2024-06-10 17:33:08 +02:00
sortlist.c Convert rwlock in dns_acl to RCU 2023-10-13 14:44:40 +02:00
stats.c Return the old counter value in isc_stats_increment 2024-05-10 12:08:52 +03:00
tests Move all the unit tests to /tests/<libname>/ 2022-05-28 14:53:02 -07:00
update.c Log error when update fails 2024-06-10 16:55:12 +02:00
xfrout.c Do not lock workers when using -T transferslowly/transferstuck 2024-02-22 00:09:04 +02:00