packages: cups/cups-avahi-2-backend.patch, cups/cups-avahi-5-services.patch...
baggins
baggins at pld-linux.org
Sun Feb 5 16:21:16 CET 2012
Author: baggins Date: Sun Feb 5 15:21:16 2012 GMT
Module: packages Tag: HEAD
---- Log message:
- revert changes for proper 1.5.1 sources
---- Files affected:
packages/cups:
cups-avahi-2-backend.patch (1.2 -> 1.3) , cups-avahi-5-services.patch (1.2 -> 1.3)
---- Diffs:
================================================================
Index: packages/cups/cups-avahi-2-backend.patch
diff -u packages/cups/cups-avahi-2-backend.patch:1.2 packages/cups/cups-avahi-2-backend.patch:1.3
--- packages/cups/cups-avahi-2-backend.patch:1.2 Sun Feb 5 14:01:08 2012
+++ packages/cups/cups-avahi-2-backend.patch Sun Feb 5 16:21:11 2012
@@ -174,7 +174,7 @@
+ */
+
+ datalen = *data++;
-+ if (!datalen || (data + datalen) >= txt->dataend)
++ if (!datalen || (data + datalen) > txt->dataend)
+ return NULL;
+ txt->datanext = data + datalen;
+
================================================================
Index: packages/cups/cups-avahi-5-services.patch
diff -u packages/cups/cups-avahi-5-services.patch:1.2 packages/cups/cups-avahi-5-services.patch:1.3
--- packages/cups/cups-avahi-5-services.patch:1.2 Sun Feb 5 14:01:09 2012
+++ packages/cups/cups-avahi-5-services.patch Sun Feb 5 16:21:11 2012
@@ -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 @@
--- 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 @@
/*
-@@ -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 @@
# 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 @@
+ 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 @@
-#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 @@
+ }
+#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 @@
}
+@@ -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 @@
--- 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 <avahi-client/publish.h>
@@ -924,9 +977,9 @@
* 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 @@
+ /* 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 @@
+ /* 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 @@
+ 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 @@
+#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)
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/cups/cups-avahi-2-backend.patch?r1=1.2&r2=1.3&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/cups/cups-avahi-5-services.patch?r1=1.2&r2=1.3&f=u
More information about the pld-cvs-commit
mailing list