From 624f68896767e1831ae656dbd7d4634e2ab6f342 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 26 May 2021 15:57:52 +0200 Subject: [PATCH] Honour the claim from documentation: When not set (the default), the system default is left alone. --- src/stub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stub.c b/src/stub.c index 49d2ac9d..afe03459 100644 --- a/src/stub.c +++ b/src/stub.c @@ -487,7 +487,8 @@ tcp_connect(getdns_upstream *upstream, getdns_transport_list_t transport, return -1; getdns_sock_nonblock(fd); - getdns_sock_tcp_send_timeout(upstream, fd, send_timeout); + if (send_timeout != -1) + getdns_sock_tcp_send_timeout(upstream, fd, send_timeout); #ifdef USE_OSX_TCP_FASTOPEN sa_endpoints_t endpoints; endpoints.sae_srcif = 0;