title missing since update [solved?]

Mario Goppold ml at goppold.net
Wed Aug 15 12:29:31 PDT 2007


Hi list,

I've looked into the source and found that the 'N' parameter  examination is missing in create_job.

With the following patch the cups-lpd sets the document-name option again:

----- snip
-- cups-1.2.7/scheduler/cups-lpd.c.orig        2007-07-08 07:22:36.686431638 +0200
+++ cups-1.2.7/scheduler/cups-lpd.c     2007-07-08 07:22:49.451229388 +0200
@@ -90,6 +90,7 @@
  */

 static int     create_job(http_t *http, const char *dest, const char *title,
+                           const char *docname,
                           const char *user, int num_options,
                           cups_option_t *options);
 static int     get_printer(http_t *http, const char *name, char *dest,
@@ -328,6 +329,7 @@
 create_job(http_t        *http,                /* I - HTTP connection */
            const char    *dest,                /* I - Destination name */
           const char    *title,        /* I - job-name */
+          const char    *docname,      /* I - Name of job file */
            const char    *user,                /* I - requesting-user-name */
           int           num_options,   /* I - Number of options for job */
           cups_option_t *options)      /* I - Options for job */
@@ -358,6 +360,11 @@
     ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name",
                  NULL, title);

+  if (docname)
+    ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "document-name",
+                 NULL, docname);
+
+
   cupsEncodeOptions(request, num_options, options);

  /*
@@ -1144,6 +1151,7 @@

       title[0] = '\0';
       user[0]  = '\0';
+      docname[0] = '\0';
       doccount = 0;

       while (smart_gets(line, sizeof(line), fp) != NULL)
@@ -1158,6 +1166,10 @@
              strlcpy(title, line + 1, sizeof(title));
              break;

+          case 'N' : /* Document name */
+              strlcpy(docname, line + 1, sizeof(docname));
+              break;
+
          case 'P' : /* User identification */
              strlcpy(user, line + 1, sizeof(user));
              break;
@@ -1221,7 +1233,7 @@
       * Create the job...
       */

-      if ((id = create_job(http, dest, title, user, num_options, options)) < 0)
+      if ((id = create_job(http, dest, title, docname, user, num_options, options)) < 0)
         status = 1;
       else
       {
---- snip


Any opinions about the patch and is it possible to apply it in the original source (maybe to 1.3.0 to, it applied with some offsets)?

Mario




More information about the cups mailing list