From: Anatol Belski Date: Sun, 19 Oct 2014 09:03:17 +0000 (+0200) Subject: use MSG_PEEK flag for recv() everywhere X-Git-Tag: php-5.6.3RC1~51^2~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52686b322682e470c9664cfb01d69406b44b7b20;p=php use MSG_PEEK flag for recv() everywhere --- diff --git a/phpdbg_io.c b/phpdbg_io.c index f358fbfcd8..6de1397ec9 100644 --- a/phpdbg_io.c +++ b/phpdbg_io.c @@ -83,11 +83,11 @@ phpdbg_consume_bytes(int sock, char *ptr, int len, int tmo) } while(i > 0) { -#ifdef PHP_WIN32 + /* There's something to read. Read what's available and proceed + disregarding whether len could be exhausted or not.*/ int can_read = recv(sock, p, i, MSG_PEEK); - i = can_read; -#endif + got_now = recv(sock, p, i, 0); if (got_now == -1) { return -1;