mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-07 09:17:29 +00: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:
1 parent
4c15dffe3a
commit
23c90dcdfb
2 files changed
+2
-2
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user