cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: write callback issues (was Re: A new problem)

From: Linus Nielsen Feltzing <linus_at_haxx.se>
Date: Tue, 08 Apr 2008 14:12:03 +0200

Prasad J Pandit wrote:
> My problem is, the callback function recv_data(..) gets called by
> libcurl even *before* the server *actually* sends any reply back.
>
> Is that very difficult to comprehend?

In fact it is. I have a hard time understanding how that could be
possible. Would it be possible for you to do the same transaction using
the curl.exe program, using the --trace option, just to see what the
server is supposed to send?

In any case, you must write your callback in such a manner that it can
receive the response in chunks, with several calls to the callback
function. That is how libcurl works. When you have done that, chances
are that your program works as intended.

Linus
Received on 2008-04-08