scheduler/dirsvc.c:
- cupsdDeregisterPrinter(): Don't deregister hardwired remote printers.
- cupsdRegisterPrinter(): Don't register hardwired remote printers.
- cupsdSendBrowseList(): Don't share hardwired remote printers.
scheduler/ipp.c:
- copy_printer_attrs(): Use external_type as the base value
for the printer-type attribute we send.
scheduler/printers.c:
- cupsdSetPrinterAttrs(): Save printer_type value in external_type.
scheduler/printers.h:
- Add external_type to cupsd_printer_t structure.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@6538
7a7537e8-13f0-0310-91df-
b6672ffda945
*/
if (!Browsing || !p->shared ||
- (p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_IMPLICIT)))
+ (p->external_type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_IMPLICIT)))
return;
/*
cupsdRegisterPrinter(cupsd_printer_t *p)/* I - Printer */
{
if (!Browsing || !BrowseLocalProtocols || !BrowseInterval || !NumBrowsers ||
- (p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_IMPLICIT)))
+ (p->external_type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_IMPLICIT)))
return;
#ifdef HAVE_LIBSLP
for (count = 0, p = (cupsd_printer_t *)cupsArrayFirst(Printers);
count < max_count && p != NULL;
p = (cupsd_printer_t *)cupsArrayNext(Printers))
- if (!(p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_IMPLICIT)) &&
+ if (!(p->external_type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_IMPLICIT)) &&
p->shared && p->browse_time < ut)
count ++;
if (!p)
break;
- else if ((p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_IMPLICIT)) ||
+ else if ((p->external_type & (CUPS_PRINTER_REMOTE |
+ CUPS_PRINTER_IMPLICIT)) ||
!p->shared)
continue;
else if (p->browse_time < ut)
* Add the CUPS-specific printer-type attribute...
*/
- type = printer->type;
+ type = printer->external_type;
if (printer == DefaultPrinter)
type |= CUPS_PRINTER_DEFAULT;
}
}
+ /*
+ * Save the local printer type value, which may have the CUPS_PRINTER_REMOTE
+ * bit set. We use this value when sending the printer-type attribute to
+ * clients so they know whether the printer is really remote. Doing it
+ * this way prevents the browsing code from timing out hardwired remote
+ * printers...
+ */
+
+ p->external_type = printer_type;
+
/*
* Copy the printer options into a browse attributes string we can re-use.
*/
- if (!(p->type & CUPS_PRINTER_REMOTE))
+ if (!(printer_type & CUPS_PRINTER_REMOTE))
{
const char *valptr; /* Pointer into value */
char *attrptr; /* Pointer into attribute string */
char *reasons[16]; /* printer-state-reasons strings */
time_t state_time; /* Time at this state */
char *job_sheets[2]; /* Banners/job sheets */
- cups_ptype_t type; /* Printer type (color, small, etc.) */
+ cups_ptype_t type, /* Printer type (color, small, etc.) */
+ external_type; /* Printer type that is advertised */
char *browse_attrs; /* Attributes sent with browse data */
time_t browse_expire; /* Expiration time for printer */
time_t browse_time; /* Last time update was sent/received */