Browse Source

Prevent incorrect warning message from occuring on an EOF of socket_read.

experimental/namespaces
Jason Greene 25 years ago
parent
commit
54905782b6
  1. 7
      ext/sockets/sockets.c

7
ext/sockets/sockets.c

@ -785,8 +785,11 @@ PHP_FUNCTION(socket_read)
#endif
if (retval <= 0) {
php_error(E_WARNING, "Couldn't read %d bytes from socket %d [%d]: %s",
Z_LVAL_PP(arg2), php_sock->bsd_socket, errno, strerror(errno));
if (retval != 0) {
/* Not EOF */
php_error(E_WARNING, "Couldn't read %d bytes from socket %d [%d]: %s",
Z_LVAL_PP(arg2), php_sock->bsd_socket, errno, strerror(errno));
}
efree(tmpbuf);
RETURN_FALSE;
}

Loading…
Cancel
Save