iliaa           Wed Feb 19 19:32:51 2003 EDT

  Modified files:              
    /php4/ext/standard  exec.c http_fopen_wrapper.c 
  Log:
  Fixed bug #22308 (optimized passthru, code is now ~40 times faster).
  
  
Index: php4/ext/standard/exec.c
diff -u php4/ext/standard/exec.c:1.94 php4/ext/standard/exec.c:1.95
--- php4/ext/standard/exec.c:1.94       Mon Feb 17 20:23:51 2003
+++ php4/ext/standard/exec.c    Wed Feb 19 19:32:51 2003
@@ -15,7 +15,7 @@
    | Author: Rasmus Lerdorf                                               |
    +----------------------------------------------------------------------+
  */
-/* $Id: exec.c,v 1.94 2003/02/18 01:23:51 iliaa Exp $ */
+/* $Id: exec.c,v 1.95 2003/02/20 00:32:51 iliaa Exp $ */
 
 #include <stdio.h>
 #include "php.h"
@@ -211,11 +211,12 @@
                        RETVAL_STRINGL(buf, l, 1);
                }
        } else {
-               int b, i;
+               size_t b;
 
-               while ((b = fread(buf, 1, buflen, fp)) > 0) {
-                       for (i = 0; i < b; i++)
-                               if (output) (void)PUTC(buf[i]);
+               while ((b = fread(buf, buflen, 1, fp)) > 0) {
+                       if (output) {
+                               PHPWRITE(buf, b);
+                       }
                }
        }
 
Index: php4/ext/standard/http_fopen_wrapper.c
diff -u php4/ext/standard/http_fopen_wrapper.c:1.64 
php4/ext/standard/http_fopen_wrapper.c:1.65
--- php4/ext/standard/http_fopen_wrapper.c:1.64 Tue Feb 18 19:49:31 2003
+++ php4/ext/standard/http_fopen_wrapper.c      Wed Feb 19 19:32:51 2003
@@ -18,7 +18,7 @@
    |          Wez Furlong <[EMAIL PROTECTED]>                          |
    +----------------------------------------------------------------------+
  */
-/* $Id: http_fopen_wrapper.c,v 1.64 2003/02/19 00:49:31 iliaa Exp $ */ 
+/* $Id: http_fopen_wrapper.c,v 1.65 2003/02/20 00:32:51 iliaa Exp $ */ 
 
 #include "php.h"
 #include "php_globals.h"
@@ -354,7 +354,7 @@
                                                        s = resource->path;
                                                        *s = '/';
                                                }
-                                               s[1] = '\0'; 
+                                               *(s + 1) = '\0'; 
                                                if (resource->path && 
*(resource->path) == '/' && *(resource->path + 1) == '\0') {
                                                        snprintf(loc_path, 
sizeof(loc_path) - 1, "%s%s", resource->path, location);
                                                } else {



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

Reply via email to