2020-10-14 21:24:15 +00:00
|
|
|
diff --git a/cups/ipp-vars.c b/cups/ipp-vars.c
|
2020-11-02 12:37:47 +00:00
|
|
|
index 395b0eb..d863287 100644
|
2020-10-14 21:24:15 +00:00
|
|
|
--- a/cups/ipp-vars.c
|
|
|
|
+++ b/cups/ipp-vars.c
|
2020-11-02 12:37:47 +00:00
|
|
|
@@ -12,7 +12,7 @@
|
|
|
|
* Include necessary headers...
|
2020-10-14 21:24:15 +00:00
|
|
|
*/
|
|
|
|
|
2020-11-02 12:37:47 +00:00
|
|
|
-#include <cups/cups.h>
|
|
|
|
+#include "cups/cups-private.h"
|
2020-10-14 21:24:15 +00:00
|
|
|
#include "ipp-private.h"
|
|
|
|
#include "string-private.h"
|
|
|
|
#include "debug-internal.h"
|
2020-11-02 12:37:47 +00:00
|
|
|
@@ -220,10 +220,22 @@ _ippVarsSet(_ipp_vars_t *v, /* I - IPP variables */
|
|
|
|
{
|
2020-10-14 21:24:15 +00:00
|
|
|
if (!strcmp(name, "uri"))
|
|
|
|
{
|
2020-11-02 12:37:47 +00:00
|
|
|
- char uri[1024]; /* New printer URI */
|
|
|
|
- http_uri_status_t uri_status; /* URI status */
|
|
|
|
+ char uri[1024]; /* New printer URI */
|
|
|
|
+ char resolved[1024]; /* Resolved mDNS URI */
|
2020-10-14 21:24:15 +00:00
|
|
|
|
|
|
|
- if ((uri_status = httpSeparateURI(HTTP_URI_CODING_ALL, value, v->scheme, sizeof(v->scheme), v->username, sizeof(v->username), v->host, sizeof(v->host), &(v->port), v->resource, sizeof(v->resource))) < HTTP_URI_STATUS_OK)
|
2020-11-02 12:37:47 +00:00
|
|
|
+ if (strstr(value, "._tcp"))
|
2020-10-14 21:24:15 +00:00
|
|
|
+ {
|
|
|
|
+ /*
|
|
|
|
+ * Resolve URI...
|
|
|
|
+ */
|
|
|
|
+
|
2020-11-02 12:37:47 +00:00
|
|
|
+ if (!_httpResolveURI(value, resolved, sizeof(resolved), _HTTP_RESOLVE_DEFAULT, NULL, NULL))
|
2020-10-14 21:24:15 +00:00
|
|
|
+ return (0);
|
|
|
|
+
|
2020-11-02 12:37:47 +00:00
|
|
|
+ value = resolved;
|
2020-10-14 21:24:15 +00:00
|
|
|
+ }
|
|
|
|
+
|
2020-11-02 12:37:47 +00:00
|
|
|
+ if (httpSeparateURI(HTTP_URI_CODING_ALL, value, v->scheme, sizeof(v->scheme), v->username, sizeof(v->username), v->host, sizeof(v->host), &(v->port), v->resource, sizeof(v->resource)) < HTTP_URI_STATUS_OK)
|
2020-10-14 21:24:15 +00:00
|
|
|
return (0);
|
|
|
|
|
|
|
|
if (v->username[0])
|