mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Report error from socket read on timeout
A timeout is not considered a transient error (at the socket layer), and should return -1 rather than 0.
This commit is contained in:
parent
4c15dffe3a
commit
23c90dcdfb
2 changed files with 2 additions and 2 deletions
|
@ -20,4 +20,4 @@ fclose($server);
|
|||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(0) ""
|
||||
bool(false)
|
||||
|
|
|
@ -163,7 +163,7 @@ static ssize_t php_sockop_read(php_stream *stream, char *buf, size_t count)
|
|||
if (sock->is_blocked) {
|
||||
php_sock_stream_wait_for_data(stream, sock);
|
||||
if (sock->timeout_event)
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
nr_bytes = recv(sock->socket, buf, XP_SOCK_BUF_SIZE(count), (sock->is_blocked && sock->timeout.tv_sec != -1) ? MSG_DONTWAIT : 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue