cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: No error but libcurl returns CURLE_WRITE_ERROR

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 6 Apr 2003 09:29:57 +0200 (CEST)

On Fri, 4 Apr 2003, Juan Ignacio Hervás wrote:

(I trust this is a recent version of libcurl you're talking about.)

> When I call this code between three or four times (depends on the number of
> files in the remote directory), curl_easy_perform returns
> CURLE_WRITE_ERROR. The curl code is calling Curl_client_write (sendf.c) and
> this function is working with a 4096 bytes buffer:

Curl_client_write() doesn't use a buffer at all. Are you referring to a
particular callback function?

> In the first and second call it receives a buffer of 1993 bytes (these two
> files are in the same remote directory) and in the third the buffer is 172
> bytes long (but it has just 110 bytes left in its working buffer:
> 4096-1993-1993=110). Then it calls _flsbuf(c, stream) in fwrite.c and
> returns 110.
> As 110 != 172, Curl_client_write returns CURLE_WRITE_ERROR.

Isn't that correct? fwrite() should return "the number of items successfully
written". If that isn't the same amout that was passed to it, something went
wrong.

> The next time I repeat the same routine it works (the internal working
> buffer now is empty).
>
> So, is it a normal behaviour?

I've never experienced something like this.

What platform are you running this on?

> or I should not care about CURLE_WRITE_ERROR in this routine?

CURLE_WRITE_ERROR is returned when libcurl detects a write error as told by
the function it uses.

> Thanks in advance and sorry for the weird question in a Friday afternoon!

Can you provide us a full source code of an app showing this problem (when
running with libcurl 7.10.4)?

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
Received on 2003-04-06