]> git.ipfire.org Git - thirdparty/curl.git/commit
socks: Fix blocking timeout logic
authorJay Satiro <raysatiro@yahoo.com>
Sun, 12 Apr 2020 03:19:55 +0000 (23:19 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Sun, 12 Apr 2020 22:32:16 +0000 (18:32 -0400)
commit0510cce8c090920f063b85a36669d8e74cff8d52
treec334d852eb357538f3aeea5d5782b4810807650b
parentbe28bc2241212bbcbe4b7ac67ee1882955b5f7f3
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
lib/connect.c
lib/socks.c