Skip to content

Commit

Permalink
Added new NewBrowsePollQueuesShared directive to cups-browsed
Browse files Browse the repository at this point in the history
  • Loading branch information
vikrantmalik051 committed Mar 12, 2020
1 parent 84d0b48 commit fa7ce8d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
6 changes: 6 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ NEWS - OpenPrinting CUPS Filters v1.27.2 - 2020-02-28

CHANGES IN V1.27.3

- cups-browsed: Added new "NewBrowsePollQueuesShared"
directive to cups-browsed.conf, which allows to decide
whether the print queue for an newly discovered printer
by the BrowsePoll directive will be shared or not. For
printers discovered earlier, cups-browsed remembers the
previous setting.
- foomatic-rip: PDF page count side-loads the PDF file to
count the pages in, so it cannot be run in -dSAFER mode. Run
even in -dNOSAFER mode to override the -dSAFER default of
Expand Down
14 changes: 14 additions & 0 deletions utils/cups-browsed.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ static unsigned int BrowseInterval = 60;
static unsigned int BrowseTimeout = 300;
static uint16_t BrowsePort = 631;
static browsepoll_t **BrowsePoll = NULL;
static unsigned int NewBrowsePollQueuesShared = 0;
static size_t NumBrowsePoll = 0;
static guint update_netifs_sourceid = 0;
static char local_server_str[1024];
Expand Down Expand Up @@ -10712,6 +10713,12 @@ browse_poll_get_printers (browsepoll_t *context, http_t *conn)
found_cups_printer (context->server, uri, location, info);
printer = new_browsepoll_printer (uri, location, info);
printers = g_list_insert (printers, printer, 0);
if (NewBrowsePollQueuesShared) {
int num_options = 0;
num_options = cupsAddOption("printer-is-shared", "true",
num_options, NULL);
debug_printf("Setting printer-is-shared bit.\n");
}
}

if (!attr)
Expand Down Expand Up @@ -11587,6 +11594,13 @@ read_configuration (const char *filename)
else if (!strcasecmp(value, "no") || !strcasecmp(value, "false") ||
!strcasecmp(value, "off") || !strcasecmp(value, "0"))
NewIPPPrinterQueuesShared = 0;
} else if (!strcasecmp(line, "NewBrowsePollQueuesShared") && value) {
if (!strcasecmp(value, "yes") || !strcasecmp(value, "true") ||
!strcasecmp(value, "on") || !strcasecmp(value, "1"))
NewBrowsePollQueuesShared = 1;
else if (!strcasecmp(value, "no") || !strcasecmp(value, "false") ||
!strcasecmp(value, "off") || !strcasecmp(value, "0"))
NewBrowsePollQueuesShared = 0;
} else if (!strcasecmp(line, "AutoClustering") && value) {
if (!strcasecmp(value, "yes") || !strcasecmp(value, "true") ||
!strcasecmp(value, "on") || !strcasecmp(value, "1"))
Expand Down
14 changes: 14 additions & 0 deletions utils/cups-browsed.conf.5
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,20 @@ this timeout if no further broadcast from the server happens.
.fam C
BrowseTimeout 300

.fam T
.fi
The NewBrowsePollQueuesShared directive determines whether a print
queue for a newly discovered printer (discovered by the BrowsePoll directive)
will be shared to the local network or not. This is only
valid for newly discovered printers. For printers discovered in an
earlier cups-browsed session, cups-browsed will remember whether the
printer was shared, so changes by the user get conserved. Default is
not to share newly discovered printers.
.PP
.nf
.fam C
NewBrowsePollQueuesShared Yes

.fam T
.fi
Set OnlyUnsupportedByCUPS to "Yes" will make cups-browsed not create
Expand Down
9 changes: 9 additions & 0 deletions utils/cups-browsed.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@ BrowseRemoteProtocols @BROWSEREMOTEPROTOCOLS@

# BrowseTimeout 300

# The NewBrowsePollQueuesShared directive determines whether a print
# queue for a newly discovered printer (discovered by the BrowsePoll directive)
# will be shared to the local network or not. This is only
# valid for newly discovered printers. For printers discovered in an
# earlier cups-browsed session, cups-browsed will remember whether the
# printer was shared, so changes by the user get conserved. Default is
# not to share newly discovered printers.

# NewBrowsePollQueuesShared Yes

# Filtering of remote printers by other properties than IP addresses
# of their servers
Expand Down

0 comments on commit fa7ce8d

Please sign in to comment.