cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Serverside disconnection vs. simple Closing connection #n

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 22 Apr 2009 22:42:18 +0200 (CEST)

On Wed, 22 Apr 2009, Istvan Hoffmann wrote:

> I'm really wondering is there any special reason why that function not set
> result error to something like CURLE_GOT_NOTHING or CURL_PEER_DISCONNECTED
> (which is totally not existing in the error code defined list, I know) to
> let inform the caller the real reason of closing the connection.
>
> I'm also interesting it if I would modify the code mentioned above to return
> with an error result, would it case any problem in any cases later.

The reason is that in most cases the server closure is not an error, and for
the cases where the close is an error we are able to detect it otherwise.

How is your case actually an error HTTP-wise? What response headers does
libcurl get before the stream starts?

-- 
  / daniel.haxx.se
Received on 2009-04-22