MEDIUM: h2: reverse connection after SETTINGS reception

Reverse connection after SETTINGS reception if it was set as reversable.
This operation is done in a new function h2_conn_reverse(). It regroups
common changes which are needed for both reversal direction :
H2_CF_IS_BACK is set or unset and timeouts are inverted.

For the moment, only passive reverse is fully implemented. Once done,
the connection instance is directly inserted in its targetted server
pool. It can then be used immediately for future transfers using this
server.
This commit is contained in:
Amaury Denoyelle
2023-07-27 15:58:08 +02:00
parent 1f76b8ae07
commit 4fb538d4b6
2 changed files with 67 additions and 0 deletions

View File

@@ -697,6 +697,12 @@ static inline int conn_is_ssl(struct connection *conn)
return !!conn_get_ssl_sock_ctx(conn);
}
/* Returns true if connection must be reversed. */
static inline int conn_is_reverse(const struct connection *conn)
{
return !!(conn->reverse.target);
}
#endif /* _HAPROXY_CONNECTION_H */
/*