summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-08-18 13:55:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:23 -0500
commit1842fde7d10a6faccae1a24ebc67f8452a5a828e (patch)
tree1bb8a33a0ef7bea01532731ccbd965f5590e29a2 /source3/rpc_server
parent5cd11b7127afed6a1e4e540721fa15d45aec471b (diff)
downloadsamba-1842fde7d10a6faccae1a24ebc67f8452a5a828e.tar.gz
samba-1842fde7d10a6faccae1a24ebc67f8452a5a828e.tar.bz2
samba-1842fde7d10a6faccae1a24ebc67f8452a5a828e.zip
r1885: tighten the cache consistency with the ntprinters.tdb entry an the in memory cache associated with open printer handles; also make sure that register_messages_flags() doesn't overwrite the originally registers flags
(This used to be commit 540daf71d8ad189af5dd6d45aa1ce2b3d67da752)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index ccff65688a..5775b3ab49 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -180,7 +180,7 @@ static void srv_spoolss_replycloseprinter(int snum, POLICY_HND *handle)
/* Tell the connections db we're no longer interested in
* printer notify messages. */
- register_message_flags( False, FLAG_MSG_PRINTING );
+ register_message_flags( False, FLAG_MSG_PRINT_NOTIFY );
}
smb_connections--;
@@ -1194,12 +1194,6 @@ static void receive_notify2_message_list(int msg_type, pid_t src, void *msg, siz
notify2_unpack_msg( &notify, &msg_tv, msg_ptr, msg_len );
msg_ptr += msg_len;
- /* we don't know if the change was from us or not so kill
- any cached printer objects */
-
- if ( notify.type == PRINTER_NOTIFY_TYPE )
- invalidate_printer_hnd_cache( notify.printer );
-
/* add to correct list in container */
notify_msg_ctr_addmsg( &messages, &notify );
@@ -1227,6 +1221,22 @@ static void receive_notify2_message_list(int msg_type, pid_t src, void *msg, siz
}
/********************************************************************
+ callback to MSG_PRINTER_CHANGED. When a printer is changed by
+ one smbd, all of processes must clear their printer cache immediately.
+ ********************************************************************/
+
+void receive_printer_mod_msg(int msg_type, pid_t src, void *buf, size_t len)
+{
+ fstring printername;
+
+ fstrcpy( printername, buf );
+
+ DEBUG(10,("receive_printer_mod_msg: Printer change [%s]\n", printername ));
+
+ invalidate_printer_hnd_cache( printername );
+}
+
+/********************************************************************
Send a message to ourself about new driver being installed
so we can upgrade the information for each printer bound to this
driver
@@ -2641,7 +2651,7 @@ static BOOL srv_spoolss_replyopenprinter(int snum, const char *printer,
message_register(MSG_PRINTER_NOTIFY2, receive_notify2_message_list);
/* Tell the connections db we're now interested in printer
* notify messages. */
- register_message_flags( True, FLAG_MSG_PRINTING );
+ register_message_flags( True, FLAG_MSG_PRINT_NOTIFY );
}
/*