]> granicus.if.org Git - php/commitdiff
Fixed bug #72308 (fastcgi_finish_request and logging environment variables)
authorXinchen Hui <laruence@gmail.com>
Thu, 2 Jun 2016 06:16:32 +0000 (14:16 +0800)
committerXinchen Hui <laruence@gmail.com>
Thu, 2 Jun 2016 06:16:32 +0000 (14:16 +0800)
NEWS
main/fastcgi.c
sapi/fpm/fpm/fpm_main.c

diff --git a/NEWS b/NEWS
index 27846d97fbbd4f3cc60579f61f0b93aa2ca55ef7..54c7960acfc57f320be5639b9f46de394867ddd9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,10 @@ PHP                                                                        NEWS
   . Fixed bug #72218 (If host name cannot be resolved then PHP 7 crashes). 
     (Esminis at esminis dot lt)
 
+- FPM:
+  . Fixed bug #72308 (fastcgi_finish_request and logging environment
+    variables). (Laruence)
+
 - Intl:
   . Fixed bug #64524 (Add intl.use_exceptions to php.ini-*). (Anatol)
 
index fbc6f403a055ca96d48571e6a5aae4ae132fbc71..8fc7d6a968af479bb169b88afa09054a8f89792b 100644 (file)
@@ -1049,7 +1049,12 @@ static int fcgi_read_request(fcgi_request *req)
        req->in_len = 0;
        req->out_hdr = NULL;
        req->out_pos = req->out_buf;
-       req->has_env = 1;
+
+       if (req->has_env) {
+               fcgi_hash_clean(&req->env);
+       } else {
+               req->has_env = 1;
+       }
 
        if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) ||
            hdr.version < FCGI_VERSION_1) {
index 940d6c788d925659ff859997c2b6e47228bb4bc4..5adeb63b7a18028a4e43654e429dbd3556dca237 100644 (file)
@@ -1538,7 +1538,7 @@ PHP_FUNCTION(fastcgi_finish_request) /* {{{ */
                php_header();
 
                fcgi_flush(request, 1);
-               fcgi_close(request, 0, 1);
+               fcgi_close(request, 0, 0);
                RETURN_TRUE;
        }