mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-08 08:07:10 +02:00
MINOR: quic: define QUIC_FL_CONN_IS_BACK flag
Define a new quic_conn flag assign if the connection is used on the backend side. This is similar to other haproxy components such as struct connection and muxes element. This flag is positionned via qc_new_conn(). Also update quic traces to mark proxy side as 'F' or 'B' suffix.
This commit is contained in:
parent
e064e5d461
commit
cae828cbf5
@ -448,7 +448,7 @@ struct quic_conn_closed {
|
|||||||
#define QUIC_FL_CONN_ANTI_AMPLIFICATION_REACHED (1U << 0)
|
#define QUIC_FL_CONN_ANTI_AMPLIFICATION_REACHED (1U << 0)
|
||||||
#define QUIC_FL_CONN_SPIN_BIT (1U << 1) /* Spin bit set by remote peer */
|
#define QUIC_FL_CONN_SPIN_BIT (1U << 1) /* Spin bit set by remote peer */
|
||||||
#define QUIC_FL_CONN_NEED_POST_HANDSHAKE_FRMS (1U << 2) /* HANDSHAKE_DONE must be sent */
|
#define QUIC_FL_CONN_NEED_POST_HANDSHAKE_FRMS (1U << 2) /* HANDSHAKE_DONE must be sent */
|
||||||
/* gap here */
|
#define QUIC_FL_CONN_IS_BACK (1U << 3) /* conn used on backend side */
|
||||||
#define QUIC_FL_CONN_ACCEPT_REGISTERED (1U << 4)
|
#define QUIC_FL_CONN_ACCEPT_REGISTERED (1U << 4)
|
||||||
#define QUIC_FL_CONN_UDP_GSO_EIO (1U << 5) /* GSO disabled due to a EIO occured on same listener */
|
#define QUIC_FL_CONN_UDP_GSO_EIO (1U << 5) /* GSO disabled due to a EIO occured on same listener */
|
||||||
#define QUIC_FL_CONN_IDLE_TIMER_RESTARTED_AFTER_READ (1U << 6)
|
#define QUIC_FL_CONN_IDLE_TIMER_RESTARTED_AFTER_READ (1U << 6)
|
||||||
@ -488,6 +488,7 @@ static forceinline char *qc_show_flags(char *buf, size_t len, const char *delim,
|
|||||||
_(QUIC_FL_CONN_ANTI_AMPLIFICATION_REACHED,
|
_(QUIC_FL_CONN_ANTI_AMPLIFICATION_REACHED,
|
||||||
_(QUIC_FL_CONN_SPIN_BIT,
|
_(QUIC_FL_CONN_SPIN_BIT,
|
||||||
_(QUIC_FL_CONN_NEED_POST_HANDSHAKE_FRMS,
|
_(QUIC_FL_CONN_NEED_POST_HANDSHAKE_FRMS,
|
||||||
|
_(QUIC_FL_CONN_IS_BACK,
|
||||||
_(QUIC_FL_CONN_ACCEPT_REGISTERED,
|
_(QUIC_FL_CONN_ACCEPT_REGISTERED,
|
||||||
_(QUIC_FL_CONN_UDP_GSO_EIO,
|
_(QUIC_FL_CONN_UDP_GSO_EIO,
|
||||||
_(QUIC_FL_CONN_IDLE_TIMER_RESTARTED_AFTER_READ,
|
_(QUIC_FL_CONN_IDLE_TIMER_RESTARTED_AFTER_READ,
|
||||||
@ -508,7 +509,7 @@ static forceinline char *qc_show_flags(char *buf, size_t len, const char *delim,
|
|||||||
_(QUIC_FL_CONN_EXP_TIMER,
|
_(QUIC_FL_CONN_EXP_TIMER,
|
||||||
_(QUIC_FL_CONN_CLOSING,
|
_(QUIC_FL_CONN_CLOSING,
|
||||||
_(QUIC_FL_CONN_DRAINING,
|
_(QUIC_FL_CONN_DRAINING,
|
||||||
_(QUIC_FL_CONN_IMMEDIATE_CLOSE))))))))))))))))))))))));
|
_(QUIC_FL_CONN_IMMEDIATE_CLOSE)))))))))))))))))))))))));
|
||||||
/* epilogue */
|
/* epilogue */
|
||||||
_(~0U);
|
_(~0U);
|
||||||
return buf;
|
return buf;
|
||||||
|
@ -82,6 +82,12 @@ void qc_check_close_on_released_mux(struct quic_conn *qc);
|
|||||||
int quic_stateless_reset_token_cpy(unsigned char *pos, size_t len,
|
int quic_stateless_reset_token_cpy(unsigned char *pos, size_t len,
|
||||||
const unsigned char *salt, size_t saltlen);
|
const unsigned char *salt, size_t saltlen);
|
||||||
|
|
||||||
|
/* Returns true if <qc> is used on the backed side (as a client). */
|
||||||
|
static inline int qc_is_back(const struct quic_conn *qc)
|
||||||
|
{
|
||||||
|
return qc->flags & QUIC_FL_CONN_IS_BACK;
|
||||||
|
}
|
||||||
|
|
||||||
/* Free the CIDs attached to <conn> QUIC connection. */
|
/* Free the CIDs attached to <conn> QUIC connection. */
|
||||||
static inline void free_quic_conn_cids(struct quic_conn *conn)
|
static inline void free_quic_conn_cids(struct quic_conn *conn)
|
||||||
{
|
{
|
||||||
|
@ -1198,7 +1198,7 @@ struct quic_conn *qc_new_conn(const struct quic_version *qv, int ipv4,
|
|||||||
else {
|
else {
|
||||||
struct quic_connection_id *conn_cid = NULL;
|
struct quic_connection_id *conn_cid = NULL;
|
||||||
|
|
||||||
qc->flags = QUIC_FL_CONN_PEER_VALIDATED_ADDR;
|
qc->flags = QUIC_FL_CONN_IS_BACK|QUIC_FL_CONN_PEER_VALIDATED_ADDR;
|
||||||
qc->state = QUIC_HS_ST_CLIENT_INITIAL;
|
qc->state = QUIC_HS_ST_CLIENT_INITIAL;
|
||||||
|
|
||||||
/* This is the original connection ID from the peer server
|
/* This is the original connection ID from the peer server
|
||||||
|
@ -115,8 +115,9 @@ static void quic_trace(enum trace_level level, uint64_t mask, const struct trace
|
|||||||
if (qc) {
|
if (qc) {
|
||||||
const struct quic_tls_ctx *tls_ctx;
|
const struct quic_tls_ctx *tls_ctx;
|
||||||
|
|
||||||
chunk_appendf(&trace_buf, " : qc@%p idle_timer_task@%p flags=0x%x",
|
chunk_appendf(&trace_buf, " : qc@%p(%c) idle_timer_task@%p flags=0x%x",
|
||||||
qc, qc->idle_timer_task, qc->flags);
|
qc, (qc->flags & QUIC_FL_CONN_IS_BACK) ? 'B' : 'F',
|
||||||
|
qc->idle_timer_task, qc->flags);
|
||||||
if (mask & QUIC_EV_CONN_NEW) {
|
if (mask & QUIC_EV_CONN_NEW) {
|
||||||
const int *ssl_err = a2;
|
const int *ssl_err = a2;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user