diff options
author | Gerald Carter <jerry@samba.org> | 2004-03-16 17:07:18 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2004-03-16 17:07:18 +0000 |
commit | b1d5261bde86abdd90701897ebc2d03211b65c33 (patch) | |
tree | e3291d233538eb1f9dd2d41d97625644dc14c0ee /source3/printing/printing.c | |
parent | 1df61db0720b0d5372ffb43cf2fd60d72e438728 (diff) | |
download | samba-b1d5261bde86abdd90701897ebc2d03211b65c33.tar.gz samba-b1d5261bde86abdd90701897ebc2d03211b65c33.tar.bz2 samba-b1d5261bde86abdd90701897ebc2d03211b65c33.zip |
merging print change notify fix from HP appliance. Also might address some one the issues in BUG 1007
(This used to be commit b80e3553bf1b7f8d1435f3144082577f2e30c3a9)
Diffstat (limited to 'source3/printing/printing.c')
-rw-r--r-- | source3/printing/printing.c | 18 |
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 ); |