cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: [PATCH v2] Add connection delay to Happy Eyeballs.

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Sun, 3 Nov 2013 11:47:22 +0000

On Sat, 02 Nov 2013, Steve Holme wrote:

> If I took my Proxy Server down whilst I was testing my base64
> work I received the following output from curl:
>
> * Rebuilt URL to: http://www.bing.com/
> * About to connect() to proxy 192.168.0.1 port 8080 (#0)
> * Trying 192.168.0.1...
> * Adding handle: conn: 0x139acb0
> * Adding handle: send: 0
> * Adding handle: recv: 0
> * Curl_addHandleToPipeline: length: 1
> * - Conn 0 (0x139acb0) send_pipe: 1, recv_pipe: 0
> * Whut?
> * Whut?
> * Whut?
> * Whut?
>
> This patch appears to address this and returns the standard failed
> connect output - thank you.

I saw that most of the auto builds have mostly come back to life overnight
and as such noticed that some tests are showing the "Whut?" connection
issue.

As such I have pushed my take on the Curl_is_connected() fix part of the
above mentioned patch.

As the fix had an "if" statement within the "default" section of a "switch"
statement which tested the same variable as the "switch" statement, I have
simplified the code to an "if else" block. The only query I have is there is
a "return CURLE_OK" on line 783 that I don't think needs to be there (given
that we try and avoid hard returns where possible) and the function will
simply drop out and return CURLE_OK anyway if it was removed.

Additionally, it is worth noting that under curl v7.33.0 the output in case
of a "no server listening" error was:

* Rebuilt URL to: http://www.bing.com/
* About to connect() to proxy 192.168.0.1 port 8080 (#0)
* Trying 192.168.0.1...
* Adding handle: conn: 0x623120
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x623120) send_pipe: 1, recv_pipe: 0
* Connection refused
* Failed connect to www.bing.com:8080; No error
* Closing connection 0
curl: (7) Failed connect to www.bing.com:8080; No error

Whilst under the development version it is now:

* Rebuilt URL to: http://www.bing.com/
* About to connect() to proxy 192.168.0.1 port 8080 (#0)
* Trying 192.168.0.1...
* Adding handle: conn: 0x245bcf0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x245bcf0) send_pipe: 1, recv_pipe: 0
* connect to 192.168.0.1 port 8080: Connection refused
* Failed to connect to www.bing.com port 8080: Connection refused
* Closing connection 0
curl: (7) Failed to connect to www.bing.com port 8080: Connection refused

The difference being in the last 3 debug / info failure message lines.

The error level from curl is still CURLE_COULDNT_CONNECT (7) so I don't
think there are any after effects of this but I just wanted to raise it for
others to comment on (if necessary).

Kind Regards

Steve
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-11-03