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.
. Fixed bug #64405 (Use freetype-config for determining freetype2 dir(s)).
(Adam)
+- MySQLi:
+ . Fixed bug #65486 (mysqli_poll() is broken on win x64). (Anatol)
+
- SOAP
. Fixed bug #66112 (Use after free condition in SOAP extension).
(martin dot koegler at brz dot gv dot at)
case PHP_STREAM_AS_FD_FOR_SELECT:
if (ret) {
- *(int *)ret = sslsock->s.socket;
+ *(php_socket_t *)ret = sslsock->s.socket;
}
return SUCCESS;
return FAILURE;
}
if (ret) {
- *(int *)ret = sslsock->s.socket;
+ *(php_socket_t *)ret = sslsock->s.socket;
}
return SUCCESS;
default:
case PHP_STREAM_AS_FD:
case PHP_STREAM_AS_SOCKETD:
if (ret)
- *(int*)ret = sock->socket;
+ *(php_socket_t *)ret = sock->socket;
return SUCCESS;
default:
return FAILURE;