cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Peter Walker <Peter.Walker_at_ticketmaster.co.uk>
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 pxy1.internal.network port 3128
* Trying 192.168.0.1... * connected
* Connected to pxy1.internal.network (192.168.0.1) port 3128
* Establish HTTP proxy tunnel to test.com:443
> CONNECT test.com:443 HTTP/1.0
Host: test.com:443
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

Host: test.com:443
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
E:peter.walker_at_ticketmaster.co.uk
E:pep_at_ticketweb.co.uk
 
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: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-07