cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Use read/write with same curl handle.

From: Nilesh <nilesh_at_kenati.com>
Date: Wed, 01 Mar 2006 14:21:57 +0530

Some more insite.....

In file transfer.c
In function, CURLcode Curl_readwrite(struct connectdata *conn, bool *done)

I tried printing, incoming data as follows,
   /* receive data from the network! */
        int readrc = Curl_read(conn, conn->sockfd, k->buf, buffersize,
&nread);

        printf("CURL : k_buf[%s]\n", k->buf);

This k->buf shows correctly both headet and data from server responce.

Some how from there data is not getting passed to my write_callback.
Only goes to header_callback.

Nilesh wrote:

>
>
> Daniel Stenberg wrote:
>
>> On Tue, 28 Feb 2006, Nilesh wrote:
>>
>>>> And you are sure you keep looping and calling the *perform()
>>>> function as long as the transfer is still alive?
>>>
>>>
>>>
>>> Yes I do that. I have posted the loop above.
>>
>>
>>
>> Have you verified with a network sniffer that you actually do get a
>> HTTP body in the response?
>
>
> No I have not done it.
> Normal browser receives data from server. But my curl application (
> which is supposed to act as http client) doesn't receive anything but
> header.
>
>>
>> What libcurl version on what OS is this?
>
>
> it is 7.15.1 on Redhat Linux 9.
>
>>
>> Can you make your code get the body if you try a simple request to a
>> public URL somewhere?
>
>
> As i said brower request gets data properly, but not my curl.
>
>
> Another point, I am using header callback to recieve http header. This
> has been set to same curl handle.
> I tried setting CURLOPT_HEADER to non-zero, then my write_callback is
> getting callled but with data same as header.
>
> Bit confused here now :-)
>
>
Received on 2006-03-01