cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURLOPT_WRITEFUNCTION question

From: Scott Rallya <srallya_at_gmail.com>
Date: Tue, 6 May 2008 12:34:36 -0400

  I had a question regarding the mechanics of libcurl and the
CURLOPT_WRITEFUNCTION option. In the call-back I wrote, in the event of a
write failure instead of returning 0 I set a flag indicating an error
occured and return the total size of the buffer passed in. I do a check on
this flag, and if the flag is set to true I don't write anything over a
socket but continue to return the total size of the buffer. The reasoning is
that in the event of a write failure I want to read in all the data from the
backend server anyways. Is this something that would be well handled within
libcurl? Is there any situation, for example, that doing it this way will
force curl to sit waiting to read in data from the backend server instead of
otherwise returning an error and aborting the transfer?
Received on 2008-05-06