MT_LIST_DEL(&l->wait_queue);
- fd_stop_recv(l->rx.fd);
listener_set_state(l, LI_PAUSED);
if (px && !px->li_ready) {
if (shutdown(l->rx.fd, SHUT_RD) != 0)
goto check_already_done; /* show always be OK */
+ fd_stop_recv(l->rx.fd);
return 1;
check_already_done:
*/
opt_val = 0;
opt_len = sizeof(opt_val);
- if (getsockopt(l->rx.fd, SOL_SOCKET, SO_ACCEPTCONN, &opt_val, &opt_len) == -1)
+ if (getsockopt(l->rx.fd, SOL_SOCKET, SO_ACCEPTCONN, &opt_val, &opt_len) == -1) {
+ fd_stop_recv(l->rx.fd);
return 0; /* the socket is really unrecoverable */
+ }
- if (!opt_val)
+ if (!opt_val) {
+ fd_stop_recv(l->rx.fd);
return 1; /* already paused by another process */
+ }
/* something looks fishy here */
return -1;
/* 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)
{