Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions cups/dest.c
Original file line number Diff line number Diff line change
Expand Up @@ -3201,8 +3201,8 @@ cups_enum_dests(
// Get the list of local printers and pass them to the callback function...
num_dests = _cupsGetDests(http, IPP_OP_CUPS_GET_PRINTERS, NULL, &dests, data.type, data.mask);

data.num_local = num_dests;
data.local_dests = dests;
data.num_local = 0;
data.local_dests = NULL;

if (data.def_name[0])
{
Expand All @@ -3216,6 +3216,8 @@ cups_enum_dests(

for (i = num_dests, dest = dests; i > 0 && (!cancel || !*cancel); i --, dest ++)
{
data.num_local = cupsCopyDest(dest, data.num_local, &data.local_dests);

cups_dest_t *user_dest; // Destination from lpoptions
const char *device_uri; // Device URI

Expand Down Expand Up @@ -3295,6 +3297,7 @@ cups_enum_dests(
DEBUG_puts("1cups_enum_dests: Unable to create service browser, returning 0.");

cupsFreeDests(data.num_dests, data.dests);
cupsFreeDests(data.num_local, data.local_dests);
cupsArrayDelete(data.devices);

return (false);
Expand All @@ -3315,6 +3318,7 @@ cups_enum_dests(
cupsDNSSDDelete(dnssd);

cupsFreeDests(data.num_dests, data.dests);
cupsFreeDests(data.num_local, data.local_dests);
cupsArrayDelete(data.devices);

return (false);
Expand All @@ -3326,6 +3330,7 @@ cups_enum_dests(
cupsDNSSDDelete(dnssd);

cupsFreeDests(data.num_dests, data.dests);
cupsFreeDests(data.num_local, data.local_dests);
cupsArrayDelete(data.devices);

return (false);
Expand All @@ -3341,6 +3346,7 @@ cups_enum_dests(
cupsDNSSDDelete(dnssd);

cupsFreeDests(data.num_dests, data.dests);
cupsFreeDests(data.num_local, data.local_dests);
cupsArrayDelete(data.devices);

return (false);
Expand All @@ -3352,6 +3358,7 @@ cups_enum_dests(
cupsDNSSDDelete(dnssd);

cupsFreeDests(data.num_dests, data.dests);
cupsFreeDests(data.num_local, data.local_dests);
cupsArrayDelete(data.devices);

return (false);
Expand Down Expand Up @@ -3419,6 +3426,13 @@ cups_enum_dests(

if ((device->type & mask) != type)
device->state = _CUPS_DNSSD_INCOMPATIBLE;

if (device->state == _CUPS_DNSSD_INCOMPATIBLE)
{
DEBUG_printf("2cups_enum_dests: Skipping incompatible '%s'.",
device->fullname);
continue;
}

if (device->state == _CUPS_DNSSD_PENDING)
{
Expand Down
Loading