MCPcopy Create free account
hub / github.com/OpenPrinting/cups / cupsdTimeoutJob

Function cupsdTimeoutJob

scheduler/ipp.c:643–680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641 */
642
643int /* O - 0 on success, -1 on error */
644cupsdTimeoutJob(cupsd_job_t *job) /* I - Job to timeout */
645{
646 cupsd_printer_t *printer; /* Destination printer or class */
647 ipp_attribute_t *attr; /* job-sheets attribute */
648 int kbytes; /* Kilobytes in banner */
649
650
651 job->pending_timeout = 0;
652
653 /*
654 * See if we need to add the ending sheet...
655 */
656
657 if (!cupsdLoadJob(job))
658 return (-1);
659
660 printer = cupsdFindDest(job->dest);
661 attr = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_NAME);
662
663 if (printer && !(printer->type & CUPS_PRINTER_REMOTE) &&
664 attr && attr->num_values > 1)
665 {
666 /*
667 * Yes...
668 */
669
670 cupsdLogJob(job, CUPSD_LOG_INFO, "Adding end banner page \"%s\".",
671 attr->values[1].string.text);
672
673 if ((kbytes = copy_banner(NULL, job, attr->values[1].string.text)) < 0)
674 return (-1);
675
676 cupsdUpdateQuota(printer, job->username, 0, kbytes);
677 }
678
679 return (0);
680}
681
682
683/*

Callers 5

close_jobFunction · 0.85
print_jobFunction · 0.85
send_documentFunction · 0.85
cupsdCheckJobsFunction · 0.85
cupsdReleaseJobFunction · 0.85

Calls 6

cupsdLoadJobFunction · 0.85
cupsdFindDestFunction · 0.85
ippFindAttributeFunction · 0.85
cupsdLogJobFunction · 0.85
copy_bannerFunction · 0.85
cupsdUpdateQuotaFunction · 0.85

Tested by

no test coverage detected