MEDIUM: h2: implement active connection reversal
Implement active reverse on h2_conn_reverse(). Only minimal steps are done here : HTTP version session counters are incremented on the listener instance. Also, the connection is inserted in the mux_stopping_list to ensure it will be actively closed on process shutdown/listener suspend.
This commit is contained in:
parent
b130f8dbc3
commit
6820b9b393
21
src/mux_h2.c
21
src/mux_h2.c
|
@ -3220,6 +3220,9 @@ static int h2_frame_check_vs_state(struct h2c *h2c, struct h2s *h2s)
|
||||||
* passive reversal. Timeouts are inverted and H2_CF_IS_BACK is set or unset
|
* passive reversal. Timeouts are inverted and H2_CF_IS_BACK is set or unset
|
||||||
* depending on the reversal direction.
|
* depending on the reversal direction.
|
||||||
*
|
*
|
||||||
|
* For active reversal, only minor steps are required. The connection should
|
||||||
|
* then be accepted by its listener before being able to use it for transfers.
|
||||||
|
*
|
||||||
* For passive reversal, connection is inserted in its targetted server idle
|
* For passive reversal, connection is inserted in its targetted server idle
|
||||||
* pool. It can thus be reused immediately for future transfers on this server.
|
* pool. It can thus be reused immediately for future transfers on this server.
|
||||||
*
|
*
|
||||||
|
@ -3257,7 +3260,23 @@ static int h2_conn_reverse(struct h2c *h2c)
|
||||||
srv_add_to_idle_list(srv, conn, 1);
|
srv_add_to_idle_list(srv, conn, 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* TODO */
|
struct listener *l = __objt_listener(h2c->conn->target);
|
||||||
|
struct proxy *prx = l->bind_conf->frontend;
|
||||||
|
|
||||||
|
h2c->flags &= ~H2_CF_IS_BACK;
|
||||||
|
|
||||||
|
h2c->shut_timeout = h2c->timeout = prx->timeout.client;
|
||||||
|
if (tick_isset(prx->timeout.clientfin))
|
||||||
|
h2c->shut_timeout = prx->timeout.clientfin;
|
||||||
|
|
||||||
|
h2c->px_counters = EXTRA_COUNTERS_GET(prx->extra_counters_fe,
|
||||||
|
&h2_stats_module);
|
||||||
|
|
||||||
|
proxy_inc_fe_cum_sess_ver_ctr(l, prx, 2);
|
||||||
|
|
||||||
|
BUG_ON(LIST_INLIST(&h2c->conn->stopping_list));
|
||||||
|
LIST_APPEND(&mux_stopping_data[tid].list,
|
||||||
|
&h2c->conn->stopping_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
h2c->task->expire = tick_add(now_ms, h2c->timeout);
|
h2c->task->expire = tick_add(now_ms, h2c->timeout);
|
||||||
|
|
Loading…
Reference in New Issue