diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2012-08-29 00:26:48 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2012-08-29 00:26:48 +0000 |
commit | 37e7e6e0b27c7db3be8e160e87a63fec66e0fcca (patch) | |
tree | 08d7d4e2e80a04c648bc0137f9c8f3c26f0760fb /cups | |
parent | a29fd7ddb5d63688a4d44d08e4ab16428921c321 (diff) |
Merge changes from CUPS 1.7svn-r10578.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@3891 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cups')
-rw-r--r-- | cups/Makefile | 4 | ||||
-rw-r--r-- | cups/cups.h | 4 | ||||
-rw-r--r-- | cups/dest.c | 4 | ||||
-rw-r--r-- | cups/http.c | 13 | ||||
-rw-r--r-- | cups/language.c | 2 | ||||
-rw-r--r-- | cups/util.c | 28 |
6 files changed, 47 insertions, 8 deletions
diff --git a/cups/Makefile b/cups/Makefile index 56b74192f..0b6765794 100644 --- a/cups/Makefile +++ b/cups/Makefile @@ -304,7 +304,7 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER) echo Linking $@... $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \ -install_name $(libdir)/$@ \ - -current_version 2.9.0 \ + -current_version 2.10.0 \ -compatibility_version 2.0.0 \ -exported_symbols_list t.exp \ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \ @@ -333,7 +333,7 @@ libcups_s.a: $(LIBOBJS) libcups_s.exp libcups.la: $(LIBOBJS) echo Linking $@... $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \ - -rpath $(LIBDIR) -version-info 2:9 $(LIBGSSAPI) $(SSLLIBS) \ + -rpath $(LIBDIR) -version-info 2:10 $(LIBGSSAPI) $(SSLLIBS) \ $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) diff --git a/cups/cups.h b/cups/cups.h index 8d19651d6..e50468508 100644 --- a/cups/cups.h +++ b/cups/cups.h @@ -52,9 +52,9 @@ extern "C" { * Constants... */ -# define CUPS_VERSION 1.0600 +# define CUPS_VERSION 1.0700 # define CUPS_VERSION_MAJOR 1 -# define CUPS_VERSION_MINOR 6 +# define CUPS_VERSION_MINOR 7 # define CUPS_VERSION_PATCH 0 # define CUPS_BC_FD 3 diff --git a/cups/dest.c b/cups/dest.c index 3bc89d5da..0714f6670 100644 --- a/cups/dest.c +++ b/cups/dest.c @@ -2679,8 +2679,10 @@ cups_dnssd_browse_cb( AvahiLookupResultFlags flags, /* I - Flags */ void *context) /* I - Devices array */ { +#ifdef DEBUG AvahiClient *client = avahi_service_browser_get_client(browser); /* Client information */ +#endif /* DEBUG */ _cups_dnssd_data_t *data = (_cups_dnssd_data_t *)context; /* Enumeration data */ @@ -3064,8 +3066,10 @@ cups_dnssd_query_cb( AvahiLookupResultFlags flags, /* I - Flags */ void *context) /* I - Enumeration data */ { +# ifdef DEBUG AvahiClient *client = avahi_record_browser_get_client(browser); /* Client information */ +# endif /* DEBUG */ # endif /* HAVE_DNSSD */ _cups_dnssd_data_t *data = (_cups_dnssd_data_t *)context; /* Enumeration data */ diff --git a/cups/http.c b/cups/http.c index 9957a16ae..a88a08187 100644 --- a/cups/http.c +++ b/cups/http.c @@ -3702,8 +3702,17 @@ http_send(http_t *http, /* I - Connection to server */ DEBUG_printf(("9http_send: %s: %s", http_fields[i], httpGetField(http, i))); - if (httpPrintf(http, "%s: %s\r\n", http_fields[i], - httpGetField(http, i)) < 1) + if (i == HTTP_FIELD_HOST) + { + if (httpPrintf(http, "Host: %s:%d\r\n", httpGetField(http, i), + _httpAddrPort(http->hostaddr)) < 1) + { + http->status = HTTP_ERROR; + return (-1); + } + } + else if (httpPrintf(http, "%s: %s\r\n", http_fields[i], + httpGetField(http, i)) < 1) { http->status = HTTP_ERROR; return (-1); diff --git a/cups/language.c b/cups/language.c index 74af58932..49f038238 100644 --- a/cups/language.c +++ b/cups/language.c @@ -788,7 +788,7 @@ _cupsLangString(cups_lang_t *lang, /* I - Language */ * Range check input... */ - if (!lang || !message) + if (!lang || !message || !*message) return (message); _cupsMutexLock(&lang_mutex); diff --git a/cups/util.c b/cups/util.c index d029588c4..a73130763 100644 --- a/cups/util.c +++ b/cups/util.c @@ -1636,6 +1636,7 @@ cups_get_printer_uri( /* Hostname associated with connection */ static const char * const requested_attrs[] = { /* Requested attributes */ + "device-uri", "member-uris", "printer-uri-supported", "printer-type" @@ -1696,7 +1697,32 @@ cups_get_printer_uri( if ((response = cupsDoRequest(http, request, "/")) != NULL) { - if ((attr = ippFindAttribute(response, "member-uris", IPP_TAG_URI)) != NULL) + const char *device_uri = NULL; /* device-uri value */ + + if ((attr = ippFindAttribute(response, "device-uri", + IPP_TAG_URI)) != NULL) + device_uri = attr->values[0].string.text; + + if (device_uri && + ((strstr(device_uri, "._ipp.") != NULL || + strstr(device_uri, "._ipps.") != NULL) && + !strcmp(device_uri + strlen(device_uri) - 5, "/cups"))) + { + /* + * Statically-configured Bonjour shared printer. + */ + + httpSeparateURI(HTTP_URI_CODING_ALL, + _httpResolveURI(device_uri, uri, sizeof(uri), + _HTTP_RESOLVE_DEFAULT, NULL, NULL), + scheme, sizeof(scheme), username, sizeof(username), + host, hostsize, port, resource, resourcesize); + ippDelete(response); + + return (1); + } + else if ((attr = ippFindAttribute(response, "member-uris", + IPP_TAG_URI)) != NULL) { /* * Get the first actual printer name in the class... |