summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-02-15 14:49:58 +0100
committerAnatol Belski <ab@php.net>2017-02-15 14:49:58 +0100
commit2a61e5495affef963f04a3322412c1d316d83ab5 (patch)
treef281200c8b17ce7c7f6ec87d56c1d86526e4edf1 /main
parentf53ea4cd6066784416ce99ef582c564367bbded1 (diff)
parent89a5bd67500510f30a729ff97048fa230c9f9bd3 (diff)
downloadphp-git-2a61e5495affef963f04a3322412c1d316d83ab5.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Fixed bug #74090 stream_get_contents maxlength>-1 returns empty string
Diffstat (limited to 'main')
-rw-r--r--main/streams/php_streams_int.h4
-rw-r--r--main/streams/xp_socket.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h
index 42fdfcb4c7..13a817833f 100644
--- a/main/streams/php_streams_int.h
+++ b/main/streams/php_streams_int.h
@@ -53,6 +53,10 @@
# undef EWOULDBLOCK
# endif
# define EWOULDBLOCK WSAEWOULDBLOCK
+# ifdef EMSGSIZE
+# undef EMSGSIZE
+# endif
+# define EMSGSIZE WSAEMSGSIZE
#endif
/* This functions transforms the first char to 'w' if it's not 'r', 'a' or 'w'
diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c
index 1344e0b8b8..e496a2d7fd 100644
--- a/main/streams/xp_socket.c
+++ b/main/streams/xp_socket.c
@@ -336,7 +336,7 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void
ret = recv(sock->socket, &buf, sizeof(buf), MSG_PEEK);
err = php_socket_errno();
if (0 == ret || /* the counterpart did properly shutdown*/
- (0 > ret && err != EWOULDBLOCK && err != EAGAIN)) { /* there was an unrecoverable error */
+ (0 > ret && err != EWOULDBLOCK && err != EAGAIN && err != EMSGSIZE)) { /* there was an unrecoverable error */
alive = 0;
}
}