akosut 96/08/06 17:43:09
Modified: src http_protocol.c
Log:
Improve ordering of the if that checks for keepalivability; put the
scalar comparisons before the string checks.
Submitted by: Roy T. Fielding
Revision Changes Path
1.33 +7 -7 apache/src/http_protocol.c
Index: http_protocol.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_protocol.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -C3 -r1.32 -r1.33
*** http_protocol.c 1996/08/07 00:36:01 1.32
--- http_protocol.c 1996/08/07 00:43:07 1.33
***************
*** 282,297 ****
char *conn = table_get (r->headers_in, "Connection");
char *length = table_get (r->headers_out, "Content-length");
#ifdef FORHTTP11
! if ((((r->proto_num >= 1001) && (!find_token(r->pool, conn, "close")))
! || (find_token(r->pool, conn, "keep-alive")))
#else
! if ((find_token(r->pool, conn, "keep-alive"))
#endif
- && (r->header_only || length ||
- ((r->proto_num >= 1001) && (r->byterange > 1 || (r->chunked = 1))))
- && (r->server->keep_alive_timeout &&
- (r->server->keep_alive > r->connection->keepalives))) {
char header[26];
int left = r->server->keep_alive - r->connection->keepalives;
--- 282,297 ----
char *conn = table_get (r->headers_in, "Connection");
char *length = table_get (r->headers_out, "Content-length");
+ if ((r->server->keep_alive > r->connection->keepalives) &&
+ (r->server->keep_alive_timeout > 0) &&
+ (r->header_only || length ||
+ ((r->proto_num >= 1001) && (r->byterange > 1 || (r->chunked = 1)))) &&
+ (!find_token(r->pool, conn, "close")) &&
#ifdef FORHTTP11
! ((proto_num >= 1001) || find_token(r->pool, conn, "keep-alive"))) {
#else
! (find_token(r->pool, conn, "keep-alive"))) {
#endif
char header[26];
int left = r->server->keep_alive - r->connection->keepalives;