]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: listener: use the protocol's ->rx_resume() method when available
authorWilly Tarreau <w@1wt.eu>
Fri, 25 Sep 2020 15:31:05 +0000 (17:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2020 09:27:30 +0000 (11:27 +0200)
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

index fae46c7157c283b35a79c42cafb381b801d62c3f..2bd1afb672cb724009ae435baf235ff8f8dd4abf 100644 (file)
@@ -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;
        }