summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2011-05-10 08:39:14 -0400
committerAndreas Schneider <asn@samba.org>2011-08-10 18:14:04 +0200
commitf6ae58f24256a339eec3b17699b10ab11482e6c1 (patch)
treea21500ff9df3bc24cc1e306410544a5b845b11aa /source3/printing
parentafde4d8d832529fdbb842a2acbf8e75f16333529 (diff)
downloadsamba-f6ae58f24256a339eec3b17699b10ab11482e6c1.tar.gz
samba-f6ae58f24256a339eec3b17699b10ab11482e6c1.tar.bz2
samba-f6ae58f24256a339eec3b17699b10ab11482e6c1.zip
s3-prefork: add support for multiple listning file descriptors
Signed-off-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/spoolssd.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c
index 0d5a49d9ea..25223c94c5 100644
--- a/source3/printing/spoolssd.c
+++ b/source3/printing/spoolssd.c
@@ -348,7 +348,8 @@ struct spoolss_children_data {
struct tevent_context *ev_ctx;
struct messaging_context *msg_ctx;
struct pf_worker_data *pf;
- int listen_fd;
+ int listen_fd_size;
+ int *listen_fds;
int lock_fd;
bool listening;
@@ -358,7 +359,9 @@ static void spoolss_next_client(void *pvt);
static int spoolss_children_main(struct tevent_context *ev_ctx,
struct pf_worker_data *pf,
- int listen_fd, int lock_fd,
+ int listen_fd_size,
+ int *listen_fds,
+ int lock_fd,
void *private_data)
{
struct messaging_context *msg_ctx = server_messaging_context();
@@ -379,7 +382,8 @@ static int spoolss_children_main(struct tevent_context *ev_ctx,
data->ev_ctx = ev_ctx;
data->msg_ctx = msg_ctx;
data->lock_fd = lock_fd;
- data->listen_fd = listen_fd;
+ data->listen_fd_size = listen_fd_size;
+ data->listen_fds = listen_fds;
data->listening = false;
/* loop until it is time to exit */
@@ -457,7 +461,9 @@ static void spoolss_next_client(void *pvt)
next->addrlen = sizeof(next->sunaddr);
req = prefork_listen_send(next, data->ev_ctx, data->pf,
- data->lock_fd, data->listen_fd,
+ data->listen_fd_size,
+ data->listen_fds,
+ data->lock_fd,
(struct sockaddr *)&next->sunaddr,
&next->addrlen);
if (!req) {
@@ -712,7 +718,7 @@ void start_spoolssd(struct tevent_context *ev_ctx,
/* start children before any more initialization is done */
- ok = prefork_create_pool(ev_ctx, ev_ctx, listen_fd,
+ ok = prefork_create_pool(ev_ctx, ev_ctx, 1, &listen_fd,
spoolss_min_children,
spoolss_max_children,
&spoolss_children_main, NULL,