curl-library
Re: CURLINFO_LASTSOCKET Windows 64 patch
Date: Sun, 16 Aug 2015 10:19:43 +0300
On 08/16/2015 12:33 AM, Daniel Stenberg wrote:
> On Fri, 14 Aug 2015, Razvan Cojocaru wrote:
>
>> Known bug #76 [1] states that "the SOCKET type in Win64 is 64 bits
>> large (and thus so is curl_socket_t on that platform), and long is
>> only 32 bits. It makes it impossible for curl_easy_getinfo() to return
>> a socket properly with the CURLINFO_LASTSOCKET option as for all other
>> operating systems."
>
>> 174 *(long long *)param_longp = sockfd;
>
> That could be done, but then that'd break existing programs that use
> CURLINFO_LASTSOCKET where long and long long are not the same size. So
> no, that is unfortunately not a good fix.
>
> I think a better fix is probably to introduce a CURLINFO_LASTSOCKET
> replacement that simply returns a pointer to a curl_socket_t instead of
> a long.
Fair enough, will CURLINFO_LASTSOCKET_CROSSPLATFORM do? I'll send out a
patch once we're agreed on the naming.
Thanks,
Razvan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-08-16