Skip to content

Commit

Permalink
tool_operate: change precedence of server Retry-After time
Browse files Browse the repository at this point in the history
- When calculating the retry time, no longer allow a server's requested
  Retry-After time to take precedence over a longer retry time (either
  default algorithmic or user-specified).

Prior to this change the server's Retry-After time took precedence over
curl's retry time in all cases, but that's not always practical for
short Retry-After times depending on how busy the server is.

Bug: https://curl.se/mail/archive-2024-01/0022.html
Reported-by: Dirk Hünniger

Closes #12871
  • Loading branch information
bagder authored and jay committed Feb 7, 2024
1 parent 911fc96 commit 924e264
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tool_operate.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ static CURLcode post_per_transfer(struct GlobalConfig *global,
/* store in a 'long', make sure it doesn't overflow */
if(retry_after > LONG_MAX/1000)
sleeptime = LONG_MAX;
else
else if((retry_after * 1000) > sleeptime)
sleeptime = (long)retry_after * 1000; /* milliseconds */

/* if adding retry_after seconds to the process would exceed the
Expand Down

0 comments on commit 924e264

Please sign in to comment.