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

printer-state-message not tracked for remote jobs #2109

Closed
michaelrsweet opened this issue Nov 20, 2006 · 4 comments

Comments

Projects
None yet
1 participant
@michaelrsweet
Copy link
Collaborator

commented Nov 20, 2006

Version: 1.3-feature
CUPS.org User: twaugh.redhat

The ipp backend does not retrieve the printer-state-message attribute from the remote printer. This means important messages (such as out of paper) can get missed.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

commented Dec 6, 2006

CUPS.org User: mike

Pushing to CUPS 1.3 as a feature request...

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 3, 2007

CUPS.org User: twaugh.redhat

Also means that there's no indication of something being wrong if, for example, an LPD host is down completely. i.e. IPP client -> IPP server -> LPD host (down). IPP client reports it's waiting for the job to finish, but the IPP server reports that it's continually retrying to connect.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 2, 2007

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 2, 2007

"str2109.patch":

Index: ipp.c

--- ipp.c (revision 6431)
+++ ipp.c (working copy)
@@ -150,6 +150,7 @@
"document-format-supported",
"printer-is-accepting-jobs",
"printer-state",

  •     "printer-state-message",
      "printer-state-reasons",
    };
    
    static const char * const jattrs[] =
    @@ -1286,6 +1287,11 @@
    {
    ipp_t request, / IPP request /
    *response; /
    IPP response */
  • static const char * const attrs[] = /* Attributes we want */
  • {
  • "printer-state-message",
  • "printer-state-reasons"
  • };

/*
@@ -1302,8 +1308,9 @@
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);

  • ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,

  •           "requested-attributes", NULL, "printer-state-reasons");
    
  • ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,

  •            "requested-attributes",
    
  •   (int)(sizeof(attrs) / sizeof(attrs[0])), NULL, attrs);
    

    /*

    • Do the request...
      @@ -1437,7 +1444,8 @@
      {
      int i; /* Looping var /
      int count; /
      Count of reasons shown... */
  • ipp_attribute_t reasons; / printer-state-reasons */

  • ipp_attribute_t psm, / pritner-state-message */

  •       *reasons;   /* printer-state-reasons */
    

    const char reason; / Current reason /
    const char *message; /
    Message to show /
    char unknown[1024]; /
    Unknown message string /
    @@ -1445,6 +1453,10 @@
    char state[1024]; /
    State string */

  • if ((psm = ippFindAttribute(ipp, "printer-state-message",

  •                          IPP_TAG_TEXT)) != NULL)
    
  • fprintf(stderr, "INFO: %s\n", psm->values[0].string.text);

if ((reasons = ippFindAttribute(ipp, "printer-state-reasons",
IPP_TAG_KEYWORD)) == NULL)
return (0);

@michaelrsweet michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.