diff options
author | Sascha Schumann <sas@php.net> | 2002-10-04 18:21:40 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 2002-10-04 18:21:40 +0000 |
commit | 4f7e6dadd8d956c8527007a2f8c976669a762736 (patch) | |
tree | 825e00fd0e616de1bc9f8da16c3ada603aa36866 /main/php_streams.h | |
parent | 5610e348ecc29a79b9c9021fb1ef40bca68ebe2b (diff) | |
download | php-git-4f7e6dadd8d956c8527007a2f8c976669a762736.tar.gz |
Improve the general behaviour of stream_gets and fix its semantics
with regard to sockets. The behaviour should be aligned with PHP 4.2 now.
This has been verified to some degree.
If the underlying stream operations block when no new data is readable,
we need to take extra precautions.
If there is buffered data available, we check for a EOL. If it exists,
we pass the data immediately back to the caller. This saves a call
to the read implementation and will not block where blocking
is not necessary at all.
If the stream buffer contains more data than the caller requested,
we can also avoid that costly step and simply return that data.
Diffstat (limited to 'main/php_streams.h')
-rwxr-xr-x | main/php_streams.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/main/php_streams.h b/main/php_streams.h index 3ae9455bc2..421dbf2535 100755 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -153,6 +153,7 @@ typedef struct _php_stream_ops { int (*cast)(php_stream *stream, int castas, void **ret TSRMLS_DC); int (*stat)(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC); int (*set_option)(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC); + int dont_block; } php_stream_ops; typedef struct _php_stream_wrapper_ops { |