Index: dirsvc.c =================================================================== --- dirsvc.c (revision 6076) +++ dirsvc.c (working copy) @@ -164,7 +164,7 @@ * only finds other CUPS servers (not all IPP based printers). */ static char dnssdIPPRegType[] = "_ipp._tcp,_cups"; -static char dnssdIPPFaxRegType[] = "_ipp._tcp,_cups,_fax"; +static char dnssdIPPFaxRegType[] = "_fax-ipp._tcp"; static char *dnssdBuildTxtRecord(int *txt_len, cupsd_printer_t *p); static void dnssdDeregisterPrinter(cupsd_printer_t *p); @@ -206,7 +206,6 @@ { cups_ptype_t savedtype = p->type; /* Saved printer type */ - p->type |= CUPS_PRINTER_DELETE; send_cups_browse(p); @@ -214,10 +213,6 @@ p->type = savedtype; } - /* - * Restore it's type... - */ - #ifdef HAVE_LIBSLP if (BrowseLocalProtocols & BROWSE_SLP) slp_dereg_printer(p); @@ -688,7 +683,7 @@ return; } else - cupsdLogMessage(CUPSD_LOG_INFO, "Saving remote.cache..."); + cupsdLogMessage(CUPSD_LOG_DEBUG, "Saving remote.cache..."); /* * Restrict access to the file... @@ -2276,7 +2271,7 @@ * Update the state... */ - cupsdSetPrinterState(p, state, 0); + p->state = state; p->browse_time = time(NULL); if ((lease_duration = cupsGetOption("lease-duration", num_attrs, @@ -2588,7 +2583,12 @@ } cupsdClearString(&p->reg_name); - cupsdClearString(&p->txt_record); + + if (p->txt_record) + { + free(p->txt_record); + p->txt_record = NULL; + } } @@ -2886,8 +2886,7 @@ if (txt_record) free(txt_record); - if (name) - free(name); + cupsdClearString(&name); } #endif /* HAVE_DNSSD */ Index: main.c =================================================================== --- main.c (revision 6076) +++ main.c (working copy) @@ -852,7 +852,7 @@ * Update the browse list as needed... */ - if (Browsing && BrowseRemoteProtocols) + if (Browsing) { if (BrowseSocket >= 0 && FD_ISSET(BrowseSocket, input)) cupsdUpdateCUPSBrowse(); @@ -873,24 +873,27 @@ #endif /* HAVE_LDAP */ #ifdef HAVE_DNSSD - for (p = (cupsd_printer_t *)cupsArrayFirst(Printers); - p; - p = (cupsd_printer_t *)cupsArrayNext(Printers)) + if ((BrowseLocalProtocols & BROWSE_DNSSD)) { - if (p->dnssd_ipp_ref && FD_ISSET(p->dnssd_ipp_fd, input)) + for (p = (cupsd_printer_t *)cupsArrayFirst(Printers); + p; + p = (cupsd_printer_t *)cupsArrayNext(Printers)) { - FD_CLR(p->dnssd_ipp_fd, input); - - if ((sdErr = DNSServiceProcessResult(p->dnssd_ipp_ref)) != kDNSServiceErr_NoError) + if (p->dnssd_ipp_ref && FD_ISSET(p->dnssd_ipp_fd, input)) { - cupsdLogMessage(CUPSD_LOG_ERROR, - "DNS Service Discovery registration error %d; removing fd %d from InputSet...", - sdErr, p->dnssd_ipp_fd); FD_CLR(p->dnssd_ipp_fd, input); - FD_CLR(p->dnssd_ipp_fd, InputSet); - DNSServiceRefDeallocate(p->dnssd_ipp_ref); - p->dnssd_ipp_ref = NULL; - p->dnssd_ipp_fd = -1; + + if ((sdErr = DNSServiceProcessResult(p->dnssd_ipp_ref)) != kDNSServiceErr_NoError) + { + cupsdLogMessage(CUPSD_LOG_ERROR, + "DNS Service Discovery registration error %d; removing fd %d from InputSet...", + sdErr, p->dnssd_ipp_fd); + FD_CLR(p->dnssd_ipp_fd, input); + FD_CLR(p->dnssd_ipp_fd, InputSet); + DNSServiceRefDeallocate(p->dnssd_ipp_ref); + p->dnssd_ipp_ref = NULL; + p->dnssd_ipp_fd = -1; + } } } } @@ -917,6 +920,22 @@ } /* + * Update the root certificate once every 5 minutes if we have client + * connections... + */ + + if ((current_time - RootCertTime) >= RootCertDuration && RootCertDuration && + !RunUser && cupsArrayCount(Clients)) + { + /* + * Update the root certificate... + */ + + cupsdDeleteCert(0); + cupsdAddCert(0, "root"); + } + + /* * Check for new data on the client sockets... */ @@ -1036,22 +1055,6 @@ } /* - * Update the root certificate once every 5 minutes if we have client - * connections... - */ - - if ((current_time - RootCertTime) >= RootCertDuration && RootCertDuration && - !RunUser && cupsArrayCount(Clients)) - { - /* - * Update the root certificate... - */ - - cupsdDeleteCert(0); - cupsdAddCert(0, "root"); - } - - /* * Handle OS-specific event notification for any events that have * accumulated. Don't send these more than once a second... */