Repository navigation
Conversation
…ing#1833) send_document() did not check the job state. A document sent to a canceled, aborted or completed job was accepted, and the job was started again. A document sent to a processing job moved it back to held, so it printed twice. Return client-error-not-possible in both cases.
masanta-s
force-pushed
the
fix-1833-send-document-state
branch
from
November 29, 2026 10:24
5ad6a46 to
c3766bf
Compare
michaelrsweet
requested changes
Nov 29, 2026
michaelrsweet
left a comment
Member
There was a problem hiding this comment.
See comments.
Also, please do not add the additional IPP test.
| * See if the job can still accept documents (Issue #1833)... | ||
| */ | ||
|
|
||
| if (job->state_value > IPP_JSTATE_STOPPED) |
Member
There was a problem hiding this comment.
This should be > IPP_JSTATE_HELD. You can't add documents after the job has started processing.
| */ | ||
|
|
||
| send_ipp_status(con, IPP_STATUS_ERROR_NOT_POSSIBLE, | ||
| _("Job #%d is finished and cannot be altered."), jobid); |
| _("Job #%d is finished and cannot be altered."), jobid); | ||
| return; | ||
| } | ||
| else if (job->state_value == IPP_JSTATE_PROCESSING) |
Member
There was a problem hiding this comment.
This doesn't get a different error - pending and pending-held jobs are "open", any other state is "closed".
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1833
send_document()did not check the job state before it added the file. So a document sent to a canceled, aborted or completed job was accepted, and the job was started again. A document sent to a job that was already processing moved it back topending-held, so it printed a second time.Fix: right after the owner check,
send_document()now returnsclient-error-not-possible:hold_job().Stopped jobs keep their current handling.
Test: I added "Send Document to Canceled Job" to
test/4.3-job-ops.test. I also raised the expected request and error counts inrun-stp-tests.shby one each, for the new request and its error line.Verified on Ubuntu 24.04:
successful-okand set the job topending-held. Send-Document to a completed job also returnedsuccessful-ok.client-error-not-possible. A normal Create-Job with two Send-Document requests still works.run-stp-tests.sh 1passes. The only new error line is the rejected Send-Document.