From 62f306ff34f569020ce54451da7c841d162710ac Mon Sep 17 00:00:00 2001 From: Razvan Cojocaru Date: Fri, 21 Aug 2015 10:29:05 +0200 Subject: getinfo: added CURLINFO_ACTIVESOCKET This patch addresses known bug #76, where on 64-bit Windows SOCKET is 64 bits wide, but long is only 32, making CURLINFO_LASTSOCKET unreliable. Signed-off-by: Razvan Cojocaru --- docs/libcurl/curl_easy_getinfo.3 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'docs/libcurl/curl_easy_getinfo.3') diff --git a/docs/libcurl/curl_easy_getinfo.3 b/docs/libcurl/curl_easy_getinfo.3 index 82708bb60..87409a5f5 100644 --- a/docs/libcurl/curl_easy_getinfo.3 +++ b/docs/libcurl/curl_easy_getinfo.3 @@ -205,8 +205,19 @@ libcurl close the socket and cleanup other resources associated with the handle. This is typically used in combination with \fICURLOPT_CONNECT_ONLY(3)\fP. (Added in 7.15.2) -NOTE: this API is not really working on win64, since the SOCKET type on win64 -is 64 bit large while its 'long' is only 32 bits. +NOTE: this API is deprecated since it is not working on win64 where the SOCKET +type is 64 bits large while its 'long' is 32 bits. Use the +\fICURLINFO_ACTIVESOCKET\fP instead, if possible. +.IP CURLINFO_ACTIVESOCKET +Pass a pointer to a curl_socket_t to receive the active socket used by this +curl session. If the socket is no longer valid, -1 is returned. When you +finish working with the socket, you must call curl_easy_cleanup() as usual and +let libcurl close the socket and cleanup other resources associated with the +handle. This is typically used in combination with +\fICURLOPT_CONNECT_ONLY(3)\fP. + +NOTE: this is meant as a cross-platform, safe alternative to +\fICURLINFO_LASTSOCKET\fP, which does not work on win64. .IP CURLINFO_FTP_ENTRY_PATH Pass a pointer to a char pointer to receive a pointer to a string holding the path of the entry path. That is the initial path libcurl ended up in when -- cgit v1.2.3