Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
[win64] fix for broken hash fn on windows 64: ensure modulo performed on unsigned ints. #712
As discussed here: pycurl/pycurl#395 there is an issue on 64 bit windows that will produce a segmentation fault due to bad indexing on the hash table due to a broken hash function
Because it's just a hash function, the impact of performing the hash function over a cast to
So my suggested edit would make the patch like this:
@bagder we've had this not working on 64-bit windows for a while, but figured it'd be fixed upstream. I just think the problem had largely gone unnoticed by the community, for us it seems like the problem arises strictly when using curl multi. I feel like It might be a compiler issue on
I think the case that triggers the segfault is when
I submitted an amended version. Let me know if you want me to make any additional changes, or touch-up anything else.
Simplify the code by using a single entry that looks for a socket in the socket hash. As indicated in #712, the code looked for CURL_SOCKET_BAD at some point and that is ineffective/wrong and this makes it easier to avoid that.