Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retry_after value is not reset crossing multiple requests for the same curl object #5661

Closed
JoeyLiang-0 opened this issue Jul 8, 2020 · 2 comments
Assignees

Comments

@JoeyLiang-0
Copy link

When using the same curl object to make multiple requests, the retry_after value is not reset before the request while all others from PureInfo are reset correctly. If some responses have retry-after header but some responses do not, the responses without retry-after header will carry the retry-after value from previous request/response.
The patch attached.

diff --git a/lib/getinfo.c b/lib/getinfo.c
index 6d5bd5fc5..35b27ea20 100644
--- a/lib/getinfo.c
+++ b/lib/getinfo.c
@@ -81,6 +81,7 @@ CURLcode Curl_initinfo(struct Curl_easy *data)
 
   info->conn_scheme = 0;
   info->conn_protocol = 0;
+  info->retry_after = 0;
 
 #ifdef USE_SSL
   Curl_ssl_free_certinfo(data);

curl-retry-after.patch.txt

@JoeyLiang-0 JoeyLiang-0 changed the title retry_after value is not reset crossing multiple request for the same curl object retry_after value is not reset crossing multiple requests for the same curl object Jul 8, 2020
@bagder
Copy link
Member

bagder commented Jul 9, 2020

Seems accurate. If no one beats me to it, I'll convert this to a PR and maybe create a test case for it, next week.

@sterchelen
Copy link
Contributor

I am virtually clicking on Assign to me :)

sterchelen pushed a commit to sterchelen/curl that referenced this issue Jul 10, 2020
- Avoid re-using retry_after value from preceding request
- Add libtest

ref curl#5661
sterchelen pushed a commit to sterchelen/curl that referenced this issue Jul 10, 2020
- Avoid re-using retry_after value from preceding request
- Add libtest

ref curl#5661
sterchelen pushed a commit to sterchelen/curl that referenced this issue Jul 10, 2020
- Avoid re-using retry_after value from preceding request
- Add libtest

Thanks to @joey-l-us for having see it.

ref curl#5661
sterchelen pushed a commit to sterchelen/curl that referenced this issue Jul 19, 2020
- Avoid re-using retry_after value from preceding request
- Add libtest

Thanks to @joey-l-us for having see it.

ref curl#5661
@bagder bagder closed this as completed in 0b85969 Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants