diff options
author | Willy Tarreau <w@1wt.eu> | 2020-09-25 17:31:05 +0200 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2020-10-07 18:45:03 +0200 |
commit | 9b516d2f2ad813c05c6c47eeda49945cf05dd651 (patch) | |
tree | c3f370814f88893bd33e0542340b40f9f58edd9c | |
parent | 4597b6031268ca5940f272023ee4d1e61ff83cb6 (diff) | |
download | haproxy-9b516d2f2ad813c05c6c47eeda49945cf05dd651.tar.gz |
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.
-rw-r--r-- | src/listener.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/listener.c b/src/listener.c index 5652fa091..e0a08b262 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; } |