ipp.c

John A. Murdie john at cs.york.ac.uk
Thu Aug 18 09:56:36 PDT 2005


There's some code in ipp.c (CUPS 1.1.23) whose intent I'd like to understand:

835    if (ipp_status <= IPP_OK_CONFLICT && argc > 6)
836    {
837      fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
838      copies --;
839    }
840    else if (ipp_status != IPP_SERVICE_UNAVAILABLE &&
841             ipp_status != IPP_PRINTER_BUSY)
842      break;
843
844   /*
845    * Wait for the job to complete...
846    */
847
848    if (!job_id || !waitjob)
849      continue;
850
851    fputs("INFO: Waiting for job to complete...\n", stderr);
852
853    for (;;)
854    {
855     /*
856      * Build an IPP_GET_JOB_ATTRIBUTES request...

The usual situation is for ipp_status to be IPP_OK, which is less than all other IPP_* values. argc is 6 if no filename has been supplied to ipp, and 7 if it has. The former seems to be the case every time I've tried it. So if the job is successful no PAGE status message gets written, and the 'break' at line 842 is taken, which causes the 'while (copies > 0)' loop (at line 685, not shown above) to be exited. No IPP_GET_JOB_ATTRIBUTES request is sent to the printer.

Why is 'copies' only decremented if 'ipp' is supplied with a filename (7th argument) - line 835? There's only the one explicit decrement of copies in the 'while (copies > 0)' loop - at line 836.

(Also, I note that INFO messages are added to the 'Printer History', and not to the CUPS error_log file. Where is the 'Printer History' log kept, and how can I see its accumulated contents?)

My ipp-sent jobs print ok on HP and Lexmark printers, btw, so all is not doom and gloom!




More information about the cups mailing list