Jordan Geoghegan via curl-users
2021-04-13 01:38:56 UTC
Hello,
I was hoping to get a sanity check here regarding semantics with the -Z/--parallel flag.
I'm using curl to download multiple files over HTTPS in a script, and I've found that no matter what, curl when invoked with -Z/--parallel always exits with a zero code. More specifically, it seems that the '--fail' and '--fail-early' flags have no effect when curl is invoked with -Z/--parallel:
$ curl --fail https://httpbin.org/status/404 || echo FAILED
curl: (22) The requested URL returned error: 404
FAILED
$ curl -Z --fail https://httpbin.org/status/404 || echo FAILED
curl: (22) The requested URL returned error: 404
$ curl --fail -s https://httpbin.org/status/404
$ echo $?
22
$ curl -Z --fail -s https://httpbin.org/status/404
$ echo $?
0
Is this is a bug, or am I just holding it wrong?
My tests were run on an OpenBSD 6.8 machine with the following 'curl -V' output:
curl 7.72.0 (x86_64-unknown-openbsd6.8) libcurl/7.72.0 LibreSSL/3.2.2 zlib/1.2.3 nghttp2/1.41.0
Release-Date: 2020-08-19
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL UnixSockets
Any insight or advice would be greatly appreciated.
Regards,
Jordan
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: h
I was hoping to get a sanity check here regarding semantics with the -Z/--parallel flag.
I'm using curl to download multiple files over HTTPS in a script, and I've found that no matter what, curl when invoked with -Z/--parallel always exits with a zero code. More specifically, it seems that the '--fail' and '--fail-early' flags have no effect when curl is invoked with -Z/--parallel:
$ curl --fail https://httpbin.org/status/404 || echo FAILED
curl: (22) The requested URL returned error: 404
FAILED
$ curl -Z --fail https://httpbin.org/status/404 || echo FAILED
curl: (22) The requested URL returned error: 404
$ curl --fail -s https://httpbin.org/status/404
$ echo $?
22
$ curl -Z --fail -s https://httpbin.org/status/404
$ echo $?
0
Is this is a bug, or am I just holding it wrong?
My tests were run on an OpenBSD 6.8 machine with the following 'curl -V' output:
curl 7.72.0 (x86_64-unknown-openbsd6.8) libcurl/7.72.0 LibreSSL/3.2.2 zlib/1.2.3 nghttp2/1.41.0
Release-Date: 2020-08-19
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL UnixSockets
Any insight or advice would be greatly appreciated.
Regards,
Jordan
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: h