/*
- * $Id: HttpReply.cc,v 1.16 1998/04/27 19:16:06 wessels Exp $
+ * $Id: HttpReply.cc,v 1.17 1998/04/27 20:03:56 wessels Exp $
*
* DEBUG: section 58 HTTP Reply (Response)
* AUTHOR: Alex Rousskov
str = httpHeaderGetStr(hdr, HDR_PROXY_CONNECTION);
if (NULL == str)
str = httpHeaderGetStr(hdr, HDR_CONNECTION); /* @?@ FIX ME */
- rep->proxy_keep_alive = str && 0 == strcasecmp(str, "Keep-Alive");
+ if (str) {
+ rep->keep_alive = (strcasecmp(str, "Keep-Alive") == 0);
+ } else {
+ if (rep->sline.version >= 1.1)
+ rep->keep_alive = 1; /* 1.1+ defaults to keep-alive */
+ else
+ rep->keep_alive = 0; /* pre 1.1 default to non-keep-alive */
+ }
/* final adjustments */
/* The max-age directive takes priority over Expires, check it first */
if (rep->cache_control && rep->cache_control->max_age >= 0)
/*
- * $Id: http.cc,v 1.267 1998/04/27 19:54:01 wessels Exp $
+ * $Id: http.cc,v 1.268 1998/04/27 20:03:55 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
if (EBIT_TEST(httpState->flags, HTTP_KEEPALIVE))
if (httpState->peer)
httpState->peer->stats.n_keepalives_sent++;
- if (reply->proxy_keep_alive)
+ if (reply->keep_alive)
if (httpState->peer)
httpState->peer->stats.n_keepalives_recv++;
ctx_exit(ctx);
*/
if (!EBIT_TEST(httpState->flags, HTTP_KEEPALIVE))
return 0;
+ /*
+ * What does the reply have to say about keep-alive?
+ */
+ if (!reply->keep_alive)
+ return 0;
debug(11, 5) ("httpPconnTransferDone: content_length=%d\n",
reply->content_length);
/*
httpState->fd = -1;
httpStateFree(-1, httpState);
} else {
+ /* Wait for EOF condition */
commSetSelect(fd, COMM_SELECT_READ, httpReadReply, httpState, 0);
}
}
String content_type;
HttpHdrCc *cache_control;
HttpHdrContRange *content_range;
- short int proxy_keep_alive;
+ short int keep_alive;
/* public, readable */
HttpMsgParseState pstate; /* the current parsing state */