mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 23:56:57 +02:00
MINOR: quic: set listener accept cb on parsing
Define a special accept cb for QUIC listeners to quic_session_accept(). This operation is conducted during the proto.add callback when creating listeners. A special care is now taken care when setting the standard callback session_accept_fd() to not overwrite if already defined by the proto layer.
This commit is contained in:
parent
29632b8b10
commit
57af069571
@ -33,6 +33,7 @@
|
|||||||
#include <haproxy/connection-t.h>
|
#include <haproxy/connection-t.h>
|
||||||
#include <haproxy/listener-t.h>
|
#include <haproxy/listener-t.h>
|
||||||
|
|
||||||
|
int quic_session_accept(struct connection *cli_conn);
|
||||||
int quic_sock_accepting_conn(const struct receiver *rx);
|
int quic_sock_accepting_conn(const struct receiver *rx);
|
||||||
struct connection *quic_sock_accept_conn(struct listener *l, int *status);
|
struct connection *quic_sock_accept_conn(struct listener *l, int *status);
|
||||||
void quic_sock_fd_iocb(int fd);
|
void quic_sock_fd_iocb(int fd);
|
||||||
|
@ -3901,7 +3901,12 @@ int check_config_validity()
|
|||||||
if (!listener->maxaccept)
|
if (!listener->maxaccept)
|
||||||
listener->maxaccept = global.tune.maxaccept ? global.tune.maxaccept : MAX_ACCEPT;
|
listener->maxaccept = global.tune.maxaccept ? global.tune.maxaccept : MAX_ACCEPT;
|
||||||
|
|
||||||
|
/* listener->accept may already be initialized by some
|
||||||
|
* protocols so do not overwrite it in this case.
|
||||||
|
*/
|
||||||
|
if (!listener->accept)
|
||||||
listener->accept = session_accept_fd;
|
listener->accept = session_accept_fd;
|
||||||
|
|
||||||
listener->analysers |= curproxy->fe_req_ana;
|
listener->analysers |= curproxy->fe_req_ana;
|
||||||
listener->default_target = curproxy->default_target;
|
listener->default_target = curproxy->default_target;
|
||||||
|
|
||||||
|
@ -518,6 +518,9 @@ int quic_connect_server(struct connection *conn, int flags)
|
|||||||
*/
|
*/
|
||||||
static void quic_add_listener(struct protocol *proto, struct listener *listener)
|
static void quic_add_listener(struct protocol *proto, struct listener *listener)
|
||||||
{
|
{
|
||||||
|
/* custom accept callback for QUIC */
|
||||||
|
listener->accept = quic_session_accept;
|
||||||
|
|
||||||
MT_LIST_INIT(&listener->rx.pkts);
|
MT_LIST_INIT(&listener->rx.pkts);
|
||||||
listener->rx.odcids = EB_ROOT_UNIQUE;
|
listener->rx.odcids = EB_ROOT_UNIQUE;
|
||||||
listener->rx.cids = EB_ROOT_UNIQUE;
|
listener->rx.cids = EB_ROOT_UNIQUE;
|
||||||
|
@ -107,8 +107,6 @@ static int new_quic_cli_conn(struct quic_conn *qc, struct listener *l,
|
|||||||
cli_conn->handle.fd = l->rx.fd;
|
cli_conn->handle.fd = l->rx.fd;
|
||||||
cli_conn->target = &l->obj_type;
|
cli_conn->target = &l->obj_type;
|
||||||
|
|
||||||
/* XXX Should not be there. */
|
|
||||||
l->accept = quic_session_accept;
|
|
||||||
/* We need the xprt context before accepting (->accept()) the connection:
|
/* We need the xprt context before accepting (->accept()) the connection:
|
||||||
* we may receive packet before this connection acception.
|
* we may receive packet before this connection acception.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user