curl-library
Re: 502 Proxy Error while POSTing files bigger than 65K
Date: Mon, 17 Aug 2009 15:03:12 +0100
2009/8/17 Daniel Stenberg <daniel_at_haxx.se>
> On Mon, 17 Aug 2009, Rahul Rathi wrote:
>
> - I am facing problem while POSTing file with size more than 65K.
>> The server expects the Expect: 100-Continue to be set for files more than
>> size 65K which the libCurl sets on its own.
>>
>
> First, let's try to get the facts straight.
>
> libcurl adds a "Expect: 100-Continue" by default if you POST more than 1024
> bytes. There's a 64K size for posts too, but that's when you don't use
> 100-Continue and then libcurl will cram it all into a single allocated
> buffer and send off in one go, while if the posted data is larger than 64K
> it will simply first send the request and then the body in two separate
> send() calls.
>
> Further, you say "The server" and yet it is a 502 code which is a "proxy
> complaint". Is it really the server which complains or is it the proxy?
>
=> 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?
>
>
> - The request is going through the proxy. Set the proxy using
>> CURLOPT_PROXY.
>> - I am using callback functions to send the file.
>>
>
> You can of course use CURLOPT_DEBUGFUNCTION to get a full trace of exactly
> what and how libcurl sends data. That should help a lot. Is the proxy/server
> right in comlaining on this request? If so, what's wrong with it?
>
> Using curl.exe, i am able to post files with size more than 65K, but with
>> libCurl i am getting the error '502 Proxy Error(Network name no longer
>> valid)' for files of size more than 65K.
>>
>
> Well, that could be for many reasons... It could be that your code messes
> things up. It could be that the curl tool doesn't use the read callback for
> doing this, and the problem is only related to using that.
>
> --
>
> / daniel.haxx.se
>
Received on 2009-08-17