httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Behlendorf <br...@organic.com>
Subject Re: Broken clients
Date Sun, 21 Jul 1996 07:28:44 GMT

This also disables keep-alives for all versions of MSIE, by the way.  Is
this warranted?

	Brian

On Thu, 18 Jul 1996, Chuck Murcko wrote:
> Here's a patch to try for the Mozilla gunk. I also had to disable keepalive
> in main() and child_main() in http_main.c. This tests OK here, and Mo 3.0b5
> works and still runs keepalives.
> 
> This patch is against the 1.2-dev tree.
> 
> *** ../src.orig/util.c	Tue Jul  9 21:00:15 1996
> --- util.c	Thu Jul 18 16:15:41 1996
> ***************
> *** 66,71 ****
> --- 66,83 ----
>   #include <time.h>
>   #endif
>   
> + int
> + is_agent_mozilla2(request_rec *r)
> + {
> +     char *agent;
> + 
> +     agent = table_get(r->headers_in, "User-Agent");
> +     if(agent != NULL)
> +         return(strncmp(agent, "Mozilla/2", 9) == 0 ? 1 : 0);
> +     else
> + 	return 0;
> + }
> + 
>   #ifdef NOTDEF
>   extern char** environ;
>   
> *** ../src.orig/httpd.h	Tue Jul 16 21:00:21 1996
> --- httpd.h	Thu Jul 18 16:19:22 1996
> ***************
> *** 560,562 ****
> --- 560,564 ----
>   unsigned long get_virthost_addr (char *hostname, short int *port);
>   
>   extern time_t restart_time;
> + 
> + int is_agent_mozilla2(request_rec *r);
> *** ../src.orig/http_protocol.c	Wed Jul 17 09:00:12 1996
> --- http_protocol.c	Thu Jul 18 16:47:30 1996
> ***************
> *** 704,710 ****
>       
>       basic_http_header (r);
>   
> !     set_keepalive (r);
>       
>       if (r->content_type)
>           bvputs(fd, "Content-type: ", 
> --- 704,711 ----
>       
>       basic_http_header (r);
>   
> !     if(!is_agent_mozilla2(r))
> !         set_keepalive (r);
>       
>       if (r->content_type)
>           bvputs(fd, "Content-type: ", 
> ***************
> *** 733,741 ****
>       }
>   
>       bputs("\015\012",fd);
> - 
> -     if (c->keepalive)
> - 	bflush(r->connection->client);  /* For bugs in Netscape, perhaps */
>   
>       bsetopt(fd, BO_BYTECT, &zero);
>       r->sent_bodyct = 1;		/* Whatever follows is real body stuff... */
> --- 734,739 ----
> *** ../src.orig/http_main.c	Wed Jul 17 21:00:13 1996
> --- http_main.c	Thu Jul 18 16:17:47 1996
> ***************
> *** 1417,1423 ****
>   #if defined(STATUS)
>           if (r) increment_counts(child_num,r,1);
>   #endif
> ! 	while (r && current_conn->keepalive) {
>   	    bflush(conn_io);
>   	    destroy_pool(r->pool);
>   	    (void)update_child_status (child_num, SERVER_BUSY_KEEPALIVE,
> --- 1417,1423 ----
>   #if defined(STATUS)
>           if (r) increment_counts(child_num,r,1);
>   #endif
> ! 	while (r && !is_agent_mozilla2(r) && current_conn->keepalive) {
>   	    bflush(conn_io);
>   	    destroy_pool(r->pool);
>   	    (void)update_child_status (child_num, SERVER_BUSY_KEEPALIVE,
> ***************
> *** 1825,1831 ****
>   	r = read_request (conn);
>   	if (r) process_request (r); /* else premature EOF (ignore) */
>   
> !         while (r && conn->keepalive) {
>   	  bflush(cio);
>   	  destroy_pool(r->pool);
>             r = read_request (conn);
> --- 1825,1831 ----
>   	r = read_request (conn);
>   	if (r) process_request (r); /* else premature EOF (ignore) */
>   
> !         while (r && !is_agent_mozilla2(r) && conn->keepalive) {
>   	  bflush(cio);
>   	  destroy_pool(r->pool);
>             r = read_request (conn);
> 
> chuck
> Chuck Murcko	N2K Inc.	Wayne PA	chuck@telebase.com
> And now, on a lighter note:
> All programmers are playwrights and all computers are lousy actors.
> 
> 

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com  www.apache.org  hyperreal.com  http://www.organic.com/JOBS


Mime
View raw message