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

tool_operate: don't discard failed parallel transfer result #6921

Merged
merged 1 commit into from
Apr 20, 2021

Conversation

jay
Copy link
Member

@jay jay commented Apr 20, 2021

  • Save a parallel transfer's result code only when it fails.

Prior to this change the result code was always set which meant that a
failed result could be erroneously discarded if a later result was
successful.

Before:

curl --fail -Z https://httpbin.org/status/404 https://httpbin.org/delay/10
echo %ERRORLEVEL%
0

After:

curl --fail -Z https://httpbin.org/status/404 https://httpbin.org/delay/10
echo %ERRORLEVEL%
22

Closes #xxxx


While I was testing this I noticed that --fail --fail-early will not cause curl to exit immediately and instead it will wait for the 10 second delay transfer to complete. I'm not sure whether that could be considered a bug or not.

- Save a parallel transfer's result code only when it fails and the
  transfer is not being retried.

Prior to this change the result code was always set which meant that a
failed result could be erroneously discarded if a different transfer
later had a successful result (CURLE_OK).

Before:

> curl --fail -Z https://httpbin.org/status/404 https://httpbin.org/delay/10
> echo %ERRORLEVEL%
0

After:

> curl --fail -Z https://httpbin.org/status/404 https://httpbin.org/delay/10
> echo %ERRORLEVEL%
22

Closes #xxxx
@jay
Copy link
Member Author

jay commented Apr 20, 2021

I modified this slightly so that result isn't set by a failed transfer that is being retried.

@jay jay merged commit 711879c into curl:master Apr 20, 2021
jay added a commit to jay/curl that referenced this pull request Apr 20, 2021
- Save a parallel transfer's result code only when it fails and the
  transfer is not being retried.

Prior to this change the result code was always set which meant that a
failed result could be erroneously discarded if a different transfer
later had a successful result (CURLE_OK).

Before:

> curl --fail -Z https://httpbin.org/status/404 https://httpbin.org/delay/10
> echo %ERRORLEVEL%
0

After:

> curl --fail -Z https://httpbin.org/status/404 https://httpbin.org/delay/10
> echo %ERRORLEVEL%
22

Closes curl#6921
@jay jay deleted the fix_parallel_result branch April 20, 2021 07:35
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.

2 participants