cURL / Mailing Lists / curl-library / Single Mail


Problems migrating from curl-7.10.6-9 to curl-7.15.5-2

From: Peter Walker <>
Date: Mon, 7 Feb 2011 18:33:55 -0000

I have an application that utilizes a webservice, via curl, through a squid proxy. The application was working fine until the o/s was upgraded from AS3 to CentOS5 with various library upgrades. Now although the application still builds with no errors or warnings, the application cannot connect to the webservice through squid, although it can connect directly to the webservice.

The version of curl on AS3 was curl-7.10.6-9 whilst the new version on CentOS5 is curl-7.15.5-2

The version of squid is 2.6.STABLE6-5, on CentOS5 and is running in forwarding mode.

I have checked all the api calls against the current online curl documentation and it all seems to be okay but I do not claim to be an expert^^

Here is an extract of what is going on, obtained using CURLOPT_VERBOSE & CURLOPT_STDERR

* About to connect() to proxy port 3128
* Trying * connected
* Connected to ( port 3128
* Establish HTTP proxy tunnel to
Proxy-Connection: Keep-Alive

< HTTP/1.0 200 Connection established
* Proxy CONNECT aborted
* Closing connection #0
* failure when receiving data from the peer

One thing to mention about that output, though hit may be a red herring, as we are not
convinced about the wireshark output on the AS3 server is that the 2 lines

Proxy-Connection: Keep-Alive

only seem to appear when run on the CentoOS5 server.

Here is a snippet of code with all the relevant curl api usages

I have snipped the overly verbose error handling and normal processing as it is not
relevant to this problem. Instead please accept my assurances that everything else in
the code works. Indeed the whole application works if I rebuild it on AS3 with the older
curl library targeting the same destination squid with the same data payload.

// global initialization
CURLcode last_error = curl_global_init(CURL_GLOBAL_SSL);

<snipped error handling>

// easy initialization
curlHandle = curl_easy_init();

<snipped error handling>

// set options
curl_easy_setopt(curlHandle, CURLOPT_VERBOSE, 1);
curl_easy_setopt(curlHandle, CURLOPT_URL, URL.c_str());
curl_easy_setopt(curlHandle, CURLOPT_HTTPPOST, 1);
curl_easy_setopt(curlHandle, CURLOPT_POSTFIELDS, formdata.c_str());
curl_easy_setopt(curlHandle, CURLOPT_POSTFIELDSIZE, formdata.size());
curl_easy_setopt(curlHandle, CURLOPT_PROXY, proxy.c_str());
curl_easy_setopt(curlHandle, CURLOPT_HEADERFUNCTION, writeHeader);
curl_easy_setopt(curlHandle, CURLOPT_HEADERDATA, this);
curl_easy_setopt(curlHandle, CURLOPT_WRITEFUNCTION, writeData);
curl_easy_setopt(curlHandle, CURLOPT_WRITEDATA, this);

<snipped data processing>

// execute
int status = curl_easy_perform(curlHandle);

BOOM! it bails at this point with an error code 56

In addition to that code, I have also played about by adding various permutations of
these curl options as well but nothing works :(

curl_easy_setopt(curlHandle, CURLOPT_HEADER, 1);
curl_easy_setopt(curlHandle, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curlHandle, CURLOPT_HTTPPROXYTUNNEL, 1);

Hey, a drowning man will clutch at straws :)

So please can anyone think of anything silly that I missed during my scouring of the API,
bearing in mind I have a limited knowledge of what I am attempting to do here, lol.

Peter Walker
Senior Developer

Ticketmaster UK Ltd.
48 Leicester Square
London WC2H 7LR
T: +44 (0) 20 7344 4000
F: +44 (0) 20 7915 0411
DISCLAIMER: This e-mail is private and confidential and may contain proprietary or legally privileged information. It is for the intended recipient only. If you have received this email in error, please notify the author by replying to it and then destroy it. If you are not the intended recipient you must not use, disclose, distribute, copy, print or rely on this e-mail or any attachment. Ticketmaster UK Limited Registered in England No. 2662632. Registered Office, 48 Leicester Square, London WC2H 7LR

List admin:
Received on 2011-02-07