Make TLS Handshake timeout max 4/5th of timeout

for the query, just like connection setup timeout was, so fallback transport have a chance too when TCP connection setup is less well detectable (as with TCP_FASTOPEN on MacOS).
This commit is contained in:
Willem Toorop 2020-03-16 14:50:59 +01:00
parent 0b01ad8e6f
commit 73cee29f55
2 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,8 @@
* 2020-0?-??: Version 1.6.1-rc.1
* Make TLS Handshake timeout max 4/5th of timeout for the query,
just like connection setup timeout was, so fallback transport
have a chance too when TCP connection setup is less well
detectable (as with TCP_FASTOPEN on MacOS).
* Issue #466: Memory leak with retrying queries (for examples
with search paths). Thanks doublez13.

View File

@ -984,7 +984,7 @@ tls_do_handshake(getdns_upstream *upstream)
int r;
while ((r = _getdns_tls_connection_do_handshake(upstream->tls_obj)) != GETDNS_RETURN_GOOD)
{
uint64_t timeout_tls = _getdns_ms_until_expiry(upstream->expires);
uint64_t timeout_tls = _getdns_ms_until_expiry(upstream->expires)/5*4;
if (timeout_tls < MIN_TLS_HS_TIMEOUT)
timeout_tls = MIN_TLS_HS_TIMEOUT;