php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #69049
Patch stream_oef.diff revision 2015-02-13 12:39 UTC by aserbulov at parallels dot com
revision 2015-02-13 12:32 UTC by aserbulov at parallels dot com
Patch plain_wrapper.c.diff revision 2015-02-13 05:45 UTC by aserbulov at parallels dot com

Patch plain_wrapper.c.diff for Streams related Bug #69049

Patch version 2015-02-13 05:45 UTC

Return to Bug #69049 | Download this patch
Patch Revisions:

Developer: aserbulov@parallels.com

--- main/streams/plain_wrapper.c	Wed Jan 21 02:23:28 2015
+++ main/streams/plain_wrapper.c	Wed Feb 11 11:09:06 2015
@@ -349,34 +349,6 @@
 	assert(data != NULL);
 
 	if (data->fd >= 0) {
-#ifdef PHP_WIN32
-		php_stdio_stream_data *self = (php_stdio_stream_data*)stream->abstract;
-
-		if (self->is_pipe || self->is_process_pipe) {
-			HANDLE ph = (HANDLE)_get_osfhandle(data->fd);
-			int retry = 0;
-			DWORD avail_read = 0;
-
-			do {
-				/* Look ahead to get the available data amount to read. Do the same
-					as read() does, however not blocking forever. In case it failed,
-					no data will be read (better than block). */
-				if (!PeekNamedPipe(ph, NULL, 0, NULL, &avail_read, NULL)) {
-					break;
-				}
-				/* If there's nothing to read, wait in 100ms periods. */
-				if (0 == avail_read) {
-					usleep(100000);
-				}
-			} while (0 == avail_read && retry++ < 320);
-
-			/* Reduce the required data amount to what is available, otherwise read()
-				will block.*/
-			if (avail_read < count) {
-				count = avail_read;
-			}
-		}
-#endif
 		ret = read(data->fd, buf, count);
 
 		if (ret == (size_t)-1 && errno == EINTR) {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 15:01:28 2024 UTC