curl / Mailing Lists / curl-library / Single Mail

curl-library

hang between connect and request sending with 7.55.1

From: Frank Meier via curl-library <curl-library_at_cool.haxx.se>
Date: Fri, 25 Aug 2017 15:46:16 +0200

Hi

I found a behaviour change in my software after upgrading from curl
7.54.1 to 7.55.1. I'm using the libcurl multi-interface to conduct HTTP
requests. Now my client always waits 200ms after the TCP handshake is
established, before sending the HTTP request.

I could reproduce the issue with a simpler test programm, from there I
userd 'git bisect' to deduce, that the behavior change was introduced by
commit [1].

With further debugging I found out, that curl_multi_fdset() does set
max_fd to -1 and curl_multi_timeout() gives ~200ms so my code waits for
this time before calling curl_multi_perform again. When I analysed the
state transitions with the debug function (curl compiled with
--enable-debug), I see the older libcurl (before [1]) did a transition
"SENDPROTOCONNECT => DO" whereas the newer one [1] does
"SENDPROTOCONNECT => PROTOCONNECT", "PROTOCONNECT => DO". And while the
state is "PROTOCONNECT" I don't get a filedescriptor (max_fd = -1) with
curl_multi_fdset().

I read in the manual, that it is possible for curl_multi_fdset() to
return -1 for max_fd when "libcurl currently does something that isn't
possible for your application to monitor", but I think that shouldn't be
the case.

Cheers, Frank

[1]
https://github.com/curl/curl/commit/5113ad0424044458ac497fa1458ebe0101356b22
[2] https://curl.haxx.se/libcurl/c/curl_multi_fdset.html

Frank Meier
Senior Software Engineer

-- 
frank.meier_at_ergon.ch, Phone: +41 44 268 87 35
Ergon Informatik AG, Merkurstrasse 43, CH-8032 Zürich
http://www.ergon.ch
______________________________________________________________
e r g o n smart people - smart software
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2017-08-25