cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How to handle service unavailable

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 11 Jul 2008 10:24:53 +0200 (CEST)

On Fri, 11 Jul 2008, What you get is Not what you see wrote:

> I need to get some pages from a server. But since too many users are
> attempting to do this server gives either

> curl: (52) Empty reply from server

No HTTP server should ever cause that return code basically. If it accepts the
connection, it should response with a proper HTTP response.

> Service Unavailable responses.

That's a 503 HTTP response code I assume?

> For curl is there a way to handle this? I mean if such a response is given
> then curl will wait or try again to get the correct response? Or any other
> suggestions handling this situation?

--retry works for the 503 case but not for the error 52. You need to write
your own script for that.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2008-07-11