]> granicus.if.org Git - php/commit
Fixed bug #65486 mysqli_poll() is broken on Win x64
authorAnatol Belski <ab@php.net>
Thu, 12 Dec 2013 09:17:01 +0000 (10:17 +0100)
committerAnatol Belski <ab@php.net>
Thu, 12 Dec 2013 09:17:01 +0000 (10:17 +0100)
commitda62fd5ed824bafc4dc3e90278c3d57d8e74cbe1
tree6cfb2dfa7cb45c0a25975743dcb46ed1c7fbc41f
parentd7a45a67be2b82272a908cff54cc4d78a3c6e206
Fixed bug #65486 mysqli_poll() is broken on Win x64

While this issue is visible in mysqli_poll() functions, the cause
lays deeper in the stream to socket casting API. On Win x64 the
SOCKET datatype is a 64 or 32 bit unsigned, while on Linux/Unix-like
it's 32 bit signed integer. The game of casting 32 bit var to/from
64 bit pointer back and forth is the best way to break it.

Further more, while socket and file descriptors are always integers
on Linux, those are different things using different APIs on Windows.
Even though using integer instead of SOCKET might work on Windows, this
issue might need to be revamped more carefully later. By this time
this patch is tested well with phpt and apps and shows no regressions,
neither in mysqli_poll() nor in any other parts.
NEWS
ext/openssl/xp_ssl.c
main/streams/xp_socket.c