summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2020-09-25 17:31:05 +0200
committerWilly Tarreau <w@1wt.eu>2020-10-07 18:45:03 +0200
commit9b516d2f2ad813c05c6c47eeda49945cf05dd651 (patch)
treec3f370814f88893bd33e0542340b40f9f58edd9c
parent4597b6031268ca5940f272023ee4d1e61ff83cb6 (diff)
downloadhaproxy-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.c5
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;
}