summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-03-16 17:06:11 +0000
committerGerald Carter <jerry@samba.org>2004-03-16 17:06:11 +0000
commitdbb38cc6b5829d9ac45e3dea40878039edd26f8d (patch)
treef3bdb1122d32cc73766682a97c13b66f02abf561 /source3/printing
parentd24b8a2032a2e92d954781e610ab535361fefd88 (diff)
downloadsamba-dbb38cc6b5829d9ac45e3dea40878039edd26f8d.tar.gz
samba-dbb38cc6b5829d9ac45e3dea40878039edd26f8d.tar.bz2
samba-dbb38cc6b5829d9ac45e3dea40878039edd26f8d.zip
merging print change notify fix from HP appliance. Also might address some one the issues in BUG 1007
(This used to be commit 17ecea4152fb0883acde675b01f19d3e19ff1d64)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/printing.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index ed19c01f24..e4ef1f52d0 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -534,8 +534,22 @@ static BOOL pjob_store(int snum, uint32 jobid, struct printjob *pjob)
/* Send notify updates for what has changed */
- if ( ret && (old_data.dsize == 0 || old_data.dsize == sizeof(*pjob)) )
- pjob_store_notify( snum, jobid, (struct printjob *)old_data.dptr, pjob );
+ if ( ret ) {
+ struct printjob old_pjob;
+
+ if ( old_data.dsize )
+ {
+ if ( unpack_pjob( old_data.dptr, old_data.dsize, &old_pjob ) != -1 )
+ {
+ pjob_store_notify( snum, jobid, &old_pjob , pjob );
+ free_nt_devicemode( &old_pjob.nt_devmode );
+ }
+ }
+ else {
+ /* new job */
+ pjob_store_notify( snum, jobid, NULL, pjob );
+ }
+ }
done:
SAFE_FREE( old_data.dptr );