summaryrefslogtreecommitdiff
path: root/source4/echo_server
diff options
context:
space:
mode:
authorGary Lockyer <gary@catalyst.net.nz>2017-09-18 13:05:24 +1200
committerAndrew Bartlett <abartlet@samba.org>2017-10-19 05:33:10 +0200
commit08402526704c6d586febadf401959bc3d8661836 (patch)
tree2ef36fcacab16df9d7a9c3aef1b18e7643a97cc8 /source4/echo_server
parent62d7bf9e0ae94baaaa090051bd6b7cb40e5ef3c3 (diff)
downloadsamba-08402526704c6d586febadf401959bc3d8661836.tar.gz
source4/smbd: Do not overstamp the process model with "single"
Instead, except in RPC which is a special SNOWFLAKE, we rely on the struct service_details in the init function. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'source4/echo_server')
-rw-r--r--source4/echo_server/echo_server.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/source4/echo_server/echo_server.c b/source4/echo_server/echo_server.c
index 9a66211ebe8..90f8616ca11 100644
--- a/source4/echo_server/echo_server.c
+++ b/source4/echo_server/echo_server.c
@@ -241,34 +241,14 @@ static NTSTATUS echo_add_socket(struct echo_server *echo,
/* Set up the listening sockets */
static NTSTATUS echo_startup_interfaces(struct echo_server *echo,
struct loadparm_context *lp_ctx,
- struct interface *ifaces)
+ struct interface *ifaces,
+ const struct model_ops *model_ops)
{
- const struct model_ops *model_ops;
int num_interfaces;
TALLOC_CTX *tmp_ctx = talloc_new(echo);
NTSTATUS status;
int i;
- /*
- * Samba allows subtask to set their own process model.
- * Available models currently are:
- * - onefork (forks exactly one child process)
- * - prefork (keep a couple of child processes around)
- * - single (only run a single process)
- * - standard (fork one subprocess per incoming connection)
- * - thread (use threads instead of forks)
- *
- * For the echo server, the "single" process model works fine,
- * you probably don't want to use the thread model unless you really
- * know what you're doing.
- */
-
- model_ops = process_model_startup("single");
- if (model_ops == NULL) {
- DEBUG(0, ("Can't find 'single' process model_ops\n"));
- return NT_STATUS_INTERNAL_ERROR;
- }
-
num_interfaces = iface_list_count(ifaces);
for(i=0; i<num_interfaces; i++) {
@@ -327,7 +307,8 @@ static void echo_task_init(struct task_server *task)
echo->task = task;
- status = echo_startup_interfaces(echo, task->lp_ctx, ifaces);
+ status = echo_startup_interfaces(echo, task->lp_ctx, ifaces,
+ task->model_ops);
if (!NT_STATUS_IS_OK(status)) {
task_server_terminate(task, "echo: Failed to set up interfaces",
true);