[MINOR] http redirect: don't explicitly state keep-alive on 1.1

Do not set the "connection: keep-alive" header when the request is in
HTTP 1.1, it's implicit.
This commit is contained in:
Willy Tarreau 2010-01-10 10:35:01 +01:00
parent 148d099406
commit 75661457f7

View File

@ -2867,8 +2867,12 @@ int http_process_req_common(struct session *s, struct buffer *req, int an_bit, s
((txn->flags & TX_CON_WANT_MSK) == TX_CON_WANT_SCL ||
(txn->flags & TX_CON_WANT_MSK) == TX_CON_WANT_KAL)) {
/* keep-alive possible */
memcpy(rdr.str + rdr.len, "\r\nConnection: keep-alive\r\n\r\n", 28);
rdr.len += 28;
if (!(txn->flags & TX_REQ_VER_11)) {
memcpy(rdr.str + rdr.len, "\r\nConnection: keep-alive", 24);
rdr.len += 24;
}
memcpy(rdr.str + rdr.len, "\r\n\r\n", 4);
rdr.len += 4;
buffer_write(req->prod->ob, rdr.str, rdr.len);
/* "eat" the request */
buffer_ignore(req, msg->sov - msg->som);