summaryrefslogtreecommitdiff
path: root/source4/web_server
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-11-15 10:12:22 +1100
committerAndrew Tridgell <tridge@samba.org>2010-11-15 10:19:34 +1100
commitef7f4a142068757dcf0dc11c5b7cf03755be45a8 (patch)
treed8e56b44df249b52da8d913f92293ac39d45be35 /source4/web_server
parentec590fc9e37c38891bdd10aaae5bac46f5e71f75 (diff)
downloadsamba-ef7f4a142068757dcf0dc11c5b7cf03755be45a8.tar.gz
samba-ef7f4a142068757dcf0dc11c5b7cf03755be45a8.tar.bz2
samba-ef7f4a142068757dcf0dc11c5b7cf03755be45a8.zip
s4-server: make server sockets a child of the task context
We previously allocated sockets as direct children of the event context. That led to crashes if a service called task_server_terminate(), as it left the socket open and handling events for a dead protocol. Making them a child of the task allows the task to terminate and take all its sockets with it. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/web_server')
-rw-r--r--source4/web_server/web_server.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source4/web_server/web_server.c b/source4/web_server/web_server.c
index 97e65e5a47..4cc2cb8d38 100644
--- a/source4/web_server/web_server.c
+++ b/source4/web_server/web_server.c
@@ -320,7 +320,8 @@ static void websrv_task_init(struct task_server *task)
num_interfaces = iface_count(ifaces);
for(i = 0; i < num_interfaces; i++) {
const char *address = iface_n_ip(ifaces, i);
- status = stream_setup_socket(task->event_ctx,
+ status = stream_setup_socket(task,
+ task->event_ctx,
task->lp_ctx, model_ops,
&web_stream_ops,
"ipv4", address,
@@ -331,7 +332,7 @@ static void websrv_task_init(struct task_server *task)
talloc_free(ifaces);
} else {
- status = stream_setup_socket(task->event_ctx, task->lp_ctx,
+ status = stream_setup_socket(task, task->event_ctx, task->lp_ctx,
model_ops, &web_stream_ops,
"ipv4", lpcfg_socket_address(task->lp_ctx),
&port, lpcfg_socket_options(task->lp_ctx), task);