Would this be a more appropriate solution to the problem in that case?
This forces a non-blocking mode on all non static streams such as
FTP/HTTP/std*.
Ilia
On October 4, 2002 03:11 pm, Sascha Schumann wrote:
> Iliaa,
>
> looking at a syscall trace from PHP 4.2, the difference in
> handling php://std* is that 4.2 uses non-blocking mode by
> default, while streams block by default.
>
> 4.2: fcntl64(0x3, 0x3, 0x8050fe5, 0) = 2
>
> 4.3: fcntl64(0x3, 0x3, 0xbffff7f4, 0x3) = 2
>
> E.g.
>
> $fp = fopen("php://stdin", "r");
> stream_set_blocking($fp, false);
> print fgets($fp, 500);
>
> works as in PHP 4.2 without the set_blocking call.
>
> Wez, any idea on what is causing this?
>
> - Sascha
Index: php_fopen_wrapper.c
===================================================================
RCS file: /repository/php4/ext/standard/php_fopen_wrapper.c,v
retrieving revision 1.25
diff -u -3 -p -r1.25 php_fopen_wrapper.c
--- php_fopen_wrapper.c 26 Sep 2002 10:14:41 -0000 1.25
+++ php_fopen_wrapper.c 4 Oct 2002 19:17:34 -0000
@@ -89,6 +89,7 @@ php_stream * php_stream_url_wrap_php(php
stream = php_stream_fopen_from_file(fp, mode);
if (stream == NULL)
fclose(fp);
+ php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, 0, NULL);
}
return stream;
}
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php