]> granicus.if.org Git - php/commitdiff
Add X-Powered-By header in all configurations to ease PHP usage metering
authorSascha Schumann <sas@php.net>
Fri, 3 Dec 1999 12:21:57 +0000 (12:21 +0000)
committerSascha Schumann <sas@php.net>
Fri, 3 Dec 1999 12:21:57 +0000 (12:21 +0000)
main/main.c
sapi/isapi/php4isapi.c

index 4ea14444c5d98c25bb73b76a3f6d3625424b811d..8c6a06d3b4f976d33f6e2184478975a917065795 100644 (file)
@@ -743,6 +743,10 @@ int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC)
        sapi_activate(SLS_C);   
 
        php_set_timeout(PG(max_execution_time));
+       
+       if (PG(expose_php)) {
+               sapi_add_header(estrdup(SAPI_PHP_VERSION_HEADER), sizeof(SAPI_PHP_VERSION_HEADER) - 1);
+       }
 
        if (PG(output_buffering)) {
                php_start_ob_buffering();
index a72eacdcf0052693cbe7b770f2eccaa3a4afecd9..affe58b7a2bc294841abbd92bc8a3c42f26e611d 100644 (file)
@@ -174,16 +174,12 @@ static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers SLS_DC)
        HSE_SEND_HEADER_EX_INFO header_info;
        char status_buf[MAX_STATUS_LENGTH];
        sapi_header_struct default_content_type = { SAPI_DEFAULT_CONTENT_TYPE, sizeof(SAPI_DEFAULT_CONTENT_TYPE)-1 };
-       sapi_header_struct php_version_header = { SAPI_PHP_VERSION_HEADER, sizeof(SAPI_PHP_VERSION_HEADER)-1 };
        PLS_FETCH();
 
        /* Obtain headers length */
        if (SG(sapi_headers).send_default_content_type) {
                accumulate_header_length(&default_content_type, (void *) &total_length);
        }
-       if (PG(expose_php)) {
-               accumulate_header_length(&php_version_header, (void *) &total_length);
-       }
        zend_llist_apply_with_argument(&SG(sapi_headers).headers, (void (*)(void *, void *)) accumulate_header_length, (void *) &total_length);
 
        /* Generate headers */
@@ -192,9 +188,6 @@ static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers SLS_DC)
        if (SG(sapi_headers).send_default_content_type) {
                concat_header(&default_content_type, (void *) &combined_headers_ptr);
        }
-       if (PG(expose_php)) {
-               concat_header(&php_version_header, (void *) &combined_headers_ptr);
-       }
        zend_llist_apply_with_argument(&SG(sapi_headers).headers, (void (*)(void *, void *)) concat_header, (void *) &combined_headers_ptr);
        *combined_headers_ptr++ = '\r';
        *combined_headers_ptr++ = '\n';