From: Willy Tarreau Date: Fri, 25 Sep 2020 15:31:05 +0000 (+0200) Subject: MINOR: listener: use the protocol's ->rx_resume() method when available X-Git-Tag: v2.3-dev6~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=010fe151ceb872ade68916f367d877338f14046e;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/listener.c b/src/listener.c index fae46c7157..2bd1afb672 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; }