Skip to content

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

Merged
jay merged 1 commit intocurl:masterfrom
jay:fix_parallel_result
Apr 20, 2021
Merged

tool_operate: don't discard failed parallel transfer result#6921
jay merged 1 commit intocurl:masterfrom
jay:fix_parallel_result

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 Compare April 20, 2021 05:52
@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 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