From dbb38cc6b5829d9ac45e3dea40878039edd26f8d Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 16 Mar 2004 17:06:11 +0000 Subject: merging print change notify fix from HP appliance. Also might address some one the issues in BUG 1007 (This used to be commit 17ecea4152fb0883acde675b01f19d3e19ff1d64) --- source3/printing/printing.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'source3/printing/printing.c') 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 ); -- cgit