Re: cvs: php4 /main SAPI.c SAPI.h /sapi/apache mod_php4.c

From: Date: Sun, 01 Dec 2002 05:25:27 +0000
Subject: Re: cvs: php4 /main SAPI.c SAPI.h /sapi/apache mod_php4.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-16793@lists.php.net to get a copy of this message
It'd probably be clearer to call the function sapi_force_http_1_0 (I just added an underscore). Andi At 03:28 AM 12/1/2002 +0000, Sascha Schumann wrote:
sas             Sat Nov 30 22:28:22 2002 EDT
Modified files:
    /php4/main  SAPI.c SAPI.h
    /php4/sapi/apache   mod_php4.c
Log: add a "force HTTP/1.0 response" facility to the SAPI layer this is necessary, when you want to take over control of a connection and the web server is doing stupid things by default (like enabling chunked transfer encoding for no reason). Index: php4/main/SAPI.c diff -u php4/main/SAPI.c:1.158 php4/main/SAPI.c:1.159
--- php4/main/SAPI.c:1.158      Tue Nov 26 00:15:55 2002
+++ php4/main/SAPI.c    Sat Nov 30 22:28:21 2002
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
*/ -/* $Id: SAPI.c,v 1.158 2002/11/26 05:15:55 sas Exp $ */ +/* $Id: SAPI.c,v 1.159 2002/12/01 03:28:21 sas Exp $ */ #include <ctype.h> #include <sys/stat.h> @@ -855,6 +855,15 @@ {
        if (sapi_module.get_fd) {
                return sapi_module.get_fd(fd TSRMLS_CC);
+       } else {
+               return -1;
+       }
+} + +SAPI_API int sapi_force_http_10(TSRMLS_D) +{
+       if (sapi_module.force_http_10) {
+               return sapi_module.force_http_10(TSRMLS_C);
        } else {
                return -1;
        }
Index: php4/main/SAPI.h diff -u php4/main/SAPI.h:1.91 php4/main/SAPI.h:1.92
--- php4/main/SAPI.h:1.91       Tue Nov 26 00:57:01 2002
+++ php4/main/SAPI.h    Sat Nov 30 22:28:21 2002
@@ -187,6 +187,7 @@ SAPI_API void sapi_activate_headers_only(TSRMLS_D); SAPI_API int sapi_get_fd(int *fd TSRMLS_DC); +SAPI_API int sapi_force_http_10(TSRMLS_D); struct _sapi_module_struct {
        char *name;
@@ -228,7 +229,8 @@
        int php_ini_ignore;
        int (*get_fd)(int *fd TSRMLS_DC);
- +
+       int (*force_http_10)(TSRMLS_D);
}; Index: php4/sapi/apache/mod_php4.c diff -u php4/sapi/apache/mod_php4.c:1.147 php4/sapi/apache/mod_php4.c:1.148 --- php4/sapi/apache/mod_php4.c:1.147 Tue Nov 26 00:15:55 2002 +++ php4/sapi/apache/mod_php4.c Sat Nov 30 22:28:21 2002 @@ -17,7 +17,7 @@
    | PHP 4.0 patches by Zeev Suraski <zeev@zend.com>                      |
    +----------------------------------------------------------------------+
*/ -/* $Id: mod_php4.c,v 1.147 2002/11/26 05:15:55 sas Exp $ */ +/* $Id: mod_php4.c,v 1.148 2002/12/01 03:28:21 sas Exp $ */ #include "php_apache_http.h" @@ -360,6 +360,17 @@ } /* }}} */ +/* {{{ sapi_apache_force_http_10 + */ +static int sapi_apache_force_http_10(TSRMLS_D) +{
+       request_rec *r = SG(server_context);
+
+       r->proto_num = HTTP_VERSION(1,0);
+
+       return 0;
+} + /* {{{ sapi_module_struct apache_sapi_module */ static sapi_module_struct apache_sapi_module = { @@ -403,7 +414,8 @@
        NULL,                                                   /* treat data */
        NULL,                                                   /* exe location */
        0, /* ini ignore */
-       sapi_apache_get_fd
+       sapi_apache_get_fd,
+       sapi_apache_force_http_10
}; /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.cvs (#16793) next »