MINOR: quic-be: Add a function to initialize the QUIC client transport parameters
Implement qc_srv_params_init() to initialize the QUIC client transport parameters in relation with connections to haproxy servers/backends.
This commit is contained in:
parent
f49bbd36b9
commit
9c84f64652
@ -26,6 +26,9 @@ int qc_lstnr_params_init(struct quic_conn *qc,
|
|||||||
const unsigned char *dcid, size_t dcidlen,
|
const unsigned char *dcid, size_t dcidlen,
|
||||||
const unsigned char *scid, size_t scidlen,
|
const unsigned char *scid, size_t scidlen,
|
||||||
const struct quic_cid *token_odcid);
|
const struct quic_cid *token_odcid);
|
||||||
|
void qc_srv_params_init(struct quic_conn *qc,
|
||||||
|
const struct quic_transport_params *srv_params,
|
||||||
|
const unsigned char *scid, size_t scidlen);
|
||||||
|
|
||||||
/* Dump <cid> transport parameter connection ID value if present (non null length).
|
/* Dump <cid> transport parameter connection ID value if present (non null length).
|
||||||
* Used only for debugging purposes.
|
* Used only for debugging purposes.
|
||||||
|
@ -828,3 +828,21 @@ int qc_lstnr_params_init(struct quic_conn *qc,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* QUIC client (or haproxy server) only function.
|
||||||
|
* Initialize the local transport parameters <rx_params> from <srv_params>
|
||||||
|
* coming from configuration and source connection ID).
|
||||||
|
* Never fails.
|
||||||
|
*/
|
||||||
|
void qc_srv_params_init(struct quic_conn *qc,
|
||||||
|
const struct quic_transport_params *srv_params,
|
||||||
|
const unsigned char *scid, size_t scidlen)
|
||||||
|
{
|
||||||
|
struct quic_transport_params *rx_params = &qc->rx.params;
|
||||||
|
|
||||||
|
/* Copy the transport parameters. */
|
||||||
|
*rx_params = *srv_params;
|
||||||
|
/* Copy the initial source connection ID. */
|
||||||
|
memcpy(rx_params->initial_source_connection_id.data, scid, scidlen);
|
||||||
|
rx_params->initial_source_connection_id.len = scidlen;
|
||||||
|
TRACE_PROTO("\nRX(local) transp. params.", QUIC_EV_TRANSP_PARAMS, qc, rx_params);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user