How to recover from curl: (56) Send failure: Connection was reset?
I am using curl on Windows to download large files. However, the network connection is at times reset, and so I want to restart the download but unsure what parameters I should use.
I have tried
curl.exe --connect-timeout 240 --keepalive-time 240 --verbose --retry 50 --retry-max-time 0 --compressed -o "c:\largefile.bin" -C -
but the --retry doesn't work.
When connection is reset for some reason the --verbose shows the following:
* ...
* Closing connection 0
* schannel: shutting down SSL/TLS connection with example.org port 443
* Send failure: Connection was reset
* schannel: failed to send close msg: Failed sending data to the peer (bytes written: -1)
curl: (56) Send failure: Connection was resetHow do I get curl to retry on the curl: (56) Send failure: Connection was reset?
1 Answer
curl by default does not retry on all errors, even with --retry.
So either use --retry-all-errors (since curl 7.71.0), or use wget -c, where this works without extra options.