Prev · NextSTR #3199: cups-lpd receives print file before establishing it can create a job on the cupsd

Status:4 - Pending
Priority:1 - Request for Enhancement, e.g. asking for a feature
Scope:3 - Applies to all machines and operating systems
Subsystem:LPD Mini-Daemon
Summary:cups-lpd receives print file before establishing it can create a job on the cupsd
Version: -feature
Created By:seb
Assigned To:mike
Fix Version:Unassigned
Update Notification:

Receive EMails Don't Receive EMails


Trouble Report Files:

Name/Time/Date/Filename/Size
seb: 03:03 May 15, 2009
 
cups-lpd.create_job_before_receive_data.diff (24k)
 
seb: 03:31 May 15, 2009
 
cups-lpd_v2.create_job_before_receive_data.diff (23k)
 

Trouble Report Dialog:

Name/Time/Date/Text
seb: 03:03 May 15, 2009
 
cups-lpd.c will completely receive a print file from the lpd client and send an acknowledgement BEFORE it establishes that it can create a job on the cupsd.

If, for some reason, the cupsd fails to generate a job, then cups-lpd will exit and the print data will be lost. The client thinks it has been printed, because it was transferred to cups-lpd and an acknowledgement was received, but the print file never makes it to cupsd for printing.

I've produced a fix for this problem. Rather than receiving the print file, then sending it to the cupsd with the print_file() function, I instead create a cups job as early as possible in the process (with IPP_CREATE_JOB). If this fails, a failure acknowledgement is sent back to the lpd client before all the data has been received.

The newly created job is then held (with IPP_HOLD_JOB) so that it doesn't get auto-expired by cupsd while the print data comes in. The print data is then received by cups-lpd from the lpd client, and is sent to the cupsd with send_doc() using IPP_SEND_DOCUMENT. Finally, an IPP_RELEASE_JOB command is sent in release_job.

 
seb: 03:32 May 15, 2009
 
The second patch uploaded changes the old-style method for creating an ipp_t * request for the new style using ippNewRequest().
 
mike: 20:25 May 15, 2009
 
Pushing this to CUPS 1.5; not going to be fixed in 1.4 since we'll need to do a lot of testing before we accept this patch.
 
seb: 23:55 May 16, 2009
 
Thanks for the response Mike. Do you have a formal list of tests that you run? If so, I'd like to make some tests from the list myself. My own testing of the patch includes production printing at several diverse sites, with lpd jobs coming from a variety of different systems, definitely including Unix and Windows. In most cases we are two steps back from the customer, so I don't know of exact details of the sending computer system unless something goes wrong!