cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Use read/write with same curl handle.

From: Nilesh <nilesh_at_kenati.com>
Date: Thu, 02 Mar 2006 10:13:16 +0530

Daniel Stenberg wrote:

> On Wed, 1 Mar 2006, Nilesh wrote:
>
> (Please trim your quotes, there's no need to send back a whole chunk
> of source code again.)

    Sorry for inconvenience. Will take care next time onwards

>
>
>> I used the same for for testing response from the server ( with only
>> difference is , I have reset the default http header Expect: using
>> CURLOPT_HTTPHEADER)
>
>
> Why? My example didn't cause any Expect: header to get sent...

   No idea, but in my case it tried to send Expect header. So I reset
that because my server HTTP 1.0 based.

>
>> Following is the what I got when I ran the binary,*
>
>
> I think you should use the _exact_ source code I sent against the same
> server. It would make a better test IMHO.
>
>> - I am runing this on bug-endian machine ( PPC arch). Wonring is this
>> is causing problem.
>
>
> Well it could of course, but this has worked on big endian machines
> for ages so it would surprise me.
>
> For the fun of it, I built a fresh curl on an AIX box (on PPC) and
> tried a similar test and it worked nicely for me.

     Yes, even I tried on ARM architecture which is BIG Endian and it
worked fine. Some problem seems to be with PPC.

>
>> when I tried putting this call in ( REAL HACK ) transfer.c at line
>> no. 1211 ( Approx)
>
>
> Now this puzzles me. You said you use 7.15.1, and when I look at line
> 1211 in transfer.c as it was back in 7.15.1 it concerns _writing_ data
> (as in sending it off to the peer) and not receiving. Did you really
> add the function invoke there?

    First of all why should lie. Here is code where I tried putting
hack.

/# ifdef CODE_HACK
    result = Curl_client_write(data, CLIENTWRITE_BODY, k->str, nread);
    if(result)
    return result;
#endif
/#ifndef CURL_DISABLE_HTTP
          if(conn->bits.chunk) {
            /*
             * Bless me father for I have sinned. Here comes a chunked
             * transfer flying and we need to decode this properly. While
             * the name says read, this function both reads and writes away
             * the data. The returned 'nread' holds the number of actual
             * data it wrote to the client. */

            CHUNKcode res =
              Curl_httpchunk_read(conn, k->str, nread, &nread);

            if(CHUNKE_OK < res) {

>
> And BTW, while you're at poking in the code, you could just as well
> jump to 7.15.2.

    I will try this.

--Nilesh
Received on 2006-03-02