]> git.ipfire.org Git - thirdparty/curl.git/commit
Curl_timeleft: check both timeouts during connect 6745/head
authorDaniel Stenberg <daniel@haxx.se>
Mon, 15 Mar 2021 07:11:26 +0000 (08:11 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 16 Mar 2021 23:28:44 +0000 (00:28 +0100)
commite8e7ef3612d28e98b7b072f8d48c2a9f0b4662b5
tree7f5ddb3b654eb81a4d5c2da631743b62b44b6355
parent2682e5f502679c7c6949b5e4a07f41e0b9c1510f
Curl_timeleft: check both timeouts during connect

The duration of a connect and the total transfer are calculated from two
different time-stamps. It can end up with the total timeout triggering
before the connect timeout expires and we should make sure to
acknowledge whichever timeout that is reached first.

This is especially notable when a transfer first sits in PENDING, as
that time is counted in the total time but the connect timeout is based
on the time since the handle changed to the CONNECT state.

The CONNECTTIMEOUT is per connect attempt. The TIMEOUT is for the entire
operation.

Fixes #6744
Closes #6745
Reported-by: Andrei Bica
Assisted-by: Jay Satiro
lib/connect.c