dmitry          Wed May  3 15:39:16 2006 UTC

  Modified files:              (Branch: PHP_5_1)
    /php-src/sapi/cgi   fastcgi.c fastcgi.h 
  Log:
  Fixed bug #37205 (incompatibility with mod_fastcgi)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/fastcgi.c?r1=1.4.2.11&r2=1.4.2.12&diff_format=u
Index: php-src/sapi/cgi/fastcgi.c
diff -u php-src/sapi/cgi/fastcgi.c:1.4.2.11 php-src/sapi/cgi/fastcgi.c:1.4.2.12
--- php-src/sapi/cgi/fastcgi.c:1.4.2.11 Wed May  3 13:19:57 2006
+++ php-src/sapi/cgi/fastcgi.c  Wed May  3 15:39:16 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: fastcgi.c,v 1.4.2.11 2006/05/03 13:19:57 dmitry Exp $ */
+/* $Id: fastcgi.c,v 1.4.2.12 2006/05/03 15:39:16 dmitry Exp $ */
 
 #include "fastcgi.h"
 #include "php.h"
@@ -441,7 +441,6 @@
        unsigned char buf[FCGI_MAX_LENGTH+8];
 
        req->keep = 0;
-       req->has_in = 0;
        req->in_len = 0;
        req->out_hdr = NULL;
        req->out_pos = req->out_buf;
@@ -510,19 +509,6 @@
                        len = (hdr.contentLengthB1 << 8) | hdr.contentLengthB0;
                        padding = hdr.paddingLength;
                }
-#ifdef _WIN32
-               req->has_in = 1;
-#else
-               if (safe_read(req, &hdr, sizeof(fcgi_header)) != 
sizeof(fcgi_header) ||
-                   hdr.version < FCGI_VERSION_1 ||
-                   hdr.type != FCGI_STDIN) {
-                       req->keep = 0;
-                       return 0;
-               }
-               req->in_len = (hdr.contentLengthB1 << 8) | hdr.contentLengthB0;
-               req->in_pad = hdr.paddingLength;
-               req->has_in = (req->in_len != 0);
-#endif
        } else if (hdr.type == FCGI_GET_VALUES) {
                int i, j;
                int name_len;
@@ -565,9 +551,6 @@
        fcgi_header hdr;
        unsigned char buf[8];
 
-       if (!req->has_in) {
-               return 0;
-       }
        n = 0;
        rest = len;
        while (rest > 0) {
@@ -635,6 +618,10 @@
                        RevertToSelf();
                }
 #else
+               char buf[8];
+
+               shutdown(req->fd, 1);
+               while (recv(req->fd, buf, sizeof(buf), 0) > 0) {}
                close(req->fd);
 #endif
                req->fd = -1;
http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/fastcgi.h?r1=1.2.2.3&r2=1.2.2.4&diff_format=u
Index: php-src/sapi/cgi/fastcgi.h
diff -u php-src/sapi/cgi/fastcgi.h:1.2.2.3 php-src/sapi/cgi/fastcgi.h:1.2.2.4
--- php-src/sapi/cgi/fastcgi.h:1.2.2.3  Thu Apr 27 11:39:32 2006
+++ php-src/sapi/cgi/fastcgi.h  Wed May  3 15:39:16 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: fastcgi.h,v 1.2.2.3 2006/04/27 11:39:32 dmitry Exp $ */
+/* $Id: fastcgi.h,v 1.2.2.4 2006/05/03 15:39:16 dmitry Exp $ */
 
 /* FastCGI protocol */
 
@@ -97,7 +97,6 @@
        int            id;
        int            keep;
 
-       int            has_in;
        int            in_len;
        int            in_pad;
 

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

Reply via email to