]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: http-ana: Remove the unused function http_reset_txn()
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 7 Nov 2019 14:26:45 +0000 (15:26 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 7 Nov 2019 14:32:52 +0000 (15:32 +0100)
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.

include/proto/http_ana.h
src/http_ana.c

index a0db643830a0b6d09a82cb8feb29b358fd5a092d..376d4b150b9b6b1bd380472ad6a22a1f788de69d 100644 (file)
@@ -56,7 +56,6 @@ struct buffer *http_error_message(struct stream *s);
 struct http_txn *http_alloc_txn(struct stream *s);
 void http_init_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) */
 static inline const char *h1_msg_state_str(enum h1_state msg_state)
index 6ced37fb394bf5e585377a7a420cf16610361ab8..428681d2c7d9dc697872c518151f99fde093bc9d 100644 (file)
@@ -5435,73 +5435,6 @@ void http_end_txn(struct stream *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_uniqueid, "uniqueid", UNIQUEID_LEN);