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 jay force-pushed the fix_parallel_result branch from 9b61bf9 to 711879c Apr 20, 2021
@jay
Copy link
Member Author

@jay jay commented Apr 20, 2021

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

Loading

bagder
bagder approved these changes Apr 20, 2021
@jay jay merged commit 711879c into curl:master Apr 20, 2021
39 of 48 checks passed
Loading
jay
Copy link
Member

jay commented on 711879c Apr 20, 2021

Choose a reason for hiding this comment

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

Ref: #6921

Loading

jay added a commit to jay/curl that referenced this issue 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 Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants