Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

IPP Backend will not print multiple copies of raw files #2518

Closed

Description

@michaelrsweet

Version: 1.2.12
CUPS.org User: angelb.bugarin

The IPP backend is broken in CUPS 1.2.12. It worked fine in CUPS 1.2.4

When I used the IPP backend from 1.2.4 into a running CUPS 1.2.12, the
number of copies is printed correctly.

Looking at the log, I noticed the client is sending 3 copies but the
Server only sees 1.

Thanks,
Angel

Activity

  1. michaelrsweet commented on Sep 17, 2007

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: angelb.bugarin

    Sorry, I don't mind sharing this STR to the public but since I've included a sample output of our log file, be it from test, it contains
    some pertinent info.

    It can be published once there's a solution to this. I can then remove
    the sample out.

    Thanks!
    Angel

  2. michaelrsweet commented on Sep 17, 2007

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: mike

    I've hidden the file you attached and made the bug visible...

    As for the bug itself, I've traced this back to a fix we made for Xerox printers. Basically, some of their printers override the copy count in the PDL and some don't, leading to N^2 copies getting printed on the ones that don't.

  3. michaelrsweet commented on Sep 17, 2007

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: mike

    The original bug leading to this issue was STR #2349:

    http://www.cups.org/str.php?L2349
    
  4. michaelrsweet commented on Sep 17, 2007

    @michaelrsweet
    ContributorAuthor

    CUPS.org User: mike

    Fixed in Subversion repository.

  5. michaelrsweet commented on Sep 17, 2007

    @michaelrsweet
    ContributorAuthor

    "str2518.patch":

    Index: ipp.c

    --- ipp.c (revision 6965)
    +++ ipp.c (working copy)
    @@ -132,7 +132,8 @@
    ipp_attribute_t printer_accepting; / printer-is-accepting-jobs /
    int copies, /
    Number of copies for job /
    copies_remaining; /
    Number of copies remaining */

    • const char content_type; / CONTENT_TYPE environment variable */

    • const char content_type, / CONTENT_TYPE environment variable */

    •   *final_content_type;    /* FINAL_CONTENT_TYPE environment var */
      

      #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
      struct sigaction action; /* Actions for POSIX signals /
      #endif /
      HAVE_SIGACTION && !HAVE_SIGSET */
      @@ -209,13 +210,17 @@

      • Get the (final) content type...
        */
    • if ((content_type = getenv("FINAL_CONTENT_TYPE")) == NULL)

    • if ((content_type = getenv("CONTENT_TYPE")) == NULL)

    •  content_type = "application/octet-stream";
      
    • if ((content_type = getenv("CONTENT_TYPE")) == NULL)

    • content_type = "application/octet-stream";

    • if (!strncmp(content_type, "printer/", 8))

    • content_type = "application/vnd.cups-raw";

    • if ((final_content_type = getenv("FINAL_CONTENT_TYPE")) == NULL)

    • {

    • final_content_type = content_type;

    • if (!strncmp(final_content_type, "printer/", 8))

    •  final_content_type = "application/vnd.cups-raw";
      
    • }

    /*

    • Extract the hostname and printer name from the URI...
      */
      @@ -426,10 +431,9 @@
      • Point to the single file from stdin...
        */
    • filename = tmpfilename;
    • files = &filename;

    - num_files = 1;

    • filename = tmpfilename;
    • num_files = 1;
    • files = &filename;
      send_options = 0;
      }
      else
      @@ -438,11 +442,10 @@
    • Point to the files on the command-line...
      */
    • num_files = argc - 6;
    • files = argv + 6;
    • num_files = argc - 6;
    • files = argv + 6;
    • send_options = 1;

    - send_options = strncasecmp(content_type, "application/vnd.cups-", 21) != 0;

    #ifdef HAVE_LIBZ
    if (compression)
    compress_files(num_files, files);
    @@ -859,8 +862,7 @@
    num_options = cupsParseOptions(argv[5], 0, &options);

    #ifdef APPLE

    • if (content_type != NULL &&

    •    !strcasecmp(content_type, "application/pictwps") && num_files == 1)
      
    • if (!strcasecmp(content_type, "application/pictwps") && num_files == 1)
      {
      if (format_sup != NULL)
      {
      @@ -886,23 +888,23 @@

    • number of copies to 1...
      */

    • content_type = "application/postscript";

    • copies = 1;

    • copies_remaining = 1;

    •    send_options     = 0;
      
    • final_content_type = "application/postscript";

    • copies = 1;

    • copies_remaining = 1;

    •    send_options       = 0;
      

      }
      }
      #endif /* APPLE */

    • if (content_type != NULL && format_sup != NULL)

    • if (format_sup != NULL)
      {
      for (i = 0; i < format_sup->num_values; i ++)

    •    if (!strcasecmp(content_type, format_sup->values[i].string.text))
      
    •    if (!strcasecmp(final_content_type, format_sup->values[i].string.text))
         break;
      

      if (i < format_sup->num_values)
      ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,

    •            "document-format", NULL, content_type);
      
    •            "document-format", NULL, final_content_type);
      

      }

      if (copies_sup && version > 0 && send_options)

  6. added this to the Stable milestone on Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions