]> granicus.if.org Git - php/commitdiff
add a "force HTTP/1.0 response" facility to the SAPI layer
authorSascha Schumann <sas@php.net>
Sun, 1 Dec 2002 03:28:21 +0000 (03:28 +0000)
committerSascha Schumann <sas@php.net>
Sun, 1 Dec 2002 03:28:21 +0000 (03:28 +0000)
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).

main/SAPI.c
main/SAPI.h
sapi/apache/mod_php4.c

index f77c14ee112531f740c985288f9cb695c574adb9..6ebd98e7ce4ea9e299de1a022a8b3fc55741da30 100644 (file)
@@ -860,6 +860,15 @@ SAPI_API int sapi_get_fd(int *fd TSRMLS_DC)
        }
 }
 
+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;
+       }
+}
+
 /*
  * Local variables:
  * tab-width: 4
index 75f68b18fdf593cab797ed5cae0b8e3b1cc92cd3..560330c34e23f077b800154620eae01cfd9cfd34 100644 (file)
@@ -187,6 +187,7 @@ SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len TSRMLS_DC
 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 @@ struct _sapi_module_struct {
        int php_ini_ignore;
        
        int (*get_fd)(int *fd TSRMLS_DC);
-
+       
+       int (*force_http_10)(TSRMLS_D);
 };
 
 
index eac37883a7a1608acb11b7f6913a041b22dd8fd6..ad7a1697bc1208496ddfc2a9a4400814b62e3cd4 100644 (file)
@@ -360,6 +360,17 @@ static int sapi_apache_get_fd(int *nfd TSRMLS_DC)
 }
 /* }}} */
 
+/* {{{ 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 @@ static sapi_module_struct apache_sapi_module = {
        NULL,                                                   /* treat data */
        NULL,                                                   /* exe location */
        0,                                                              /* ini ignore */
-       sapi_apache_get_fd
+       sapi_apache_get_fd,
+       sapi_apache_force_http_10
 };
 /* }}} */