Finesse TCP timeouts for upstream connections.

Timeouts for TCP connections to non-responive servers are very long.
This in not appropriate for DNS connections.

Set timeouts for connection setup, sending data and recieving data.
The timeouts for connection setup and sending data are set at 5 seconds.
For recieving the reply this is doubled, to take into account the
time for usptream to actually get the answer.

Thanks to Petr Menšík for pointing out this problem, and finding a better
and more portable solution than the one in place heretofore.
This commit is contained in:
Simon Kelley
2024-11-25 23:18:07 +00:00
parent 481ff0ed10
commit 32a8f3e009
10 changed files with 113 additions and 85 deletions

View File

@@ -453,6 +453,11 @@ struct host_record {
#define INP4 4
#define INP6 8
#define RW_WRITE 0
#define RW_READ 1
#define RW_WRITE_ONCE 2
#define RW_READ_ONCE 3
struct interface_name {
char *name; /* domain name */
char *intr; /* interface name */