You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@liege.ICS.UCI.EDU> on 1996/09/17 18:09:41 UTC
Re: cvs commit: apache/src http_main.c http_protocol.c
I don't understand the need for a table_get in both places.
Why is it not sufficient to only check for nokeepalive when we set_keepalive?
If keepalive isn't set, there is no need for the later table_get, right?
Or am I missing something?
.......Roy
> chuck 96/09/17 07:53:56
>
> Modified: src http_main.c http_protocol.c
> Log:
> Submitted by: Chuck Murcko
> Fix for Netscape 2.x keepalive problems. This also removes the HTTP header
> flush which was causing TCP slow start/delayed ACK/delayed segment on keepalives,
> eating up ~400 ms (1) additional per keepalive connect, plus latency. This
> is in essence the previously submitted fix, using BrowserMatch instead of a
> dedicated function.
>
> Reference:
> Heidemann et al. -
> Performance Interactions Between P-HTTP and TCP Implementations
> <http://www.isi.edu/lsam/publications/phttp_tcp_interactions/>
>
> Revision Changes Path
> 1.68 +9 -7 apache/src/http_main.c
>
> Index: http_main.c
> ===================================================================
> RCS file: /export/home/cvs/apache/src/http_main.c,v
> retrieving revision 1.67
> retrieving revision 1.68
> diff -C3 -r1.67 -r1.68
> *** http_main.c 1996/09/13 00:24:50 1.67
> --- http_main.c 1996/09/17 14:53:52 1.68
> ***************
> *** 50,56 ****
> *
> */
>
> ! /* $Id: http_main.c,v 1.67 1996/09/13 00:24:50 jim Exp $ */
>
> /*
> * httpd.c: simple http daemon for answering WWW file requests
> --- 50,56 ----
> *
> */
>
> ! /* $Id: http_main.c,v 1.68 1996/09/17 14:53:52 chuck Exp $ */
>
> /*
> * httpd.c: simple http daemon for answering WWW file requests
> ***************
> *** 1522,1528 ****
> #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,
> --- 1522,1529 ----
> #if defined(STATUS)
> if (r) increment_counts(child_num,r,1);
> #endif
> ! while (r && current_conn->keepalive &&
> ! !table_get(r->subprocess_env, "nokeepalive")) {
> bflush(conn_io);
> destroy_pool(r->pool);
> (void)update_child_status (child_num, SERVER_BUSY_KEEPALIVE,
> ***************
> *** 1959,1969 ****
> 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);
> ! if (r) process_request (r);
> }
>
> bflush(cio);
> --- 1960,1971 ----
> r = read_request (conn);
> if (r) process_request (r); /* else premature EOF (ignore) */
>
> ! while (r && conn->keepalive &&
> ! !table_get(r->subprocess_env, "nokeepalive")) {
> ! bflush(cio);
> ! destroy_pool(r->pool);
> ! r = read_request (conn);
> ! if (r) process_request (r);
> }
>
> bflush(cio);
>
>
>
> 1.46 +3 -5 apache/src/http_protocol.c
>
> Index: http_protocol.c
> ===================================================================
> RCS file: /export/home/cvs/apache/src/http_protocol.c,v
> retrieving revision 1.45
> retrieving revision 1.46
> diff -C3 -r1.45 -r1.46
> *** http_protocol.c 1996/09/03 00:31:26 1.45
> --- http_protocol.c 1996/09/17 14:53:54 1.46
> ***************
> *** 50,56 ****
> *
> */
>
> ! /* $Id: http_protocol.c,v 1.45 1996/09/03 00:31:26 akosut Exp $ */
>
> /*
> * http_protocol.c --- routines which directly communicate with the
> --- 50,56 ----
> *
> */
>
> ! /* $Id: http_protocol.c,v 1.46 1996/09/17 14:53:54 chuck Exp $ */
>
> /*
> * http_protocol.c --- routines which directly communicate with the
> ***************
> *** 981,987 ****
>
> basic_http_header (r);
>
> ! set_keepalive (r);
>
> if (r->chunked)
> bputs("Transfer-Encoding: chunked\015\012", fd);
> --- 981,988 ----
>
> basic_http_header (r);
>
> ! if (!table_get(r->subprocess_env, "nokeepalive"))
> ! set_keepalive (r);
>
> if (r->chunked)
> bputs("Transfer-Encoding: chunked\015\012", fd);
> ***************
> *** 1026,1034 ****
> }
>
> bputs("\015\012",fd);
> -
> - if (c->keepalive)
> - bflush(fd); /* This is to work around a Netscape bug */
>
> bsetopt(fd, BO_BYTECT, &zero);
> r->sent_bodyct = 1; /* Whatever follows is real body stuff... */
> --- 1027,1032 ----
>
>
>