]> granicus.if.org Git - php/commitdiff
use MSG_PEEK flag for recv() everywhere
authorAnatol Belski <ab@php.net>
Sun, 19 Oct 2014 09:03:17 +0000 (11:03 +0200)
committerAnatol Belski <ab@php.net>
Sun, 19 Oct 2014 09:03:17 +0000 (11:03 +0200)
phpdbg_io.c

index f358fbfcd8e2012d623db8ef194e1bcdd09f990b..6de1397ec9b9cb63bf1147930e924c40d907b2f8 100644 (file)
@@ -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;