nr_bytes = recv(sock->socket, buf, count, 0);
- if (nr_bytes == 0 || (nr_bytes < 0 && php_socket_errno() != EWOULDBLOCK)) {
+ if (nr_bytes == 0 || (nr_bytes < count && php_socket_errno() != EWOULDBLOCK)) {
stream->eof = 1;
}
}
if (data->fd >= 0) {
ret = read(data->fd, buf, count);
- if (ret == 0 || (ret < 0 && errno != EWOULDBLOCK))
+ if (ret == 0 || (ret < count && errno != EWOULDBLOCK))
stream->eof = 1;
} else {
static int stream_cookie_seeker(void *cookie, fpos_t *position, int whence)
{
TSRMLS_FETCH();
-
+
*position = php_stream_seek((php_stream *)cookie, *position, whence);
if (*position == -1)
static int stream_cookie_seeker(void *cookie, off_t position, int whence)
{
TSRMLS_FETCH();
-
return php_stream_seek((php_stream *)cookie, position, whence);
}
#endif