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 fae46c7..2bd1afb 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -408,9 +408,8 @@
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;
}