summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-01-11 02:29:23 +0000
committerGerald Carter <jerry@samba.org>2003-01-11 02:29:23 +0000
commit47873e781d219bd523d10ca449ac0efb72daed0e (patch)
treea1cd2a9c0ca31e13b9bf378803272551de0d4836 /source3/printing
parent82b41dca9d0030cc54ef8865d4a5e5f9377c46fc (diff)
downloadsamba-47873e781d219bd523d10ca449ac0efb72daed0e.tar.gz
samba-47873e781d219bd523d10ca449ac0efb72daed0e.tar.bz2
samba-47873e781d219bd523d10ca449ac0efb72daed0e.zip
[merge] make sure to updatre print queue cache during timeout_processing() to send notify events; CR 1491
(This used to be commit 142c5029c701e7a82074e301278846c02843f46f)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/printing.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index be42664b56..5f2594f07a 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -1907,6 +1907,7 @@ static int printjob_comp(print_queue_struct *j1, print_queue_struct *j2)
/****************************************************************************
Get a printer queue listing.
+ set queue = NULL and status = NULL if you just want to update the cache
****************************************************************************/
int print_queue_status(int snum,
@@ -1917,18 +1918,26 @@ int print_queue_status(int snum,
struct traverse_count_struct tsc;
fstring keystr;
TDB_DATA data, key;
- const char *printername = lp_const_servicename(snum);
- struct tdb_print_db *pdb = get_print_db_byname(printername);
-
- *queue = NULL;
-
- if (!pdb)
- return 0;
+ const char *printername;
+ struct tdb_print_db *pdb;
/* make sure the database is up to date */
+
if (print_cache_expired(snum))
print_queue_update(snum);
+ /* return if we are done */
+
+ if ( !queue || !status )
+ return 0;
+
+ *queue = NULL;
+ printername = lp_const_servicename(snum);
+ pdb = get_print_db_byname(printername);
+
+ if (!pdb)
+ return 0;
+
/*
* Fetch the queue status. We must do this first, as there may
* be no jobs in the queue.