MEDIUM: listener: Bind listeners on a thread subset if specified

If a "process" option with a thread set is used on the bind line, we use the
corresponding bitmask when the listener's FD is created.
This commit is contained in:
Christopher Faulet 2017-11-24 10:08:09 +01:00 committed by Willy Tarreau
parent c644fa9bf5
commit 165f07e7b4
2 changed files with 8 additions and 2 deletions

View File

@ -1107,6 +1107,9 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
fdtab[fd].owner = listener; /* reference the listener instead of a task */
fdtab[fd].iocb = listener->proto->accept;
if (listener->bind_conf->bind_thread[relative_pid-1])
fd_insert(fd, listener->bind_conf->bind_thread[relative_pid-1]);
else
fd_insert(fd, MAX_THREADS_MASK);
tcp_return:

View File

@ -334,6 +334,9 @@ static int uxst_bind_listener(struct listener *listener, char *errmsg, int errle
/* the function for the accept() event */
fdtab[fd].iocb = listener->proto->accept;
fdtab[fd].owner = listener; /* reference the listener instead of a task */
if (listener->bind_conf->bind_thread[relative_pid-1])
fd_insert(fd, listener->bind_conf->bind_thread[relative_pid-1]);
else
fd_insert(fd, MAX_THREADS_MASK);
return err;