cURL / Mailing Lists / curl-library / Single Mail

curl-library

Problem with async connect in multi interface

From: yarram sunil <yvsunil_at_rediffmail.com>
Date: 16 Sep 2002 14:25:49 -0000

Hi,
   I am using curl-7.9.9-pre1 on windows.

   Data is fetched through a proxy using multi interface and same
handle is used more than once.

  An invalid socket is being reused which would be clear if we
consider the following case : All the following steps are
chronological in order
   1. A connect is made to a proxy and a wait is called
asynchronously. It timed out because proxy was down. This
connection data is stored with handle and not removed from it.
   2. Later proxy has come up
   3.Again a second request is made through the same handle, now
handle's connection data structure shows an existing connection
(which actually was timed out). Before re-using this socket, it is
checked with SocketIsDead function and this function returns zero
saying that it is a valid socket and could be reused. But the
problem is, using this socket a connect call was made earlier to
the proxy when it was down and now we are reusing the socket and
waiting on this socket for a connection to establish which will
never occur. So again we time out even the proxy has come up.

Also the function "Curl_is_connected" defined in file "connect.c"
returns "CURLE_OPERATION_TIMEOUTED" when the connect times out. I
think "CURLE_COULDNT_CONNECT" return code would be appropriate
here.

--Sunil.

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-09-16