cURL / Mailing Lists / curl-library / Single Mail

curl-library

502 Proxy Error while POSTing files bigger than 65K

From: Rahul Rathi <rahul.rathi2005_at_gmail.com>
Date: Mon, 17 Aug 2009 17:56:43 +0530

   - 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.
   - The request is going through the proxy. Set the proxy using
   CURLOPT_PROXY.
   - I am using callback functions to send the file.

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.

I am using read and write callback functions.I am setting the size of the
data and proxy in this way:

curlcode = ::curl_easy_setopt(m_pCurlEasyHandle, CURLOPT_POST, 1L)

curlcode = ::curl_easy_setopt(m_pCurlEasyHandle, CURLOPT_POSTFIELDSIZE,
(curl_off_t)fileStat.st_size);

curlcode = ::curl_easy_setopt(m_pCurlEasyHandle,
CURLOPT_INFILESIZE_LARGE,(curl_off_t)fileStat.st_size);

curlcode = ::curl_easy_setopt(m_pCurlEasyHandle, CURLOPT_PROXY, "
10.55.2.25:8080");
Any guess why this might be happening when curl.exe wroks fine with the same

proxy.So, this should not be a server problem. I am able to post files
lesser than 65K successfully.
Received on 2009-08-17