mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
MINOR: quic: Move conn_prepare() to ->accept_conn() callback
The xprt context must be initialized before receiving further packets from the I/O dgram handler.
This commit is contained in:
parent
6de7287cc7
commit
01ab6618fe
@ -35,9 +35,6 @@ int quic_session_accept(struct connection *cli_conn)
|
||||
struct session *sess;
|
||||
|
||||
cli_conn->proxy_netns = l->rx.settings->netns;
|
||||
if (conn_prepare(cli_conn, l->rx.proto, l->bind_conf->xprt) < 0)
|
||||
goto out_free_conn;
|
||||
|
||||
/* This flag is ordinarily set by conn_ctrl_init() which cannot
|
||||
* be called for now.
|
||||
*/
|
||||
@ -113,14 +110,19 @@ static int new_quic_cli_conn(struct quic_conn *qc, struct listener *l,
|
||||
|
||||
/* XXX Should not be there. */
|
||||
l->accept = quic_session_accept;
|
||||
/* We need the xprt context before accepting (->accept()) the connection:
|
||||
* we may receive packet before this connection acception.
|
||||
*/
|
||||
if (conn_prepare(cli_conn, l->rx.proto, l->bind_conf->xprt) < 0)
|
||||
goto out_free_conn;
|
||||
|
||||
return 1;
|
||||
|
||||
out_free_conn:
|
||||
qc->conn = NULL;
|
||||
conn_stop_tracking(cli_conn);
|
||||
conn_xprt_close(cli_conn);
|
||||
conn_free(cli_conn);
|
||||
qc->conn = NULL;
|
||||
out:
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user