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

Scheduler doesn't pick up printer state reasons from ipp backend #745

Closed
michaelrsweet opened this issue Jun 4, 2004 · 3 comments
Closed

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.1.21rc1
CUPS.org User: mclasen.redhat

The ipp backend seems to be the only one which tries to report printer state back to the scheduler. It does so by writing lines like

STATE: toner-low-warning,developer-empty-error

to stderr. The scheduler picks that up and feeds the string to SetPrinterStateReasons(). That function seems to accept three kinds of
input:

+reason1,reason2,... for adding reasons to the set of current reasons
-reason1,reason2,... for removing reasons from the set of current reasons
reason1,reason2,... for replacing the set of current reasons

the first two seem to work fine, but the third one (which is what the
ipp backend uses) doesn't. To fix it, you have to remove the
s[0] == '+' condition from the if in printers.c:1745. Patch attached.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Thanks, will apply the patch for the 1.1.21 release.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in CVS - the anonymous CVS repository will be updated at midnight EST.

@michaelrsweet
Copy link
Collaborator Author

"state.diff":

--- cups-1.1.21rc1/scheduler/printers.c.state 2004-06-04 11:45:38.000000000 -0400
+++ cups-1.1.21rc1/scheduler/printers.c 2004-06-04 11:46:02.000000000 -0400
@@ -1742,8 +1742,7 @@
i --;
}
}

  • else if (s[0] == '+' &&
  •         p->num_reasons < (int)(sizeof(p->reasons) / sizeof(p->reasons[0])))
    
  • else if (p->num_reasons < (int)(sizeof(p->reasons) / sizeof(p->reasons[0])))
    {
    /*
  • Add reason...

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