MINOR: listeners: split do_unbind_listener() in two

The inner part now goes into the protocol and is used to decide how to
unbind a given protocol's listener. The existing code which is able to
also unbind the receiver was provided as a default function that we
currently use everywhere. Some complex listeners like QUIC will use this
to decide how to unbind without impacting existing connections, possibly
by setting up other incoming paths for the traffic.
diff --git a/src/listener.c b/src/listener.c
index b1c6437..3e305c7 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -538,18 +538,14 @@
 	}
 }
 
-/* This function closes the listening socket for the specified listener,
- * provided that it's already in a listening state. The listener enters the
- * LI_ASSIGNED state, except if the FD is not closed, in which case it may
- * remain in LI_LISTEN. Depending on the process' status (master or worker),
- * the listener's bind options and the receiver's origin, it may or may not
- * close the receiver's FD, according to what is provided at the receiver
- * level. Must be called with the lock held.
+
+/* default function used to unbind a listener. This is for use by standard
+ * protocols working on top of accepted sockets. The receiver's rx_unbind()
+ * will automatically be used after the listener is disabled if the socket is
+ * still bound. This must be used under the listener's lock.
  */
-void do_unbind_listener(struct listener *listener)
+void default_unbind_listener(struct listener *listener)
 {
-	MT_LIST_DEL(&listener->wait_queue);
-
 	if (listener->state <= LI_ASSIGNED)
 		goto out_close;
 
@@ -567,6 +563,20 @@
  out_close:
 	if (listener->rx.flags & RX_F_BOUND)
 		listener->rx.proto->rx_unbind(&listener->rx);
+}
+
+/* This function closes the listening socket for the specified listener,
+ * provided that it's already in a listening state. The protocol's unbind()
+ * is called to put the listener into LI_ASSIGNED or LI_LISTEN and handle
+ * the unbinding tasks. The listener enters then the LI_ASSIGNED state if
+ * the receiver is unbound. Must be called with the lock held.
+ */
+void do_unbind_listener(struct listener *listener)
+{
+	MT_LIST_DEL(&listener->wait_queue);
+
+	if (listener->rx.proto->unbind)
+		listener->rx.proto->unbind(listener);
 
 	/* we may have to downgrade the listener if the rx was closed */
 	if (!(listener->rx.flags & RX_F_BOUND) && listener->state > LI_ASSIGNED)