diff options
author | Jay Satiro <raysatiro@yahoo.com> | 2020-04-11 23:19:55 -0400 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2020-04-12 18:32:16 -0400 |
commit | 0510cce8c090920f063b85a36669d8e74cff8d52 (patch) | |
tree | c334d852eb357538f3aeea5d5782b4810807650b /lib/connect.c | |
parent | be28bc2241212bbcbe4b7ac67ee1882955b5f7f3 (diff) | |
download | curl-0510cce8c090920f063b85a36669d8e74cff8d52.tar.gz |
socks: Fix blocking timeout logic
- Document in Curl_timeleft's comment block that returning 0 signals no
timeout (ie there's infinite time left).
- Fix SOCKS' Curl_blockread_all for the case when no timeout was set.
Prior to this change if the timeout had a value of 0 and that was passed
to SOCKET_READABLE it would return right away instead of blocking. That
was likely because it was not well understood that when Curl_timeleft
returns 0 it is not a timeout of 0 ms but actually means no timeout.
Ref: https://github.com/curl/curl/pull/5214#issuecomment-612512360
Closes https://github.com/curl/curl/pull/5220
Diffstat (limited to 'lib/connect.c')
-rw-r--r-- | lib/connect.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/connect.c b/lib/connect.c index 54c5f9e4c..421f90415 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -171,7 +171,8 @@ singleipconnect(struct connectdata *conn, /* * Curl_timeleft() returns the amount of milliseconds left allowed for the - * transfer/connection. If the value is negative, the timeout time has already + * transfer/connection. If the value is 0, there's no timeout (ie there's + * infinite time left). If the value is negative, the timeout time has already * elapsed. * * The start time is stored in progress.t_startsingle - as set with |