Skip to content

socks: Fix blocking timeout logic#5220

Closed
jay wants to merge 1 commit intocurl:masterfrom
jay:fix_socks_blocking_timeout
Closed

socks: Fix blocking timeout logic#5220
jay wants to merge 1 commit intocurl:masterfrom
jay:fix_socks_blocking_timeout

Conversation

@jay
Copy link
Copy Markdown
Member

@jay jay commented Apr 12, 2020

  • 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: #5214 (comment)

Closes #xxxx

- 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: curl#5214 (comment)

Closes #xxxx
Copy link
Copy Markdown
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

mback2k added a commit to mback2k/curl that referenced this pull request Apr 12, 2020
Assisted-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Similar to curl#5220 and curl#5221
Closes curl#5214
jay pushed a commit that referenced this pull request Apr 12, 2020
Prior to this change gopher's blocking code would block forever,
ignoring any set timeout value.

Assisted-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Similar to #5220 and #5221
Closes #5214
@jay jay closed this in 0510cce Apr 12, 2020
@jay jay deleted the fix_socks_blocking_timeout branch April 14, 2020 18:52
mback2k added a commit to mback2k/curl that referenced this pull request Apr 20, 2020
Now that all functions in select.[ch] take timediff_t instead
of the limited time_t or int, we can remove type conversions
and related preprocessor checks to silence compiler warnings.

Related to curl#5262
Supersedes curl#5214, curl#5220 and curl#5221
Closes curl#5240
mback2k added a commit to mback2k/curl that referenced this pull request Jun 5, 2020
Now that all functions in select.[ch] take timediff_t instead
of the limited int or long, we can remove type conversions
and related preprocessor checks to silence compiler warnings.

Avoiding conversions from time_t was already done in 842f73d.

Based upon curl#5262
Supersedes curl#5214, curl#5220 and curl#5221
Follow up to curl#5343 and curl#5479
Closes curl#5490
mback2k added a commit that referenced this pull request Jun 6, 2020
Now that all functions in select.[ch] take timediff_t instead
of the limited int or long, we can remove type conversions
and related preprocessor checks to silence compiler warnings.

Avoiding conversions from time_t was already done in 842f73d.

Based upon #5262
Supersedes #5214, #5220 and #5221
Follow up to #5343 and #5479
Closes #5490
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants