mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-08 08:07:10 +02:00
MINOR: http-ana: Remove the unused function http_reset_txn()
Since the legacy HTTP mode was removed, the stream is always released at the end of each HTTP transaction and a new is created to handle the next request for keep-alive connections. So the HTTP transaction is no longer reset and the function http_reset_txn() can be removed.
This commit is contained in:
parent
5939925a38
commit
fee726ffa7
@ -56,7 +56,6 @@ struct buffer *http_error_message(struct stream *s);
|
|||||||
struct http_txn *http_alloc_txn(struct stream *s);
|
struct http_txn *http_alloc_txn(struct stream *s);
|
||||||
void http_init_txn(struct stream *s);
|
void http_init_txn(struct stream *s);
|
||||||
void http_end_txn(struct stream *s);
|
void http_end_txn(struct stream *s);
|
||||||
void http_reset_txn(struct stream *s);
|
|
||||||
|
|
||||||
/* for debugging, reports the HTTP/1 message state name (legacy version) */
|
/* for debugging, reports the HTTP/1 message state name (legacy version) */
|
||||||
static inline const char *h1_msg_state_str(enum h1_state msg_state)
|
static inline const char *h1_msg_state_str(enum h1_state msg_state)
|
||||||
|
@ -5435,73 +5435,6 @@ void http_end_txn(struct stream *s)
|
|||||||
vars_prune(&s->vars_reqres, s->sess, s);
|
vars_prune(&s->vars_reqres, s->sess, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* to be used at the end of a transaction to prepare a new one */
|
|
||||||
void http_reset_txn(struct stream *s)
|
|
||||||
{
|
|
||||||
struct proxy *fe = strm_fe(s);
|
|
||||||
|
|
||||||
http_end_txn(s);
|
|
||||||
http_init_txn(s);
|
|
||||||
|
|
||||||
/* cleanup and reinit capture arrays, if any */
|
|
||||||
if (s->req_cap) {
|
|
||||||
struct cap_hdr *h;
|
|
||||||
for (h = fe->req_cap; h; h = h->next)
|
|
||||||
pool_free(h->pool, s->req_cap[h->index]);
|
|
||||||
memset(s->req_cap, 0, fe->nb_req_cap * sizeof(void *));
|
|
||||||
}
|
|
||||||
if (s->res_cap) {
|
|
||||||
struct cap_hdr *h;
|
|
||||||
for (h = fe->rsp_cap; h; h = h->next)
|
|
||||||
pool_free(h->pool, s->res_cap[h->index]);
|
|
||||||
memset(s->res_cap, 0, fe->nb_rsp_cap * sizeof(void *));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* reinitialise the current rule list pointer to NULL. We are sure that
|
|
||||||
* any rulelist match the NULL pointer.
|
|
||||||
*/
|
|
||||||
s->current_rule_list = NULL;
|
|
||||||
|
|
||||||
s->be = strm_fe(s);
|
|
||||||
s->logs.logwait = strm_fe(s)->to_log;
|
|
||||||
s->logs.level = 0;
|
|
||||||
stream_del_srv_conn(s);
|
|
||||||
s->target = NULL;
|
|
||||||
/* re-init store persistence */
|
|
||||||
s->store_count = 0;
|
|
||||||
s->uniq_id = _HA_ATOMIC_XADD(&global.req_count, 1);
|
|
||||||
|
|
||||||
s->req.flags |= CF_READ_DONTWAIT; /* one read is usually enough */
|
|
||||||
|
|
||||||
/* We must trim any excess data from the response buffer, because we
|
|
||||||
* may have blocked an invalid response from a server that we don't
|
|
||||||
* want to accidently forward once we disable the analysers, nor do
|
|
||||||
* we want those data to come along with next response. A typical
|
|
||||||
* example of such data would be from a buggy server responding to
|
|
||||||
* a HEAD with some data, or sending more than the advertised
|
|
||||||
* content-length.
|
|
||||||
*/
|
|
||||||
if (unlikely(ci_data(&s->res)))
|
|
||||||
b_set_data(&s->res.buf, co_data(&s->res));
|
|
||||||
|
|
||||||
/* Now we can realign the response buffer */
|
|
||||||
c_realign_if_empty(&s->res);
|
|
||||||
|
|
||||||
s->req.rto = strm_fe(s)->timeout.client;
|
|
||||||
s->req.wto = TICK_ETERNITY;
|
|
||||||
|
|
||||||
s->res.rto = TICK_ETERNITY;
|
|
||||||
s->res.wto = strm_fe(s)->timeout.client;
|
|
||||||
|
|
||||||
s->req.rex = TICK_ETERNITY;
|
|
||||||
s->req.wex = TICK_ETERNITY;
|
|
||||||
s->req.analyse_exp = TICK_ETERNITY;
|
|
||||||
s->res.rex = TICK_ETERNITY;
|
|
||||||
s->res.wex = TICK_ETERNITY;
|
|
||||||
s->res.analyse_exp = TICK_ETERNITY;
|
|
||||||
s->si[1].hcto = TICK_ETERNITY;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
DECLARE_POOL(pool_head_http_txn, "http_txn", sizeof(struct http_txn));
|
DECLARE_POOL(pool_head_http_txn, "http_txn", sizeof(struct http_txn));
|
||||||
DECLARE_POOL(pool_head_uniqueid, "uniqueid", UNIQUEID_LEN);
|
DECLARE_POOL(pool_head_uniqueid, "uniqueid", UNIQUEID_LEN);
|
||||||
|
Loading…
Reference in New Issue
Block a user