summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-04-04 01:02:20 +0000
committerJeremy Allison <jra@samba.org>2003-04-04 01:02:20 +0000
commit7991cf1e52f777c728f00809d5afcfccefe16e09 (patch)
treec13ddc6295eb118b59eaddc35a949e7b1628673d /source3
parente655dc297b6dfa381748c1c6b990781af46457c1 (diff)
downloadsamba-7991cf1e52f777c728f00809d5afcfccefe16e09.tar.gz
samba-7991cf1e52f777c728f00809d5afcfccefe16e09.tar.bz2
samba-7991cf1e52f777c728f00809d5afcfccefe16e09.zip
Fix the new storage code to correctly convert from system queue info to
pjob info. Ensure we retrieve more than one job from the storage code. Jeremy. (This used to be commit 59be98401c5a8b419597c18acbe996b469bbe89a)
Diffstat (limited to 'source3')
-rw-r--r--source3/printing/printing.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 39fb48ae17..e788645306 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -713,9 +713,20 @@ static int traverse_fn_delete(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void
pjob_delete(ts->snum, jobid);
} else
ts->total_jobs++;
+ return 0;
}
- else
- ts->total_jobs++;
+
+ /* Save the pjob attributes we will store. */
+ ts->queue[i].job = jobid;
+ ts->queue[i].size = pjob.size;
+ ts->queue[i].page_count = pjob.page_count;
+ ts->queue[i].status = pjob.status;
+ ts->queue[i].priority = 1;
+ ts->queue[i].time = pjob.starttime;
+ fstrcpy(ts->queue[i].fs_user, pjob.user);
+ fstrcpy(ts->queue[i].fs_file, pjob.jobname);
+
+ ts->total_jobs++;
return 0;
}
@@ -2088,6 +2099,7 @@ static BOOL get_stored_queue_info(struct tdb_print_db *pdb, int snum, int *pcoun
uint32 qcount = 0;
uint32 extra_count = 0;
int total_count = 0;
+ size_t len = 0;
uint32 i;
int max_reported_jobs = lp_max_reported_jobs(snum);
BOOL ret = False;
@@ -2130,8 +2142,8 @@ static BOOL get_stored_queue_info(struct tdb_print_db *pdb, int snum, int *pcoun
goto out;
/* Retrieve the linearised queue data. */
+ len = 0;
for( i = 0; i < qcount; i++) {
- size_t len = 0;
uint32 qjob, qsize, qpage_count, qstatus, qpriority, qtime;
len += tdb_unpack(data.dptr + 4 + len, data.dsize - len, NULL, "ddddddff",
&qjob,