]> granicus.if.org Git - php/commitdiff
Fixed bug #27026 (Added cgi.nph that allows forcing of the Status: 200
authorIlia Alshanetsky <iliaa@php.net>
Tue, 10 Feb 2004 00:02:38 +0000 (00:02 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 10 Feb 2004 00:02:38 +0000 (00:02 +0000)
header that is not normally needed).

php.ini-dist
php.ini-recommended
sapi/cgi/cgi_main.c

index 76dae079b3995475796e144dac5ab28e3cfdb7f1..30e29fc6858c5d79ad470b877cb9f4d1903c14cf 100644 (file)
@@ -445,6 +445,10 @@ enable_dl = On
 ; **You CAN safely turn this off for IIS, in fact, you MUST.**
 ; cgi.force_redirect = 1
 
+; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
+; every request.
+; cgi.nph = 1
+
 ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape 
 ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP
 ; will look for to know it is OK to continue execution.  Setting this variable MAY
index b9140e123bc7b2a36d36deff675c1398ee4a71b0..b45e264206a5c5f5144319832e13b863f8069ad7 100644 (file)
@@ -464,6 +464,10 @@ enable_dl = On
 ; **You CAN safely turn this off for IIS, in fact, you MUST.**
 ; cgi.force_redirect = 1
 
+; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
+; every request.
+; cgi.nph = 1
+
 ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape 
 ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP
 ; will look for to know it is OK to continue execution.  Setting this variable MAY
index 0580ac544cf60edef408a4956848bf6a2c5adc03..340baeae4f50b1fb6b6978e2dc878b51e9a2bfcb 100644 (file)
@@ -289,7 +289,7 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
        char buf[SAPI_CGI_MAX_HEADER_LENGTH];
        sapi_header_struct *h;
        zend_llist_position pos;
-       long rfc2616_headers = 0;
+       long rfc2616_headers = 0, nph = 0;
 
        if(SG(request_info).no_headers == 1) {
                return  SAPI_HEADER_SENT_SUCCESSFULLY;
@@ -303,7 +303,11 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
                rfc2616_headers = 0;
        }
 
-       if (SG(sapi_headers).http_response_code != 200) {
+       if (cfg_get_long("cgi.nph", &nph) == FAILURE) {
+               nph = 0;
+       }
+
+       if (nph || SG(sapi_headers).http_response_code != 200) {
                int len;
 
                if (rfc2616_headers && SG(sapi_headers).http_status_line) {