From 010fe151ceb872ade68916f367d877338f14046e Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 25 Sep 2020 17:31:05 +0200 Subject: [PATCH] MINOR: listener: use the protocol's ->rx_resume() method when available Instead of calling listen() for IPPROTO_TCP in resume_listener(), let's call the protocol's ->rx_resume() method when defined, which does the same. This removes another hard-dependency on the fd and underlying protocol from the generic functions. --- src/listener.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/listener.c b/src/listener.c index fae46c715..2bd1afb67 100644 --- a/src/listener.c +++ b/src/listener.c @@ -408,9 +408,8 @@ int resume_listener(struct listener *l) goto end; } - if (l->rx.proto->sock_prot == IPPROTO_TCP && - l->state == LI_PAUSED && - listen(l->rx.fd, listener_backlog(l)) != 0) { + if (l->state == LI_PAUSED && l->rx.proto->rx_resume && + l->rx.proto->rx_resume(&l->rx) <= 0) { ret = 0; goto end; }