File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ PHP NEWS
52
52
- Fixed bug #35381 (ssl library is not initialized properly). (Alan)
53
53
- Fixed bug #35373 (HP-UX "alias not allowed in this configuration"). (Dmitry)
54
54
- Fixed bug #35103 (mysqli handles bad unsigned (big)int incorrectly).(Andrey)
55
+ - Fixed bug #35062 (socket_read() produces warnings on non blocking sockets).
56
+ (Nuno, Ilia)
55
57
- Fixed bug #35028 (SimpleXML object fails FALSE test). (Marcus)
56
58
57
59
28 Nov 2005, PHP 5.1.1
Original file line number Diff line number Diff line change @@ -861,7 +861,19 @@ PHP_FUNCTION(socket_read)
861
861
}
862
862
863
863
if (retval == -1 ) {
864
- PHP_SOCKET_ERROR (php_sock , "unable to read from socket" , errno );
864
+ /* if the socket is in non-blocking mode and there's no data to read,
865
+ don't output any error, as this is a normal situation, and not an error */
866
+ if (errno == EAGAIN
867
+ #ifdef EWOULDBLOCK
868
+ || errno == EWOULDBLOCK
869
+ #endif
870
+ ) {
871
+ php_sock -> error = errno ;
872
+ SOCKETS_G (last_error ) = errno ;
873
+ } else {
874
+ PHP_SOCKET_ERROR (php_sock , "unable to read from socket" , errno );
875
+ }
876
+
865
877
efree (tmpbuf );
866
878
RETURN_FALSE ;
867
879
}
You can’t perform that action at this time.
0 commit comments