mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Fixed bug #35062 (socket_read() produces warnings on non blocking sockets).
This commit is contained in:
parent
b01f5b35f5
commit
15afc78f85
2
NEWS
2
NEWS
@ -52,6 +52,8 @@ PHP NEWS
|
||||
- Fixed bug #35381 (ssl library is not initialized properly). (Alan)
|
||||
- Fixed bug #35373 (HP-UX "alias not allowed in this configuration"). (Dmitry)
|
||||
- Fixed bug #35103 (mysqli handles bad unsigned (big)int incorrectly).(Andrey)
|
||||
- Fixed bug #35062 (socket_read() produces warnings on non blocking sockets).
|
||||
(Nuno, Ilia)
|
||||
- Fixed bug #35028 (SimpleXML object fails FALSE test). (Marcus)
|
||||
|
||||
28 Nov 2005, PHP 5.1.1
|
||||
|
@ -861,7 +861,19 @@ PHP_FUNCTION(socket_read)
|
||||
}
|
||||
|
||||
if (retval == -1) {
|
||||
PHP_SOCKET_ERROR(php_sock, "unable to read from socket", errno);
|
||||
/* if the socket is in non-blocking mode and there's no data to read,
|
||||
don't output any error, as this is a normal situation, and not an error */
|
||||
if (errno == EAGAIN
|
||||
#ifdef EWOULDBLOCK
|
||||
|| errno == EWOULDBLOCK
|
||||
#endif
|
||||
) {
|
||||
php_sock->error = errno;
|
||||
SOCKETS_G(last_error) = errno;
|
||||
} else {
|
||||
PHP_SOCKET_ERROR(php_sock, "unable to read from socket", errno);
|
||||
}
|
||||
|
||||
efree(tmpbuf);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user