From: Chuck Murcko chuck@telebase.com This patch disables PHTTP (Keepalive connections) for Apache versions 1.1.x when accessed by a Mozilla/2 browser, since those browsers have known keepalive bugs that degrade service. It will be replaced in version 1.2 by handlers invoked by the BrowserMatch directive. *** http_main.c.orig Mon Aug 5 17:58:47 1996 --- http_main.c Mon Aug 5 18:03:20 1996 *************** *** 1249,1255 **** #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, (request_rec*)NULL); --- 1249,1255 ---- #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, (request_rec*)NULL); *************** *** 1568,1574 **** 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); --- 1568,1574 ---- 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); *** http_protocol.c.orig Mon Aug 5 17:58:46 1996 --- http_protocol.c Mon Aug 5 18:02:00 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 ---- *** httpd.h.orig Mon Aug 5 17:58:46 1996 --- httpd.h Mon Aug 5 18:02:00 1996 *************** *** 558,560 **** --- 558,562 ---- unsigned long get_virthost_addr (char *hostname, short int *port); extern time_t restart_time; + + int is_agent_mozilla2(request_rec *r); *** util.c.orig Mon Aug 5 17:58:46 1996 --- util.c Mon Aug 5 18:01:59 1996 *************** *** 66,71 **** --- 66,83 ---- #include #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;