]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
"force-response-1.0" now only applies to requests which are HTTP/1.0 to begin
authorRalf S. Engelschall <rse@apache.org>
Thu, 31 Jul 1997 08:19:50 +0000 (08:19 +0000)
committerRalf S. Engelschall <rse@apache.org>
Thu, 31 Jul 1997 08:19:50 +0000 (08:19 +0000)
with.  "nokeepalive" now works for HTTP/1.1 clients.  Added "downgrade-1.0"
which causes Apache to pretend it received a 1.0.  Additionally mod_browser
now triggers during translate_name to workaround a deficiency in the
header_parse phase.

PR: 875
Submitted by: Dean Gaudet
Reviewed by: Roy Fielding, Ralf S. Engelschall, Jim Jagielski

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3@78826 13f79535-47bb-0310-9956-ffa450edef68

APACHE_1_2_X/src/CHANGES
APACHE_1_2_X/src/main/http_protocol.c
APACHE_1_2_X/src/main/http_request.c
APACHE_1_2_X/src/mod_browser.c

index 101337fb61a34b1e66fc6474d0069e44fd684975..ae52529fde743fb4025c2ffde17d2c42c9ab1b78 100644 (file)
@@ -1,5 +1,12 @@
 Changes with Apache 1.2.2
 
+  *) "force-response-1.0" now only applies to requests which are HTTP/1.0 to
+     begin with.  "nokeepalive" now works for HTTP/1.1 clients.  Added
+     "downgrade-1.0" which causes Apache to pretend it received a 1.0.
+     Additionally mod_browser now triggers during translate_name to workaround
+     a deficiency in the header_parse phase.
+     [Dean Gaudet] PR#875
+
   *) get_client_block() returns wrong length if policy is 
      REQUEST_CHUNKED_DECHUNK.
      [Kenichi Hori <ken@d2.bs1.fc.nec.co.jp>] PR#815
index a797c703a6ee502be9b77a7b2ccd31def838b14f..5b89d888a08ff4bbfbebf9d2e4ed31c2821fae67 100644 (file)
@@ -281,8 +281,9 @@ int set_keepalive(request_rec *r)
      *   and the response status does not require a close;
      *   and the response generator has not already indicated close;
      *   and the client did not request non-persistence (Connection: close);
+     *   and    we haven't been configured to ignore the buggy twit
+     *       or they're a buggy twit coming through a HTTP/1.1 proxy
      *   and    the client is requesting an HTTP/1.0-style keep-alive
-     *          and we haven't been configured to ignore the buggy twit,
      *       or the client claims to be HTTP/1.1 compliant (perhaps a proxy);
      *   THEN we can be persistent, which requires more headers be output.
      *
@@ -304,9 +305,10 @@ int set_keepalive(request_rec *r)
         !status_drops_connection(r->status) &&
         !wimpy &&
         !find_token(r->pool, conn, "close") &&
-        (((ka_sent = find_token(r->pool, conn, "keep-alive")) &&
-          !table_get(r->subprocess_env, "nokeepalive")) ||
-         (r->proto_num >= 1001))
+       (!table_get(r->subprocess_env, "nokeepalive") ||
+        table_get(r->headers_in, "Via")) &&
+       ((ka_sent = find_token(r->pool, conn, "keep-alive")) ||
+          (r->proto_num >= 1001))
        ) {
        char header[256];
        int left = r->server->keep_alive_max - r->connection->keepalives;
@@ -1041,8 +1043,9 @@ void basic_http_header (request_rec *r)
     
     if (!r->status_line)
         r->status_line = status_lines[index_of_response(r->status)];
-    
-    if (table_get(r->subprocess_env,"force-response-1.0"))
+
+    if (r->proto_num == 1000
+       && table_get(r->subprocess_env,"force-response-1.0"))
        protocol = "HTTP/1.0";
     else
        protocol = SERVER_PROTOCOL;
index 047a6c36ffb475651ebe2e119815625a0a6614ba..77fa0a67e266933d0c3e8402ccc3e66c21c07897 100644 (file)
@@ -937,6 +937,10 @@ void process_request_internal (request_rec *r)
        return;
     }
 
+    if (r->proto_num > 1000 && table_get (r->subprocess_env, "downgrade-1.0")) {
+       r->proto_num = 1000;
+    }
+
     /* NB: directory_walk() clears the per_dir_config, so we don't inherit from
        location_walk() above */
 
index 67cf99d576126c59a745051be70407c1c00d2694..3779cdec087affc1db85fce0d5f4a2cd7a62789a 100644 (file)
@@ -139,7 +139,7 @@ command_rec browser_module_cmds[] = {
 { NULL },
 };
 
-int parse_headers_browser_module(request_rec *r)
+static int browser_match(request_rec *r)
 {
     server_rec *s = r->server;
     browser_server_config_rec *sconf = get_module_config (s->module_config,
@@ -166,7 +166,7 @@ int parse_headers_browser_module(request_rec *r)
        }
     }
 
-    return OK;  
+    return DECLINED;  
 }
 
 module browser_module = {
@@ -178,12 +178,12 @@ module browser_module = {
    merge_browser_config,       /* merge server configs */
    browser_module_cmds,                /* command table */
    NULL,                       /* handlers */
-   NULL,                       /* filename translation */
+   browser_match,              /* filename translation */
    NULL,                       /* check_user_id */
    NULL,                       /* check auth */
    NULL,                       /* check access */
    NULL,                       /* type_checker */
    NULL,                       /* fixups */
    NULL,                       /* logger */
-   parse_headers_browser_module        /* header parser */
+   NULL                                /* header parser */
 };