You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1997/07/19 10:44:04 UTC

[PATCH] MSIE 4.0 PR2 workaround

Here's the final version of this patch.  Does the text below sound fine?
I want to use it for whatever .html file I stick this doc into.

Please vote for its inclusion in 1.2.2, in case we do another release.
I'm going to do it slightly differently for 1.3.

Dean

---


MSIE 4.0 PR2 is the first public release of IE4 with HTTP/1.1 support. 
There are two bugs in the HTTP/1.1 support that we've been notified
of so far:

- It seems to handle keep-alive only on "200 OK" responses.  The HTTP/1.1
  standard indicates that all connections are keep-alive by default,
  and Apache behaves according to the standard.  This problem typically
  manifests itself as a long delay after the client receives a redirect
  from the server.

- The Java VM makes HTTP/1.1 requests but does not seem to understand
  HTTP/1.1 responses.  In particular it does not implement chunked
  encoding (which is required by HTTP/1.1).  An example where this
  would occur is a Java applet accessing a CGI on an Apache server.
  The response in this case is (usually) chunked.

Note that neither of these will be a problem for MSIE 4.0 PR2 clients
that are behind proxies -- in that case IE will downgrade its request
to 1.0 in order to pass it to the proxy.  The client also provides
the option of disabling HTTP/1.1 support.

Apache can workaround these problems.  Apply the patch below and rebuild
your server, then add this line to your httpd.conf file:

    BrowserMatch "MSIE 4\.0b2;" nokeepalive force-request-1.0 down-1.0

That disables keep-alive, and causes Apache to pretend it is talking
with a 1.0 client whenever it recieves a request from IE 4.0 PR2.

Dean

Index: http_protocol.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_protocol.c,v
retrieving revision 1.126.2.2
diff -u -r1.126.2.2 http_protocol.c
--- http_protocol.c	1997/07/01 06:50:29	1.126.2.2
+++ http_protocol.c	1997/07/19 08:25:12
@@ -281,8 +281,9 @@
      *   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 @@
         !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 @@
     
     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: http_request.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_request.c,v
retrieving revision 1.50.2.3
diff -u -r1.50.2.3 http_request.c
--- http_request.c	1997/07/01 06:50:30	1.50.2.3
+++ http_request.c	1997/07/19 08:25:15
@@ -935,6 +935,10 @@
 	return;
     }
 
+    if (r->proto_num > 1000 && table_get (r->subprocess_env, "down-1.0")) {
+	r->proto_num = 1000;
+    }
+
     /* NB: directory_walk() clears the per_dir_config, so we don't inherit from
        location_walk() above */
 
Index: mod_browser.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_browser.c,v
retrieving revision 1.9
diff -u -r1.9 mod_browser.c
--- mod_browser.c	1997/04/24 23:35:21	1.9
+++ mod_browser.c	1997/07/19 08:25:16
@@ -139,7 +139,7 @@
 { 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 @@
 	}
     }
 
-    return OK;  
+    return DECLINED;  
 }
 
 module browser_module = {
@@ -178,12 +178,12 @@
    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 */
 };


Re: [PATCH] MSIE 4.0 PR2 workaround

Posted by Dean Gaudet <dg...@arctic.org>.
A yup oops, force-response-1.0.  And yeah I like downgrade-1.0 better.

Dean

On Sat, 19 Jul 1997, Ben Laurie wrote:

> Dean Gaudet wrote:
> 
> > Apache can workaround these problems.  Apply the patch below and
> > rebuild
> > your server, then add this line to your httpd.conf file:
> >
> >     BrowserMatch "MSIE 4\.0b2;" nokeepalive force-request-1.0 down-1.0
> 
> force-response-1.0?
> 
> And, although I agree that these variables should not be excessively
> verbose, down-1.0 is really a little too brief - how about
> downgrade-1.0?
> 
> Cheers,
> 
> Ben.
> 
> --
> Ben Laurie                Phone: +44 (181) 994 6435  Email:
> ben@algroup.co.uk
> Freelance Consultant and  Fax:   +44 (181) 994 6472
> Technical Director        URL: http://www.algroup.co.uk/Apache-SSL
> A.L. Digital Ltd,         Apache Group member (http://www.apache.org)
> London, England.          Apache-SSL author
> 
> 
> 


Re: [PATCH] MSIE 4.0 PR2 workaround

Posted by Ben Laurie <be...@algroup.co.uk>.
Dean Gaudet wrote:

> Apache can workaround these problems.  Apply the patch below and
> rebuild
> your server, then add this line to your httpd.conf file:
>
>     BrowserMatch "MSIE 4\.0b2;" nokeepalive force-request-1.0 down-1.0

force-response-1.0?

And, although I agree that these variables should not be excessively
verbose, down-1.0 is really a little too brief - how about
downgrade-1.0?

Cheers,

Ben.

--
Ben Laurie                Phone: +44 (181) 994 6435  Email:
ben@algroup.co.uk
Freelance Consultant and  Fax:   +44 (181) 994 6472
Technical Director        URL: http://www.algroup.co.uk/Apache-SSL
A.L. Digital Ltd,         Apache Group member (http://www.apache.org)
London, England.          Apache-SSL author