-diff -up cups-1.6.2/cups/http-support.c.avahi-address cups-1.6.2/cups/http-support.c
---- cups-1.6.2/cups/http-support.c.avahi-address 2013-03-11 18:44:36.000000000 +0000
-+++ cups-1.6.2/cups/http-support.c 2013-06-28 13:42:15.834715511 +0100
-@@ -2121,7 +2121,7 @@ http_resolve_cb(
+diff -up cups-2.0rc1/cups/http-support.c.avahi-address cups-2.0rc1/cups/http-support.c
+--- cups-2.0rc1/cups/http-support.c.avahi-address 2014-08-28 17:37:22.000000000 +0200
++++ cups-2.0rc1/cups/http-support.c 2014-09-12 15:31:45.062950696 +0200
+@@ -2342,7 +2342,7 @@ http_resolve_cb(
const char *type, /* I - Registration type */
const char *domain, /* I - Domain (unused) */
const char *hostTarget, /* I - Hostname */
uint16_t port, /* I - Port number */
AvahiStringList *txt, /* I - TXT record */
AvahiLookupResultFlags flags, /* I - Lookup flags (unused) */
-@@ -2248,41 +2248,59 @@ http_resolve_cb(
+@@ -2495,39 +2495,62 @@ http_resolve_cb(
* getting the IP address of the .local name and then do reverse-lookups...
*/
+
+ if (!error)
{
-- int error = getnameinfo(&(addr->addr.addr),
-- httpAddrLength(&(addr->addr)),
-- fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD);
+- int error = getnameinfo(&(addr->addr.addr), (socklen_t)httpAddrLength(&(addr->addr)), fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD);
+ DEBUG_printf(("8http_resolve_cb: Found \"%s\".", fqdn));
- if (!error)
+- {
+- DEBUG_printf(("8http_resolve_cb: Found \"%s\".", fqdn));
+ if ((hostptr = fqdn + strlen(fqdn) - 6) <= fqdn ||
+ _cups_strcasecmp(hostptr, ".local"))
- {
-- DEBUG_printf(("8http_resolve_cb: Found \"%s\".", fqdn));
--
+
- if ((hostptr = fqdn + strlen(fqdn) - 6) <= fqdn ||
- _cups_strcasecmp(hostptr, ".local"))
- {
- hostTarget = fqdn;
- break;
- }
++ {
+ hostTarget = fqdn;
}
+ } else {
+ avahi_address_snprint (fqdn, sizeof (fqdn), address);
+ hostTarget = fqdn;
++
#ifdef DEBUG
- else
- DEBUG_printf(("8http_resolve_cb: \"%s\" did not resolve: %d",
+ fqdn, error));
#endif /* DEBUG */
}
--
+
- httpAddrFreeList(addrlist);
}
+ } else {