r1230: (merges from HP PSA) fixing a couple of caching bugs in the printing code...
authorGerald Carter <jerry@samba.org>
Wed, 23 Jun 2004 15:46:01 +0000 (15:46 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:01 +0000 (10:52 -0500)
source/printing/printing.c
source/rpc_server/srv_spoolss_nt.c

index 670e489786c7916e1df78b0789b464c2da2d3425..5814182b2587e1dcecc8c6bec2dc2b02aa9a85a6 100644 (file)
@@ -600,6 +600,7 @@ void pjob_delete(int snum, uint32 jobid)
        tdb_delete(pdb->tdb, print_key(jobid));
        release_print_db(pdb);
        rap_jobid_delete(snum, jobid);
+       remove_from_jobs_changed( snum, jobid );
 }
 
 /****************************************************************************
index a6d47a46c32552250453ab50defbd381b0d9471e..d8c6b5350c477537e63d47151b3c194b9274c71a 100644 (file)
@@ -5,7 +5,7 @@
  *  Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
  *  Copyright (C) Jean François Micouleau      1998-2000,
  *  Copyright (C) Jeremy Allison               2001-2002,
- *  Copyright (C) Gerald Carter                       2000-2003,
+ *  Copyright (C) Gerald Carter                       2000-2004,
  *  Copyright (C) Tim Potter                   2001-2002.
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -312,6 +312,7 @@ void invalidate_printer_hnd_cache( char *printername )
        for ( p=printers_list; p; p=p->next )
        {
                if ( p->printer_type==PRINTER_HANDLE_IS_PRINTER 
+                       && p->printer_info
                        && StrCaseCmp(p->dev.handlename, printername)==0)
                {
                        DEBUG(10,("invalidating printer_info cache for handl:\n"));
@@ -1188,6 +1189,12 @@ static void receive_notify2_message_list(int msg_type, pid_t src, void *msg, siz
                ZERO_STRUCT( notify );
                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 */