curl-library
Re: CURLM Chain of events
Date: Wed, 27 Jan 2016 16:49:33 +0000 (UTC)
So I wanted to see how libcurl deals with dropped connections and I did a small test.
Consider the following setup:
(computer) -> (hub) -> (adsl modem)
I arranged it that way so the computer NIC would not be factor in the test.
I wrote a small program that simply downloads a file and while the download was in progress, I turned off the modem.
Interestingly, the program was stuck on the event loop (epoll_wait) indefinitely.
After doing some debugging it turned out that once my timer call back calls: curl_multi_socket_action(curl_m_handle, CURL_SOCKET_TIMEOUT, 0, &running_handles); when the timeout elapses Libcurl doesn’t call my socket_callback to notify me that I need to unregister from the eventloop (CURL_POLL_REMOVE). More specifically Curl_splaygetbest identified the timeout socket and in turn called multi_runsingle and singlesocket() but the remove_sock_from_hash block was not entered. BTW, I tested this both on Windows and Linux – same behavior.
Any idea why?
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2016-01-27