iliaa           Sun Dec  4 12:32:28 2005 EDT

  Modified files:              (Branch: PHP_4_4)
    /php-src    NEWS 
    /php-src/ext/sockets        sockets.c 
  Log:
  MFH: Fixed bug #35062 (socket_read() produces warnings on non blocking 
  sockets).
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.920.2.90&r2=1.1247.2.920.2.91&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.90 php-src/NEWS:1.1247.2.920.2.91
--- php-src/NEWS:1.1247.2.920.2.90      Wed Nov 30 13:12:43 2005
+++ php-src/NEWS        Sun Dec  4 12:32:26 2005
@@ -5,6 +5,8 @@
   properly). (Ilia)
 - Fixed bug #35341 (Fix for bug #33760 breaks build with older curl). (Tony)
 - Fixed bug #35278 (Multiple virtual() calls crash Apache 2 php module). (Ilia)
+- Fixed bug #35062 (socket_read() produces warnings on non blocking sockets).
+  (Nuno, Ilia)
 - Fixed bug #33153 (crash in mssql_next result). (Frank)
 - Fixed bug #32009 (crash when mssql_bind() is called more than once). (Frank)
 - Fixed bug #33963 (mssql_bind() fails on input parameters). (Frank)
http://cvs.php.net/diff.php/php-src/ext/sockets/sockets.c?r1=1.125.2.29.2.1&r2=1.125.2.29.2.2&ty=u
Index: php-src/ext/sockets/sockets.c
diff -u php-src/ext/sockets/sockets.c:1.125.2.29.2.1 
php-src/ext/sockets/sockets.c:1.125.2.29.2.2
--- php-src/ext/sockets/sockets.c:1.125.2.29.2.1        Thu Nov  3 09:58:43 2005
+++ php-src/ext/sockets/sockets.c       Sun Dec  4 12:32:27 2005
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: sockets.c,v 1.125.2.29.2.1 2005/11/03 14:58:43 mike Exp $ */
+/* $Id: sockets.c,v 1.125.2.29.2.2 2005/12/04 17:32:27 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -839,7 +839,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

Reply via email to