diff --git a/include/proto/proto_http.h b/include/proto/proto_http.h index 2e2163ee5..eecd9a771 100644 --- a/include/proto/proto_http.h +++ b/include/proto/proto_http.h @@ -80,7 +80,6 @@ int htx_wait_for_response(struct stream *s, struct channel *rep, int an_bit); int htx_process_res_common(struct stream *s, struct channel *rep, int an_bit, struct proxy *px); int htx_request_forward_body(struct stream *s, struct channel *req, int an_bit); int htx_response_forward_body(struct stream *s, struct channel *res, int an_bit); -void htx_adjust_conn_mode(struct stream *s, struct http_txn *txn); int htx_apply_redirect_rule(struct redirect_rule *rule, struct stream *s, struct http_txn *txn); int htx_transform_header_str(struct stream* s, struct channel *chn, struct htx *htx, struct ist name, const char *str, struct my_regex *re, int action); diff --git a/src/proto_http.c b/src/proto_http.c index 0a91091b2..e68b0e2f5 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -495,7 +495,7 @@ void http_adjust_conn_mode(struct stream *s, struct http_txn *txn, struct http_m int tmp = TX_CON_WANT_KAL; if (IS_HTX_STRM(s)) - return htx_adjust_conn_mode(s, txn); + return; if ((fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_TUN || (s->be->options & PR_O_HTTP_MODE) == PR_O_HTTP_TUN) diff --git a/src/proto_htx.c b/src/proto_htx.c index 2ec1dc4d9..33879438a 100644 --- a/src/proto_htx.c +++ b/src/proto_htx.c @@ -409,18 +409,8 @@ int htx_wait_for_request(struct stream *s, struct channel *req, int an_bit) if (unlikely((s->logs.logwait & LW_REQHDR) && s->req_cap)) htx_capture_headers(htx, s->req_cap, sess->fe->req_cap); - /* Until set to anything else, the connection mode is set as Keep-Alive. It will - * only change if both the request and the config reference something else. - * Option httpclose by itself sets tunnel mode where headers are mangled. - * However, if another mode is set, it will affect it (eg: server-close/ - * keep-alive + httpclose = close). Note that we avoid to redo the same work - * if FE and BE have the same settings (common). The method consists in - * checking if options changed between the two calls (implying that either - * one is non-null, or one of them is non-null and we are there for the first - * time. - */ - if ((sess->fe->options & PR_O_HTTP_MODE) != (s->be->options & PR_O_HTTP_MODE)) - htx_adjust_conn_mode(s, txn); + /* by default, close the stream at the end of the transaction. */ + txn->flags = (txn->flags & ~TX_CON_WANT_MSK) | TX_CON_WANT_CLO; /* we may have to wait for the request's body */ if (s->be->options & PR_O_WREQ_BODY) @@ -2296,14 +2286,6 @@ int htx_response_forward_body(struct stream *s, struct channel *res, int an_bit) return 0; } -void htx_adjust_conn_mode(struct stream *s, struct http_txn *txn) -{ - int tmp = TX_CON_WANT_CLO; - - if ((txn->flags & TX_CON_WANT_MSK) < tmp) - txn->flags = (txn->flags & ~TX_CON_WANT_MSK) | tmp; -} - /* Perform an HTTP redirect based on the information in . The function * returns zero on success, or zero in case of a, irrecoverable error such * as too large a request to build a valid response.