s3: Lift the server_messaging_context from notify_printer_status_byname
authorVolker Lendecke <vl@samba.org>
Sun, 8 Aug 2010 14:16:37 +0000 (16:16 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 8 Aug 2010 16:09:34 +0000 (18:09 +0200)
source3/include/proto.h
source3/printing/notify.c
source3/utils/smbcontrol.c

index 1b80461055c706ec80c1c62e575c27298129e386..7c2740aa4a84c2bfa79936b20daa430cbe67f932 100644 (file)
@@ -4410,7 +4410,9 @@ uint32_t print_parse_jobid(const char *fname);
 int print_queue_snum(const char *qname);
 void print_notify_send_messages(struct messaging_context *msg_ctx,
                                unsigned int timeout);
-void notify_printer_status_byname(const char *sharename, uint32 status);
+void notify_printer_status_byname(struct tevent_context *ev,
+                                 struct messaging_context *msg_ctx,
+                                 const char *sharename, uint32 status);
 void notify_printer_status(int snum, uint32 status);
 void notify_job_status_byname(const char *sharename, uint32 jobid, uint32 status,
                              uint32 flags);
index 5e5f0294ce122fca9b3b70463d6473ef5b8e5228..65151e9b05c20e690b0449942c7464b76b851ba6 100644 (file)
@@ -404,15 +404,15 @@ static void send_notify_field_buffer(struct tevent_context *ev,
 
 /* Send a message that the printer status has changed */
 
-void notify_printer_status_byname(const char *sharename, uint32 status)
+void notify_printer_status_byname(struct tevent_context *ev,
+                                 struct messaging_context *msg_ctx,
+                                 const char *sharename, uint32 status)
 {
        /* Printer status stored in value1 */
 
        int snum = print_queue_snum(sharename);
 
-       send_notify_field_values(server_event_context(),
-                                server_messaging_context(),
-                                sharename, PRINTER_NOTIFY_TYPE,
+       send_notify_field_values(ev, msg_ctx, sharename, PRINTER_NOTIFY_TYPE,
                                 PRINTER_NOTIFY_FIELD_STATUS, snum,
                                 status, 0, 0);
 }
@@ -422,7 +422,9 @@ void notify_printer_status(int snum, uint32 status)
        const char *sharename = lp_servicename(snum);
 
        if (sharename)
-               notify_printer_status_byname(sharename, status);
+               notify_printer_status_byname(server_event_context(),
+                                            server_messaging_context(),
+                                            sharename, status);
 }
 
 void notify_job_status_byname(const char *sharename, uint32 jobid, uint32 status,
index 9fc80121593048c4e52a529f38e4f37f646b6481..098e07616ba385af9661eedce6ff772d77527cad 100644 (file)
@@ -593,7 +593,9 @@ static bool do_printnotify(struct messaging_context *msg_ctx,
                        return False;
                }
 
-               notify_printer_status_byname(argv[2], PRINTER_STATUS_PAUSED);
+               notify_printer_status_byname(messaging_event_context(msg_ctx),
+                                            msg_ctx, argv[2],
+                                            PRINTER_STATUS_PAUSED);
 
                goto send;
 
@@ -605,7 +607,9 @@ static bool do_printnotify(struct messaging_context *msg_ctx,
                        return False;
                }
 
-               notify_printer_status_byname(argv[2], PRINTER_STATUS_OK);
+               notify_printer_status_byname(messaging_event_context(msg_ctx),
+                                            msg_ctx, argv[2],
+                                            PRINTER_STATUS_OK);
 
                goto send;
 
@@ -621,7 +625,7 @@ static bool do_printnotify(struct messaging_context *msg_ctx,
                jobid = atoi(argv[3]);
 
                notify_job_status_byname(
-                       argv[2], jobid, JOB_STATUS_PAUSED, 
+                       argv[2], jobid, JOB_STATUS_PAUSED,
                        SPOOLSS_NOTIFY_MSG_UNIX_JOBID);
 
                goto send;