cURL / Mailing Lists / curl-library / Single Mail

curl-library

curl_multi reuse connection problem

From: comain chen <comain_at_gmail.com>
Date: Thu, 17 Feb 2011 16:46:27 +0800

Hi,

1. When using persistent connections, is there a reliable way to
detect whether the reused connection is still alive?
I think there is no way to do so. Therefore, the transfer over a
reused connection can fail at all possible stages (i.e. the reused
connection is suddenly dad)

2. If the above is true,  all states in curl_multi_runsingle should
check for this case and make sure to retry a new fresh connection to
recover.
I can see this in CURLM_STATE_DO but apparently the check is missed in
several other stages (for example in CURLM_STATE_PERFORM).

This caused my problem, I am using mutli to connect to several http
servers which does not favor persistent connection and closed the
connection immediately
after response. When a later request comes, it is possible that an old
dead connection is reused and caused failure in various stages.

Best regrads,
Chen,Congwu

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-17