Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1196730 - DNSSD TXT record doesn't include rejecting flag
Summary: DNSSD TXT record doesn't include rejecting flag
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: cups
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-26 15:52 UTC by Marek Kašík
Modified: 2015-02-27 16:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-27 16:39:40 UTC
Type: Bug


Attachments (Terms of Use)
Store CUPS_PRINTER_REJECTING also in "Type" field in printers.conf (557 bytes, patch)
2015-02-26 15:52 UTC, Marek Kašík
no flags Details | Diff
Store CUPS_PRINTER_REJECTING also in "Type" field in printers.conf (653 bytes, patch)
2015-02-26 17:27 UTC, Marek Kašík
no flags Details | Diff
Git-format patch against master (1000 bytes, patch)
2015-02-27 10:00 UTC, Tim Waugh
no flags Details | Diff
Git-format patch against master (1.96 KB, patch)
2015-02-27 13:54 UTC, Tim Waugh
no flags Details | Diff
Git-format patch against master (1.96 KB, patch)
2015-02-27 15:18 UTC, Tim Waugh
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
CUPS Bugs and Features 4594 0 None None None Never

Description Marek Kašík 2015-02-26 15:52:59 UTC
Created attachment 995675 [details]
Store CUPS_PRINTER_REJECTING also in "Type" field in printers.conf

Description of problem:
CUPS doesn't set CUPS_PRINTER_REJECTING flag in "printer-type" TXT record. This flag is important if we want to avoid waking up all printers just to know their state.


Version-Release number of selected component (if applicable):
cups-1.7.5-15.fc21


How reproducible:
Always


Steps to Reproduce:
1. Set sharing of a printer over dnssd
2. cupsreject the-printer
3. look at printer-type TXT record of the printer


Actual results:
CUPS_PRINTER_REJECTING is not set


Expected results:
CUPS_PRINTER_REJECTING is set


Additional info:
It would help to finish fixing of this bug: https://bugzilla.gnome.org/show_bug.cgi?id=743323.

Comment 1 Marek Kašík 2015-02-26 17:27:00 UTC
Created attachment 995703 [details]
Store CUPS_PRINTER_REJECTING also in "Type" field in printers.conf

This patch works better because the original type is still stored somewhere when I set the printer to accept jobs again.
It results in Accepting set to "Yes" and Type with the CUPS_PRINTER_REJECTING flag still set without this patch.

Comment 2 Tim Waugh 2015-02-27 10:00:14 UTC
Created attachment 995960 [details]
Git-format patch against master

I think you mean something like this. The printers.conf file already stores the accepting state for each printer, and when constructing printer-type for IPP attributes the Type field is combined with the Accepting field. It wasn't happening when constructing printer-type for the DNS-SD TXT record though.

Comment 3 Marek Kašík 2015-02-27 12:15:26 UTC
(In reply to Tim Waugh from comment #2)
> Created attachment 995960 [details]
> Git-format patch against master
> 
> I think you mean something like this. The printers.conf file already stores
> the accepting state for each printer, and when constructing printer-type for
> IPP attributes the Type field is combined with the Accepting field. It
> wasn't happening when constructing printer-type for the DNS-SD TXT record
> though.

Thank you, yes this is better solution.
Just one observation, if I call "cupsreject/cupsaccept", the TXT record is not changed immediately so I run "cupsenable/cupsdisable" to ensure that the change is propagated to the TXT record. Would it be possible to update the TXT record when the accepting state changes?

Comment 4 Tim Waugh 2015-02-27 13:54:01 UTC
Created attachment 996048 [details]
Git-format patch against master

Try this.

Comment 5 Marek Kašík 2015-02-27 15:05:35 UTC
Unfortunately, CUPS doesn't update the TXT record immediately with the patch.

Comment 6 Marek Kašík 2015-02-27 15:12:50 UTC
We probably need to do something like cupsdSetPrinterState() does here:

  if (update)
    cupsdRegisterPrinter(p);

which calls dnssdRegisterPrinter() which calls the dnssdBuildTxtRecord().

Comment 7 Tim Waugh 2015-02-27 15:18:55 UTC
Created attachment 996090 [details]
Git-format patch against master

Ah, yes. OK, how about this one?

Comment 8 Marek Kašík 2015-02-27 15:29:47 UTC
(In reply to Tim Waugh from comment #7)
> Created attachment 996090 [details]
> Git-format patch against master
> 
> Ah, yes. OK, how about this one?

Yes, this patch updates the rejecting flag immediately. Thank you very much.

Comment 9 Tim Waugh 2015-02-27 16:39:40 UTC
Rejected upstream.


Note You need to log in before you can comment on or make changes to this bug.