cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: 502 Proxy Error while POSTing files bigger than 65K

From: Rahul Rathi <rahul.rathi2005_at_gmail.com>
Date: Mon, 17 Aug 2009 22:12:50 +0530

Daniel,
I think there is no mess with the code. I sniffed the POST request it showed
the content length to be same as that of the file to be posted and the
content streams' size too was same. The file size was 80317 bytes.

The callback function was reading the data from file properly in chunks of
16K.

Here is the POST request:
POST http://207.200.36.94 HTTP/1.1\r\n
Pragma: no-cache\r\n
Accept: */*\r\n
Proxy-Connection: Keep-Alive\r\n
Content-Length: 80317
Content-Type: application/x-www-form-urlencoded\r\n
Expect: 100-continue\r\n
\r\n
[Followed by content of 80317 bytes]

I think there is nothing wrong with the POST request and my code too.

The response is 502 Proxy Error(The specified network name is no longer
valid).
This looks like proxy or web server problem. What do you think ?

On Mon, Aug 17, 2009 at 7:49 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Mon, 17 Aug 2009, Raghu PV wrote:
>
> => Daniel, If the client wants to POST/UPLOAD 2MB of data then how many
>> bytes are sent in each of the two send() calls? Could you elaborate the
>> process how perform() call manages POST for 2MB of bytes?
>>
>
> First you said you're using the read callback, so then you should know that
> libcurl will ask your app for 16K of data at a time. Of course your app may
> choose to or even be forced to send back less than 16K in each invoke.
>
> When it has gotten data from the app, it will call send() until the entire
> buffer it got has been sent off. Then it calls the read callback again to
> get more data to send.
>
> Is there even any other way it could work?
>
> --
>
> / daniel.haxx.se
>
Received on 2009-08-17