cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Is --ftp-retry a good idea?

From: James Smith <james_at_discs.uk.com>
Date: Tue, 26 Oct 2004 14:45:14 +0100

> What conditions would the retry be based on in the HTTP case?

Personally I would think any status code in the 5xx range could safely be
retried, I have had several situations where a server has returned a "500 -
Internal server error" only to then work perfectly on a simple refresh.

Looking at the w3 protocols for response codes...

2xx is a success of one type or another, no need to retry here!
3xx are all redirects already supported by cURL.
400 is a bad request, no point retrying the same request.
401 is unauthorised, no point retrying without adding some user/pass
details.
402 is payment required, no point retrying the same request.
403 is forbidden and this wouldn't change even with user/pass details.
404 is a missing template, unlikely to reappear on its own.
500 is an internal error, safe to retry these, they might work.
501 is a not implemented error, I have never come across one of these, it
may be pointless to retry these, I don't know.
502 is an overloaded server, an obvious candidate for a retry.
503 is a gateway timeout, again a simple retry may solve the problem.

It is also safe to assume a simple timeout error (which would have no status
code of course) could be retried.

--
Jay
Received on 2004-10-26