cURL / Mailing Lists / curl-library / Single Mail


Re: Reciving buffer size less than CURL_MAX_WRITE_SIZE

From: Daniel Stenberg <>
Date: Mon, 28 Jan 2013 15:51:06 +0100 (CET)

On Mon, 28 Jan 2013, ilavarasan M wrote:

Please don't top-post. It makes it painful to read.

> nread = conn->recv[num](conn, num, buffertofill, bytesfromsocket,
> &curlcode);
> the return value is '0' so k->keepon value become zero and the *done becomes
> true. So the while loop in Transfer() // transfer.c comes out.
> I further analyzed the code and found that ' nread; value set by sread() in
> Curl_recv_plain() //sendf.c
> I then added a while loop to retrieve the recv() for 5 times.. but no luck i
> didnt get any debug prints and positive sign..

And the recv() man page says:

        These calls return the number of bytes received, or -1 if an error
        occurred. The return value will be 0 when the peer has performed an
        orderly shutdown.

> Can you please tell me how to rectify this error.. ?

Given this input it sounds as if the server closes the connection. Reading the
server logs or possibly wiresharking the network might help.

List admin:
Received on 2013-01-28