]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The LPD mini-daemon did not handle the document-format option
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 12 Mar 2007 14:32:10 +0000 (14:32 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 12 Mar 2007 14:32:10 +0000 (14:32 +0000)
correctly (STR #2266)

scheduler/cups-lpd.c:
    - print_file(): Add format argument.
    - recv_print_job(): Pass document-format option to
      print_file().

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@6327 7a7537e8-13f0-0310-91df-b6672ffda945

scheduler/cups-lpd.c

index 5d2bc7c3458f2363850cff23cd15f3b7492ffc56..5aa0afd3f9b673e85392e0372ad6c47fde13c392 100644 (file)
@@ -96,7 +96,8 @@ static int    get_printer(http_t *http, const char *name, char *dest,
                            int destsize, cups_option_t **options,
                            int *accepting, int *shared, ipp_pstate_t *state);
 static int     print_file(http_t *http, int id, const char *filename,
-                          const char *docname, const char *user, int last);
+                          const char *docname, const char *user,
+                          const char *format, int last);
 static int     recv_print_job(const char *name, int num_defaults,
                               cups_option_t *defaults);
 static int     remove_jobs(const char *name, const char *agent,
@@ -824,6 +825,7 @@ print_file(http_t     *http,                /* I - HTTP connection */
           const char *filename,        /* I - File to print */
            const char *docname,                /* I - document-name */
           const char *user,            /* I - requesting-user-name */
+          const char *format,          /* I - document-format */
           int        last)             /* I - 1 = last file in job */
 {
   ipp_t                *request;               /* IPP request */
@@ -846,6 +848,10 @@ print_file(http_t     *http,               /* I - HTTP connection */
     ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
                 "document-name", NULL, docname);
 
+  if (format)
+    ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
+                 "document-format", NULL, format);
+
   if (last)
     ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", 1);
 
@@ -1278,6 +1284,8 @@ recv_print_job(
                docnumber ++;
 
                if (print_file(http, id, temp[i], docname, user,
+                              cupsGetOption("document-format", num_options,
+                                            options),
                               docnumber == doccount))
                   status = 1;
                else