iliaa Sun Dec 4 12:30:44 2005 EDT
Modified files: (Branch: PHP_5_1)
/php-src NEWS
/php-src/ext/sockets sockets.c
Log:
Fixed bug #35062 (socket_read() produces warnings on non blocking sockets).
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.271&r2=1.2027.2.272&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.271 php-src/NEWS:1.2027.2.272
--- php-src/NEWS:1.2027.2.271 Sun Dec 4 09:10:22 2005
+++ php-src/NEWS Sun Dec 4 12:30:40 2005
@@ -52,6 +52,8 @@
- 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
http://cvs.php.net/diff.php/php-src/ext/sockets/sockets.c?r1=1.171.2.4&r2=1.171.2.5&ty=u
Index: php-src/ext/sockets/sockets.c
diff -u php-src/ext/sockets/sockets.c:1.171.2.4
php-src/ext/sockets/sockets.c:1.171.2.5
--- php-src/ext/sockets/sockets.c:1.171.2.4 Sat Dec 3 18:24:29 2005
+++ php-src/ext/sockets/sockets.c Sun Dec 4 12:30:43 2005
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sockets.c,v 1.171.2.4 2005/12/03 23:24:29 tony2001 Exp $ */
+/* $Id: sockets.c,v 1.171.2.5 2005/12/04 17:30:43 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -861,7 +861,19 @@
}
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;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php