summaryrefslogtreecommitdiff
path: root/main/network.c
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2002-10-04 18:21:40 +0000
committerSascha Schumann <sas@php.net>2002-10-04 18:21:40 +0000
commit4f7e6dadd8d956c8527007a2f8c976669a762736 (patch)
tree825e00fd0e616de1bc9f8da16c3ada603aa36866 /main/network.c
parent5610e348ecc29a79b9c9021fb1ef40bca68ebe2b (diff)
downloadphp-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/network.c')
-rw-r--r--main/network.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/network.c b/main/network.c
index 484550ac5d..fad7e40ff5 100644
--- a/main/network.c
+++ b/main/network.c
@@ -923,7 +923,8 @@ php_stream_ops php_stream_socket_ops = {
NULL, /* seek */
php_sockop_cast,
php_sockop_stat,
- php_sockop_set_option
+ php_sockop_set_option,
+ 1
};