Fixed bug #65268 select() implementation uses outdated tick API

This commit is contained in:
Anatol Belski 2013-07-18 18:01:51 +02:00
parent d8dd4d9b02
commit 99afc6dc11
2 changed files with 6 additions and 3 deletions

3
NEWS
View File

@ -2,6 +2,9 @@ PHP NEWS
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2013, PHP 5.5.2 ?? ??? 2013, PHP 5.5.2
- Streams:
. Fixed bug #65268 (select() implementation uses outdated tick API). (Anatol)
18 Jul 2013, PHP 5.5.1 18 Jul 2013, PHP 5.5.1
- Core: - Core:

View File

@ -36,7 +36,7 @@
* */ * */
PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tv) PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tv)
{ {
DWORD ms_total, limit; ULONGLONG ms_total, limit;
HANDLE handles[MAXIMUM_WAIT_OBJECTS]; HANDLE handles[MAXIMUM_WAIT_OBJECTS];
int handle_slot_to_fd[MAXIMUM_WAIT_OBJECTS]; int handle_slot_to_fd[MAXIMUM_WAIT_OBJECTS];
int n_handles = 0, i; int n_handles = 0, i;
@ -97,7 +97,7 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru
FD_ZERO(&awrite); FD_ZERO(&awrite);
FD_ZERO(&aexcept); FD_ZERO(&aexcept);
limit = GetTickCount() + ms_total; limit = GetTickCount64() + ms_total;
do { do {
retcode = 0; retcode = 0;
@ -149,7 +149,7 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru
} }
} }
} }
} while (retcode == 0 && (ms_total == INFINITE || GetTickCount() < limit)); } while (retcode == 0 && (ms_total == INFINITE || GetTickCount64() < limit));
if (rfds) { if (rfds) {
*rfds = aread; *rfds = aread;