summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2020-09-24 18:20:37 +0200
committerWilly Tarreau <w@1wt.eu>2020-10-07 18:45:03 +0200
commit93d4697c21abe6e7fe9f4bef004c71cf3a53c825 (patch)
tree677c563a02083fa2d4867a0479b69c944f146f4e
parent6d5b33741230244f4e698072b8b482e55ba210ec (diff)
downloadhaproxy-93d4697c21abe6e7fe9f4bef004c71cf3a53c825.tar.gz
MINOR: listeners: move fd_stop_recv() to the receiver's socket code
fd_stop_recv() has nothing to do in the generic listener code, it's per protocol as some don't need it. For instance with abns@ it could even lead to fd_stop_recv(-1). And later with QUIC we don't want to touch the fd at all! It used to be that since commit f2cb169487 delegating fd manipulation to their respective threads it wasn't possible to call it down there but it's not the case anymore, so let's perform the action in the protocol-specific code.
-rw-r--r--src/listener.c1
-rw-r--r--src/proto_tcp.c2
-rw-r--r--src/proto_uxst.c3
3 files changed, 4 insertions, 2 deletions
diff --git a/src/listener.c b/src/listener.c
index 15e363585..874b852cf 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -362,7 +362,6 @@ int pause_listener(struct listener *l)
MT_LIST_DEL(&l->wait_queue);
- fd_stop_recv(l->rx.fd);
listener_set_state(l, LI_PAUSED);
if (px && !px->li_ready) {
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index e77d50e25..bfdc63c45 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -740,6 +740,8 @@ int tcp_pause_listener(struct listener *l)
if (shutdown(l->rx.fd, SHUT_RD) != 0)
return -1; /* should always be OK */
+
+ fd_stop_recv(l->rx.fd);
return 1;
}
diff --git a/src/proto_uxst.c b/src/proto_uxst.c
index bafe97dcf..c477d193d 100644
--- a/src/proto_uxst.c
+++ b/src/proto_uxst.c
@@ -151,7 +151,8 @@ static void uxst_add_listener(struct listener *listener, int port)
/* Pause a listener. Returns < 0 in case of failure, 0 if the listener
* was totally stopped, or > 0 if correctly paused. Nothing is done for
* plain unix sockets since currently it's the new process which handles
- * the renaming. Abstract sockets are completely unbound.
+ * the renaming. Abstract sockets are completely unbound and closed so
+ * there's no need to stop the poller.
*/
static int uxst_pause_listener(struct listener *l)
{