cURL / Mailing Lists / curl-library / Single Mail

curl-library

Bug in multi_runsingle

From: Dmitriy Sergeyev <dsergeyev_at_issart.com>
Date: Thu, 31 Aug 2006 09:43:39 +0700

Hello.

First of all, thanks a lot for such perfect library. I hope its
developing will never stopped.

And second.

It seems like I have found bug in mult_runsingle at the multi.c(639).
Now multistate(easy, CURLM_STATE_WAITCONNECT) stated there
and libcurl always switches state to CURLM_STATE_WAITCONNECT
regardless of is the protocol connect was performed
(protocol_connect variable).
But if protocol connect was performed and we are switching to
CURLM_STATE_WAITCONNECT state then as result of it protocol specific
connection routine such as Curl_http_connect tries to perform 3
times and after that connection fails.
I think in this case libcurl behavior must be the same as in
CURLM_STATE_CONNECT. If we have already performed protocol connect
then we should go directly to CURLM_STATE_DO state.

I.e. we need to replace multi.c(639):
          multistate(easy, CURLM_STATE_WAITCONNECT);

with following:
          result = CURLM_CALL_MULTI_PERFORM;

          if(protocol_connect)
            multistate(easy, CURLM_STATE_DO);
          else
            multistate(easy, CURLM_STATE_WAITCONNECT);

Without this bugfix SSL connections to one specific server are
failing.

I have libcurl 7.15.5
7.15.1 version of libcurl haven't this bug and works properly with
this specific server.

-- 
Best regards,
 Dmitriy                          mailto:dsergeyev-issart-com_at_issart.com
Received on 2006-08-31