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! |