dmitry          Fri Nov 10 13:10:16 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src    NEWS 
    /php-src/main/streams       plain_wrapper.c 
  Log:
  Disabled reading from stream (calls to read()) after EOF
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.351&r2=1.2027.2.547.2.352&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.351 php-src/NEWS:1.2027.2.547.2.352
--- php-src/NEWS:1.2027.2.547.2.351     Fri Nov 10 12:59:27 2006
+++ php-src/NEWS        Fri Nov 10 13:10:16 2006
@@ -9,6 +9,8 @@
     In case of modification of corresponding registry-tree PHP will reload
     it automatic
   . start timiout thread only if necessary
+- Streams optimization (Dmitry)
+  . disabled calls to read() after EOF
 - VCWD_REALPATH() is improved to use realpath cache without VIRTUAL_DIR.
   (Dmitry)
 - ext/bcmath intialization code is moved from request startup to module
http://cvs.php.net/viewvc.cgi/php-src/main/streams/plain_wrapper.c?r1=1.52.2.6.2.9&r2=1.52.2.6.2.10&diff_format=u
Index: php-src/main/streams/plain_wrapper.c
diff -u php-src/main/streams/plain_wrapper.c:1.52.2.6.2.9 
php-src/main/streams/plain_wrapper.c:1.52.2.6.2.10
--- php-src/main/streams/plain_wrapper.c:1.52.2.6.2.9   Fri Nov 10 10:55:26 2006
+++ php-src/main/streams/plain_wrapper.c        Fri Nov 10 13:10:16 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: plain_wrapper.c,v 1.52.2.6.2.9 2006/11/10 10:55:26 dmitry Exp $ */
+/* $Id: plain_wrapper.c,v 1.52.2.6.2.10 2006/11/10 13:10:16 dmitry Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -312,6 +312,9 @@
        assert(data != NULL);
 
        if (data->fd >= 0) {
+               if (stream->eof && !data->is_pipe) {
+                       return 0;
+               }
                ret = read(data->fd, buf, count);
                
                stream->eof = (ret == 0 || (ret == (size_t)-1 && errno != 
EWOULDBLOCK));

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to