On Mar 17, 2009, [email protected] wrote:

> > How about stopping the transfer immediately after the headers
> > have been received?

> Sounds like a good plan - could you tell me how to do that?


If you set up a header callback using CURLOPT_HEADERFUNCTION
that just returns (size*nmemb) for all headers, except for
the case when  (size*nmemb)==2, which indicates that you have
received the final "empty" \r\n header. If you return zero
from the callback for this case, it will cause libcurl to
abort the transfer.
In this case a return value of CURLE_WRITE_ERROR from
curl_easy_perform() would indicate "success"

And also, please read the section on top-posting at :
  http://curl.haxx.se/mail/etiquette.html


 - Jeff

Reply via email to