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

The scheduler never gets the MIME type based on the document name for a single file job #3055

Closed
michaelrsweet opened this issue Jan 9, 2009 · 3 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.3-current
CUPS.org User: opher

Please look at scheduler/ipp.c line 7637:
doc_name = ippFindAttribute(con->request, "document-name", IPP_TAG_NAME);
filetype = mimeFileType(MimeDatabase, con->filename,
doc_name ? doc_name->values[0].string.text : NULL,
&compression);

The scheduler is looking for an attribute "document-name", BUT the client ONLY sends this attribute when printing more than one file per job:
in cups/util.c this attribute is sent in cupsPrintFiles2 ONLY when num_files > 1 .

Suggested patch attached.

Regards,
Opher Shachar.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

(This actually was already fixed by the API changes in CUPS 1.4)

@michaelrsweet
Copy link
Collaborator Author

"document-name.patch":

This patch file was generated by NetBeans IDE

Following Index: paths are relative to: H:\My Documents\Projects\CUPS\cups-1.3.x\cups

This patch can be applied using context Tools: Patch action on respective folder.

It uses platform neutral UTF-8 encoding and \n newlines.

Above lines and this line are ignored by the patching process.

Index: util.c
--- util.c Base (BASE)
+++ util.c Locally Modified (Based On LOCAL)
@@ -1253,6 +1253,21 @@
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
title);

  • if (num_files == 1)
  • {
  • /*
    
  •  \* Add the original document filename...
    
  •  */
    
  •  if ((base = strrchr(files[0], '/')) != NULL)
    
  •    base ++;
    
  •  else
    
  •    base = files[0];
    
  •  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "document-name",
    
  •               NULL, base);
    
  • }

/*

  • Then add all options...
    */

@michaelrsweet
Copy link
Collaborator Author

"str3055.patch":

Index: cups/util.c

--- cups/util.c (revision 8218)
+++ cups/util.c (working copy)
@@ -1253,6 +1253,21 @@
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
title);

  • if (num_files == 1)
  • {
  • /*
  • * Add the original document filename...
  • */
  • if ((base = strrchr(files[0], '/')) != NULL)
  •  base ++;
    
  • else
  •  base = files[0];
    
  • ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "document-name",
  •    NULL, base);
    
  • }

/*

  • Then add all options...
    */

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