cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Does cURL resend request prior to returning, 52 error?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 4 Aug 2003 23:34:45 +0200 (CEST)

On Mon, 4 Aug 2003, Laurie Barker wrote:

> Can anybody advise as to weather cURL retries a HTTP1.1 POST when it
> encounters a 52 error (The server didn't reply anything), or is it up to us
> to program this functionality?

curl never retries failed operations, be it error 52 or any other error.

> cURL version: 7.10.4

We have corrected some problems that could wrongly return error 52 in later
versions.

> We are 100% positive that the fault with regard the encountered error 52 is
> not due to cURL. In this case cURL is used as a fall back routine in our
> screen scrape class, in the event the fsockopen HTTP1.0 request returns
> empty and only when failure is not due to connect/timeout error.
>
> cURL was wrote into the class to solve this issue and in part it has,
> changing the error from 100% consistent failure when performing a POST with
> HTTP1.0, to intermittent failure when performing a POST with HTTP1.1.
>
> This error is only encountered when communicating with a particular
> site/server, we are convinced that the server (IBM-HTTP-Server/1.0) is
> prematurely closing the connection.

Very prematurely I'd say if error 52 is returned, as then no data at all was
returned.

> My question is based on my interpretation of the following:
>
> Extract from http://www.ietf.org/rfc/rfc2616.txt, Hypertext Transfer
> Protocol -- HTTP/1.1 standard document (gripping bedtime reading).
>
> 8.2.4 Client Behavior if Server Prematurely Closes Connection
>
> If an HTTP/1.1 client sends a request which includes a request body,
> but which does not include an Expect request-header field with the
> "100-continue" expectation, and if the client is not directly
> connected to an HTTP/1.1 origin server, and if the client sees the
> connection close before receiving any status from the server, the
> client SHOULD retry the request.

libcurl does not retry the request when this case occurs. I'm also a bit
puzzled on how it would know if the server is "an HTTP/1.1 origin server" or
not if if doesn't return any status at all...

If you or anyone else feel like giving this a shot and want to improve libcurl
in this area, well then I am interested in help.

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-04