From f13db65e418088b461867d7800b2cbf8df9adbbe Mon Sep 17 00:00:00 2001 From: msweet Date: Thu, 10 Mar 2016 17:23:01 +0000 Subject: [PATCH] The IPP backend now continues on to the next job when the remote server/printer puts the job on hold () A 30 second delay (currently not configurable) is provided to allow for canceling the job locally. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@13133 a1ca3aef-8c08-0410-bb20-df032aa958be --- CHANGES.txt | 2 ++ backend/ipp.c | 18 +++++++----------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index eee94d126..7c1fac33c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,6 +3,8 @@ CHANGES.txt - 2.2b1 - 2016-03-10 CHANGES IN CUPS V2.2b1 + - The IPP backend now continues on to the next job when the remote + server/printer puts the job on hold () - The scheduler did not cancel multi-document jobs immediately () - The scheduler did not return non-shared printers to local clients diff --git a/backend/ipp.c b/backend/ipp.c index 44bbd0c9e..69aa69453 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -1,9 +1,7 @@ /* - * "$Id$" - * * IPP backend for CUPS. * - * Copyright 2007-2015 by Apple Inc. + * Copyright 2007-2016 by Apple Inc. * Copyright 1997-2007 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the @@ -238,9 +236,10 @@ main(int argc, /* I - Number of command-line args */ int delay, /* Delay for retries */ prev_delay; /* Previous delay */ const char *compression; /* Compression mode */ - int waitjob, /* Wait for job complete? */ + int waitjob, /* Wait for job complete? */ waitjob_tries = 0, /* Number of times we've waited */ waitprinter; /* Wait for printer ready? */ + time_t waittime; /* Wait time for held jobs */ _cups_monitor_t monitor; /* Monitoring data */ ipp_attribute_t *job_id_attr; /* job-id attribute */ int job_id; /* job-id value */ @@ -1968,7 +1967,7 @@ main(int argc, /* I - Number of command-line args */ _cupsLangPrintFilter(stderr, "INFO", _("Waiting for job to complete.")); - for (delay = _cupsNextDelay(0, &prev_delay); !job_canceled;) + for (delay = _cupsNextDelay(0, &prev_delay), waittime = time(NULL) + 30; !job_canceled;) { /* * Check for side-channel requests... @@ -2079,10 +2078,11 @@ main(int argc, /* I - Number of command-line args */ job_sheets->values[0].integer); /* - * Stop polling if the job is finished or pending-held... + * Stop polling if the job is finished or pending-held for 30 seconds... */ - if (job_state->values[0].integer > IPP_JOB_STOPPED) + if (job_state->values[0].integer > IPP_JSTATE_STOPPED || + (job_state->values[0].integer == IPP_JSTATE_HELD && time(NULL) > waittime)) { ippDelete(response); break; @@ -3541,7 +3541,3 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */ else if (rem[0]) fprintf(stderr, "%s\n", rem); } - -/* - * End of "$Id$". - */ -- 2.39.2