While investigating a mailing list question I observed that CURLINFO_ACTIVESOCKET does not actually return the active socket until after the transfer is done. This appears to be due to legacy reasons, since it is a replacement for CURLINFO_LASTSOCKET.
The socket can only be retrieved via ACTIVESOCKET after lastconnect is set, which only happens in multi_done:
The documentation says "Pass a pointer to a curl_socket_t to receive the active socket used by this curl session." That implies the socket is available before the session is done.
I did this
While investigating a mailing list question I observed that CURLINFO_ACTIVESOCKET does not actually return the active socket until after the transfer is done. This appears to be due to legacy reasons, since it is a replacement for CURLINFO_LASTSOCKET.
The socket can only be retrieved via ACTIVESOCKET after lastconnect is set, which only happens in multi_done:
curl/lib/multi.c
Lines 661 to 676 in b81e0b0
curl/lib/connect.c
Lines 1373 to 1413 in b81e0b0
I expected the following
The documentation says "Pass a pointer to a curl_socket_t to receive the active socket used by this curl session." That implies the socket is available before the session is done.
curl/libcurl version
master branch
operating system
Windows 7
The text was updated successfully, but these errors were encountered: