On Thu, 17 May 2018, Sean Miller wrote:

1) In the WAITCONNECT state, libcurl calls multi_timer_cb(200) and registers 
interest in writing.
2) The FSM transitions first to SENDPROTOCONNECT and then to PROTOCONNECT.
3) Libcurl calls remsock() through sock_cb().
4) ... Nothing happens until the timer fires ~165 ms later.

What should the example do, if possible, to avoid this delay?

I think you've stepped on a libcurl bug!

Are you doing HTTPS through a HTTP proxy by any chance? That's what the PROTOCONNECT state is for basically.

While in this state, libcurl does not extract and return the correct socket to wait for and this is probably what causes this for you. I *think* this bug is present there because the CONNECT procedure was once blocking so then this state would never return a socket... and when we made that non-blocking, I probably missed this part.

Does it seem like that could be what happens in your case? If so, I'll write up a patch you can test...


 / daniel.haxx.se
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Reply via email to