diff options
author | Andreas Schneider <asn@samba.org> | 2010-06-10 11:48:39 -0400 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2010-06-10 17:30:45 -0400 |
commit | 09627638224759c985f0636c5616b0357c91e450 (patch) | |
tree | c3e0f6849b468a879daf4bac954abe7066cb2716 /source3 | |
parent | cbda0369a831ed279cec7ff231ad7399af74db39 (diff) | |
download | samba-09627638224759c985f0636c5616b0357c91e450.tar.gz samba-09627638224759c985f0636c5616b0357c91e450.tar.bz2 samba-09627638224759c985f0636c5616b0357c91e450.zip |
s3:misc make use of server_[event/messaging]_context directly
Untangle these functions from smbd specific dependencies so they can be freely
used in multiple servers.
Diffstat (limited to 'source3')
-rw-r--r-- | source3/auth/auth_server.c | 2 | ||||
-rw-r--r-- | source3/printing/notify.c | 6 | ||||
-rw-r--r-- | source3/printing/print_cups.c | 8 | ||||
-rw-r--r-- | source3/printing/printing.c | 13 | ||||
-rw-r--r-- | source3/rpc_server/srv_samr_nt.c | 2 |
5 files changed, 16 insertions, 15 deletions
diff --git a/source3/auth/auth_server.c b/source3/auth/auth_server.c index c4d02e25f4..8f0f98b350 100644 --- a/source3/auth/auth_server.c +++ b/source3/auth/auth_server.c @@ -206,7 +206,7 @@ static struct server_security_state *make_server_security_state(struct cli_state interval.tv_sec = lp_keepalive(); interval.tv_usec = 0; - if (event_add_idle(smbd_event_context(), result, interval, + if (event_add_idle(server_event_context(), result, interval, "server_security_keepalive", send_server_keepalive, result) == NULL) { diff --git a/source3/printing/notify.c b/source3/printing/notify.c index 33807f72ef..a18b2fd897 100644 --- a/source3/printing/notify.c +++ b/source3/printing/notify.c @@ -232,7 +232,7 @@ static void print_notify_event_send_messages(struct tevent_context *event_ctx, TALLOC_FREE(notify_event); change_to_root_user(); - print_notify_send_messages(smbd_messaging_context(), 0); + print_notify_send_messages(server_messaging_context(), 0); } /********************************************************************** @@ -326,9 +326,9 @@ to notify_queue_head\n", msg->type, msg->field, msg->printer)); DLIST_ADD_END(notify_queue_head, pnqueue, struct notify_queue *); num_messages++; - if ((notify_event == NULL) && (smbd_event_context() != NULL)) { + if ((notify_event == NULL) && (server_event_context() != NULL)) { /* Add an event for 1 second's time to send this queue. */ - notify_event = tevent_add_timer(smbd_event_context(), NULL, + notify_event = tevent_add_timer(server_event_context(), NULL, timeval_current_ofs(1,0), print_notify_event_send_messages, NULL); } diff --git a/source3/printing/print_cups.c b/source3/printing/print_cups.c index 7366f85973..76a13cf3b4 100644 --- a/source3/printing/print_cups.c +++ b/source3/printing/print_cups.c @@ -434,8 +434,8 @@ static bool cups_pcap_load_async(int *pfd) close_all_print_db(); - if (!NT_STATUS_IS_OK(reinit_after_fork(smbd_messaging_context(), - smbd_event_context(), true))) { + if (!NT_STATUS_IS_OK(reinit_after_fork(server_messaging_context(), + server_event_context(), true))) { DEBUG(0,("cups_pcap_load_async: reinit_after_fork() failed\n")); smb_panic("cups_pcap_load_async: reinit_after_fork() failed"); } @@ -576,7 +576,7 @@ bool cups_cache_reload(void) DEBUG(10,("cups_cache_reload: sync read on fd %d\n", *p_pipe_fd )); - cups_async_callback(smbd_event_context(), + cups_async_callback(server_event_context(), NULL, EVENT_FD_READ, (void *)p_pipe_fd); @@ -592,7 +592,7 @@ bool cups_cache_reload(void) *p_pipe_fd )); /* Trigger an event when the pipe can be read. */ - cache_fd_event = event_add_fd(smbd_event_context(), + cache_fd_event = event_add_fd(server_event_context(), NULL, *p_pipe_fd, EVENT_FD_READ, cups_async_callback, diff --git a/source3/printing/printing.c b/source3/printing/printing.c index 05728d1731..74edb25eb5 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -1436,8 +1436,8 @@ void start_background_queue(void) close(pause_pipe[0]); pause_pipe[0] = -1; - if (!NT_STATUS_IS_OK(reinit_after_fork(smbd_messaging_context(), - smbd_event_context(), + if (!NT_STATUS_IS_OK(reinit_after_fork(server_messaging_context(), + server_event_context(), true))) { DEBUG(0,("reinit_after_fork() failed\n")); smb_panic("reinit_after_fork() failed"); @@ -1455,10 +1455,11 @@ void start_background_queue(void) exit(1); } - messaging_register(smbd_messaging_context(), NULL, + messaging_register(server_messaging_context(), NULL, MSG_PRINTER_UPDATE, print_queue_receive); - fde = tevent_add_fd(smbd_event_context(), smbd_event_context(), + fde = tevent_add_fd(server_event_context(), + server_event_context(), pause_pipe[1], TEVENT_FD_READ, printing_pause_fd_handler, NULL); @@ -1468,7 +1469,7 @@ void start_background_queue(void) } DEBUG(5,("start_background_queue: background LPQ thread waiting for messages\n")); - ret = tevent_loop_wait(smbd_event_context()); + ret = tevent_loop_wait(server_event_context()); /* should not be reached */ DEBUG(0,("background_queue: tevent_loop_wait() exited with %d - %s\n", ret, (ret == 0) ? "out of events" : strerror(errno))); @@ -1601,7 +1602,7 @@ static void print_queue_update(int snum, bool force) /* finally send the message */ - messaging_send_buf(smbd_messaging_context(), + messaging_send_buf(server_messaging_context(), pid_to_procid(background_lpq_updater_pid), MSG_PRINTER_UPDATE, (uint8 *)buffer, len); diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index fda8515e12..499f959475 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -407,7 +407,7 @@ static void set_disp_info_cache_timeout(DISP_INFO *disp_info, time_t secs_fromno (unsigned int)secs_fromnow )); disp_info->cache_timeout_event = event_add_timed( - smbd_event_context(), NULL, + server_event_context(), NULL, timeval_current_ofs(secs_fromnow, 0), disp_info_cache_idle_timeout_handler, (void *)disp_info); } |