summaryrefslogtreecommitdiff
path: root/source4/smbd/service_stream.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-05 19:03:43 -0600
committerStefan Metzmacher <metze@samba.org>2008-01-05 13:06:03 -0600
commitdf408d056ec03f2abe08ce0ea487e1875b90e7bf (patch)
tree68cb7b83f12d50d8536acef9c1fed74d22ad9f54 /source4/smbd/service_stream.c
parent01c79091924602bb5c3f1c0c823b2577c4708f6a (diff)
downloadsamba-df408d056ec03f2abe08ce0ea487e1875b90e7bf.tar.gz
r26672: Janitorial: Remove uses of global_loadparm.
(This used to be commit 18cd08623eaad7d2cd63b82ea5275d4dfd21cf00)
Diffstat (limited to 'source4/smbd/service_stream.c')
-rw-r--r--source4/smbd/service_stream.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source4/smbd/service_stream.c b/source4/smbd/service_stream.c
index 6d2e95dc94e..0d6f1b72817 100644
--- a/source4/smbd/service_stream.c
+++ b/source4/smbd/service_stream.c
@@ -43,6 +43,7 @@
*/
struct stream_socket {
const struct stream_server_ops *ops;
+ struct loadparm_context *lp_ctx;
struct event_context *event_ctx;
const struct model_ops *model_ops;
struct socket_context *sock;
@@ -151,6 +152,7 @@ NTSTATUS stream_new_connection_merge(struct event_context *ev,
context of the new process (if appropriate)
*/
static void stream_new_connection(struct event_context *ev,
+ struct loadparm_context *lp_ctx,
struct socket_context *sock,
struct server_id server_id, void *private)
{
@@ -182,9 +184,9 @@ static void stream_new_connection(struct event_context *ev,
/* setup to receive internal messages on this connection */
srv_conn->msg_ctx = messaging_init(srv_conn,
- lp_messaging_path(srv_conn, global_loadparm),
+ lp_messaging_path(srv_conn, lp_ctx),
srv_conn->server_id,
- lp_iconv_convenience(global_loadparm),
+ lp_iconv_convenience(lp_ctx),
ev);
if (!srv_conn->msg_ctx) {
stream_terminate_connection(srv_conn, "messaging_init() failed");
@@ -225,7 +227,8 @@ static void stream_accept_handler(struct event_context *ev, struct fd_event *fde
/* ask the process model to create us a process for this new
connection. When done, it calls stream_new_connection()
with the newly created socket */
- stream_socket->model_ops->accept_connection(ev, stream_socket->sock,
+ stream_socket->model_ops->accept_connection(ev, stream_socket->lp_ctx,
+ stream_socket->sock,
stream_new_connection, stream_socket);
}
@@ -238,6 +241,7 @@ static void stream_accept_handler(struct event_context *ev, struct fd_event *fde
to the socket implementation - JRV20070903
*/
NTSTATUS stream_setup_socket(struct event_context *event_context,
+ struct loadparm_context *lp_ctx,
const struct model_ops *model_ops,
const struct stream_server_ops *stream_ops,
const char *family,
@@ -259,6 +263,8 @@ NTSTATUS stream_setup_socket(struct event_context *event_context,
talloc_steal(stream_socket, stream_socket->sock);
+ stream_socket->lp_ctx = talloc_reference(stream_socket, lp_ctx);
+
/* ready to listen */
status = socket_set_option(stream_socket->sock, "SO_KEEPALIVE", NULL);
NT_STATUS_NOT_OK_RETURN(status);