Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPP conformance: Send-Document with no data #3514

Closed
michaelrsweet opened this issue Mar 1, 2010 · 1 comment
Closed

IPP conformance: Send-Document with no data #3514

michaelrsweet opened this issue Mar 1, 2010 · 1 comment

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.4-current
CUPS.org User: mike

Per RFC 2911 section 3.3.2, Send-Document with no document data and "last-document" set to true must be allowed:

This OPTIONAL operation is identical to the Send-Document operation
(see section 3.3.1) except that a client MUST supply a URI reference
("document-uri" operation attribute) rather than the document data
itself. If a Printer object supports this operation, clients can use
both Send-URI or Send-Document operations to add new documents to an
existing multi-document Job object. However, if a client needs to
indicate that the previous Send-URI or Send-Document was the last
document, the client MUST use the Send-Document operation with no
document data and the "last-document" flag set to 'true' (rather than
using a Send-URI operation with no "document-uri" operation
attribute).

Currently we error out if there is no document data. We should be only erroring out if there are no other files are in the job already.

@michaelrsweet
Copy link
Collaborator Author

"str3514.patch":

Index: scheduler/ipp.c

--- scheduler/ipp.c (revision 9099)
+++ scheduler/ipp.c (working copy)
@@ -10223,6 +10223,17 @@

if (!con->filename)
{

  • /*
  • * Check for an empty request with "last-document" set to true, which is
  • * used to close an "open" job by RFC 2911, section 3.3.2.
  • */
  • if (job->num_files > 0 &&

  •    (attr = ippFindAttribute(con->request, "last-document",
    
  •                        IPP_TAG_BOOLEAN)) != NULL &&
    
  •    attr->values[0].boolean)
    
  •  goto last_document;
    

    send_ipp_status(con, IPP_BAD_REQUEST, _("No file!?"));
    return;
    }
    @@ -10379,6 +10390,8 @@

    • Start the job if this is the last document...
      */
  • last_document:

if ((attr = ippFindAttribute(con->request, "last-document",
IPP_TAG_BOOLEAN)) != NULL &&
attr->values[0].boolean)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant