]> granicus.if.org Git - php/commitdiff
MFH (bugfix #23902 by Shane).
authorEdin Kadribasic <edink@php.net>
Tue, 3 Jun 2003 10:08:17 +0000 (10:08 +0000)
committerEdin Kadribasic <edink@php.net>
Tue, 3 Jun 2003 10:08:17 +0000 (10:08 +0000)
main/SAPI.c
php.ini-dist
php.ini-recommended
sapi/cgi/cgi_main.c

index d29058718408e404e47da60a4a76211344fc6867..78de141ea46fe012a0a833954fc369d33f43bb4c 100644 (file)
@@ -456,6 +456,12 @@ static int sapi_extract_response_code(const char *header_line)
 
 static void sapi_update_response_code(int ncode TSRMLS_DC)
 {
+       /* if the status code did not change, we do not want
+          to change the status line, and no need to change the code */
+       if (SG(sapi_headers).http_response_code == ncode) {
+               return;
+       }
+
        if (SG(sapi_headers).http_status_line) {
                efree(SG(sapi_headers).http_status_line);
                SG(sapi_headers).http_status_line = NULL;
index 3e2958561e0dad7313b8a88b0137c1e694b42685..deae088cab7b17ef3da77a9191bd78f54621feeb 100644 (file)
@@ -463,7 +463,7 @@ enable_dl = On
 ; use when sending HTTP response code. If it's set 0 PHP sends Status: header that
 ; is supported by Apache. When this option is set to 1 PHP will send
 ; RFC2616 compliant header.
-; Set to 1 if running under IIS.  Default is zero.
+; Default is zero.
 ;cgi.rfc2616_headers = 0 
  
 
index b801ea255142ed3559c20393503fe547060580bd..a078ec4f737615ad5eb1f321c3114133816013c3 100644 (file)
@@ -478,7 +478,7 @@ enable_dl = On
 ; use when sending HTTP response code. If it's set 0 PHP sends Status: header that
 ; is supported by Apache. When this option is set to 1 PHP will send
 ; RFC2616 compliant header.
-; Set to 1 if running under IIS.  Default is zero.
+; Default is zero.
 ;cgi.rfc2616_headers = 0 
 
 
index 1722cf85839ab20aa4a76b69c72891896c439e83..527bddef7a80d333a14d58344b9073cdf0048039 100644 (file)
@@ -303,7 +303,7 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
        if (SG(sapi_headers).http_response_code != 200) {
                int len;
                
-               if (rfc2616_headers) {
+               if (rfc2616_headers && SG(sapi_headers).http_status_line) {
                        len = snprintf(buf, SAPI_CGI_MAX_HEADER_LENGTH, 
                                                   "%s\r\n", SG(sapi_headers).http_status_line);