X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=cups-avahi-5-services.patch;fp=cups-avahi-5-services.patch;h=2756318eb725003845e031d6df176276daac24a8;hb=b737a6ace298e55e75e9bbb7071e923b9be750e3;hp=00328805100fa814c103378f276b6fc4c6c045ad;hpb=1940e796951b28583854dcc0a6b7bbe1cdb2ff3e;p=packages%2Fcups.git diff --git a/cups-avahi-5-services.patch b/cups-avahi-5-services.patch index 0032880..2756318 100644 --- a/cups-avahi-5-services.patch +++ b/cups-avahi-5-services.patch @@ -1,3 +1,37 @@ +diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c +index 99b8e7b..2688eff 100644 +--- a/cgi-bin/admin.c ++++ b/cgi-bin/admin.c +@@ -1643,7 +1643,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ + else + local_protocols[0] = '\0'; + +-#ifdef HAVE_DNSSD ++#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) + if (cgiGetVariable("BROWSE_LOCAL_DNSSD")) + { + if (local_protocols[0]) +@@ -1651,7 +1651,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ + else + strcat(local_protocols, "dnssd"); + } +-#endif /* HAVE_DNSSD */ ++#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ + + #ifdef HAVE_LDAP + if (cgiGetVariable("BROWSE_LOCAL_LDAP")) +@@ -2718,9 +2718,9 @@ do_menu(http_t *http) /* I - HTTP connection */ + #endif /* HAVE_GSSAPI */ + cgiSetVariable("KERBEROS", ""); + +-#ifdef HAVE_DNSSD ++#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) + cgiSetVariable("HAVE_DNSSD", "1"); +-#endif /* HAVE_DNSSD */ ++#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ + + #ifdef HAVE_LDAP + cgiSetVariable("HAVE_LDAP", "1"); diff --git a/scheduler/client.c b/scheduler/client.c index e4c9b01..984dcc5 100644 --- a/scheduler/client.c @@ -38,22 +72,22 @@ index eb3c862..48dcef9 100644 --- a/scheduler/dirsvc.c +++ b/scheduler/dirsvc.c @@ -27,6 +27,7 @@ - * remote printers. - * cupsdRegisterPrinter() - Start sending broadcast information for a - * printer or update the broadcast contents. + * ldap_connect() - Start new LDAP connection + * ldap_reconnect() - Reconnect to LDAP Server + * ldap_disconnect() - Disconnect from LDAP Server + * cupsdStartAvahiClient() - Start an Avahi client if needed - * cupsdStartBrowsing() - Start sending and receiving broadcast - * information. - * cupsdStopBrowsing() - Stop sending and receiving broadcast + * cupsdStartBrowsing() - Start sending and receiving broadcast + * information. + * cupsdStartPolling() - Start polling servers as needed. @@ -45,6 +46,8 @@ - * printer. - * dnssdPackTxtRecord() - Pack an array of key/value pairs into the TXT - * record format. + * printer. + * dnssdPackTxtRecord() - Pack an array of key/value pairs into the TXT + * record format. + * avahiPackTxtRecord() - Pack an array of key/value pairs into an + * AvahiStringList. - * dnssdRegisterCallback() - DNSServiceRegister callback. - * dnssdRegisterPrinter() - Start sending broadcast information for a - * printer or update the broadcast contents. + * dnssdRegisterCallback() - DNSServiceRegister callback. + * dnssdRegisterPrinter() - Start sending broadcast information for a + * printer or update the broadcast contents. @@ -83,6 +86,7 @@ */ @@ -80,7 +114,7 @@ index eb3c862..48dcef9 100644 /* -@@ -159,26 +174,39 @@ static void update_polling(void); +@@ -159,27 +174,39 @@ static void update_polling(void); static void update_smb(int onoff); @@ -100,6 +134,7 @@ index eb3c862..48dcef9 100644 # endif /* HAVE_COREFOUNDATION */ -static char *dnssdBuildTxtRecord(int *txt_len, cupsd_printer_t *p, - int for_lpd); +-static int dnssdComparePrinters(cupsd_printer_t *a, cupsd_printer_t *b); -static void dnssdDeregisterPrinter(cupsd_printer_t *p); -static char *dnssdPackTxtRecord(int *txt_len, char *keyvalue[][2], - int count); @@ -124,9 +159,9 @@ index eb3c862..48dcef9 100644 + void *userdata); +#endif /* HAVE_AVAHI */ + - - /* - * 'cupsdDeregisterPrinter()' - Stop sending broadcast information for a + #ifdef HAVE_LDAP + static const char * const ldap_attrs[] =/* CUPS LDAP attributes */ + { @@ -283,10 +310,10 @@ cupsdDeregisterPrinter( ldap_dereg_printer(p); #endif /* HAVE_LDAP */ @@ -189,7 +224,7 @@ index eb3c862..48dcef9 100644 -#ifdef HAVE_DNSSD +#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - if (BrowseLocalProtocols & BROWSE_DNSSD) + if ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_DNSSD) { +#ifdef HAVE_DNSSD DNSServiceErrorType error; /* Error from service creation */ @@ -225,8 +260,8 @@ index eb3c862..48dcef9 100644 + } +#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - /* - * Enable LPD and SMB printer sharing as needed through external programs... + #ifdef HAVE_LIBSLP + if ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_SLP) @@ -1834,10 +1893,10 @@ cupsdStopBrowsing(void) BrowseSocket = -1; } @@ -364,6 +399,24 @@ index eb3c862..48dcef9 100644 } +@@ -2474,7 +2588,16 @@ static int /* O - Result of comparison */ + dnssdComparePrinters(cupsd_printer_t *a,/* I - First printer */ + cupsd_printer_t *b)/* I - Second printer */ + { +- return (_cups_strcasecmp(a->reg_name, b->reg_name)); ++ if (!a->reg_name) ++ if (!b->reg_name) ++ return 0; ++ else ++ return -1; ++ else ++ if (!b->reg_name) ++ return 1; ++ else ++ return (_cups_strcasecmp(a->reg_name, b->reg_name)); + } + + @@ -2489,6 +2612,10 @@ dnssdDeregisterPrinter( { cupsdLogMessage(CUPSD_LOG_DEBUG2, "dnssdDeregisterPrinter(%s)", p->name); @@ -913,8 +966,8 @@ index 99079bd..d53a179 100644 --- a/scheduler/dirsvc.h +++ b/scheduler/dirsvc.h @@ -31,6 +31,10 @@ - * file is missing or damaged, see the license at "http://www.cups.org/". - */ + # endif /* HAVE_LDAP_SSL_H */ + #endif /* HAVE_LDAP */ +#ifdef HAVE_AVAHI +# include @@ -924,9 +977,9 @@ index 99079bd..d53a179 100644 * Browse protocols... */ @@ -131,19 +135,22 @@ VAR int PollPipe VALUE(0); - BrowseLocalProtocols - VALUE(BROWSE_ALL); - /* Protocols to support for local printers */ + VAR cupsd_statbuf_t *PollStatusBuffer VALUE(NULL); + /* Status buffer for pollers */ + -#ifdef HAVE_DNSSD +#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) VAR char *DNSSDComputerName VALUE(NULL), @@ -948,7 +1001,7 @@ index 99079bd..d53a179 100644 + /* List of dynamic ServerAlias's */ VAR DNSServiceRef DNSSDRef VALUE(NULL), /* Master DNS-SD service reference */ - WebIFRef VALUE(NULL); + WebIFRef VALUE(NULL), @@ -152,6 +159,17 @@ VAR DNSServiceRef DNSSDRef VALUE(NULL), /* Remote printer browse reference */ #endif /* HAVE_DNSSD */ @@ -964,24 +1017,26 @@ index 99079bd..d53a179 100644 + /* Web interface entry group */ +#endif /* HAVE_AVAHI */ + - VAR char *LPDConfigFile VALUE(NULL), - /* LPD configuration file */ - *SMBConfigFile VALUE(NULL); -@@ -195,11 +213,12 @@ extern void cupsdRegisterPrinter(cupsd_printer_t *p); - - extern void cupsdDeregisterPrinter(cupsd_printer_t *p, int removeit); - extern void cupsdRegisterPrinter(cupsd_printer_t *p); + #ifdef HAVE_LIBSLP + VAR SLPHandle BrowseSLPHandle VALUE(NULL); + /* SLP API handle */ +@@ -195,13 +213,14 @@ extern void cupsdRegisterPrinter(cupsd_printer_t *p); + extern void cupsdRestartPolling(void); + extern void cupsdSaveRemoteCache(void); + extern void cupsdSendBrowseList(void); +extern void cupsdStartAvahiClient(void); extern void cupsdStartBrowsing(void); + extern void cupsdStartPolling(void); extern void cupsdStopBrowsing(void); + extern void cupsdStopPolling(void); -#ifdef HAVE_DNSSD +#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) extern void cupsdUpdateDNSSDName(void); -#endif /* HAVE_DNSSD */ +#endif /* defined(HAVE_DNSSD) || defined(HAVE_AVAHI) */ - - - /* + #ifdef HAVE_LDAP + extern void cupsdUpdateLDAPBrowse(void); + #endif /* HAVE_LDAP */ diff --git a/scheduler/ipp.c b/scheduler/ipp.c index a048baa..9a3ab11 100644 --- a/scheduler/ipp.c @@ -1016,9 +1071,9 @@ index 1e60572..6c210e6 100644 + avahi_client_time, /* Time for next Avahi client + check */ +#endif /* HAVE_AVAHI */ + browse_time, /* Next browse send time */ senddoc_time, /* Send-Document time */ expire_time, /* Subscription expire time */ - report_time, /* Malloc/client/job report time */ @@ -662,6 +666,9 @@ main(int argc, /* I - Number of command-line args */ */ @@ -1026,9 +1081,9 @@ index 1e60572..6c210e6 100644 +#ifdef HAVE_AVAHI + avahi_client_time = current_time; +#endif /* HAVE_AVAHI */ + browse_time = current_time; event_time = current_time; expire_time = current_time; - fds = 1; @@ -884,6 +891,16 @@ main(int argc, /* I - Number of command-line args */ tmo = cupsdNextTimeout (&tmo_delay); if (tmo && tmo_delay == 0)