]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix ippfind _regtype
authorMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 5 Apr 2018 21:25:31 +0000 (17:25 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 5 Apr 2018 21:25:31 +0000 (17:25 -0400)
test/ippfind.c

index c7e8765d0dc3efa2a4fe14c3797aa8008d87e9a3..79c0a065560b20bc9b4610a80d44fba5a30e32ac 100644 (file)
@@ -1194,7 +1194,12 @@ main(int  argc,                          /* I - Number of command-line args */
                        *domain;        /* Domain, if any */
 
     strlcpy(buf, search, sizeof(buf));
-    if ((regtype = strstr(buf, "._")) != NULL)
+
+    if (!strncmp(buf, "_http._", 7) || !strncmp(buf, "_https._", 8) || !strncmp(buf, "_ipp._", 6) || !strncmp(buf, "_ipps._", 7))
+    {
+      regtype = buf;
+    }
+    else if ((regtype = strstr(buf, "._")) != NULL)
     {
       if (strcmp(regtype, "._tcp"))
       {
@@ -1249,6 +1254,9 @@ main(int  argc,                           /* I - Number of command-line args */
 
       service = get_service(services, name, regtype, domain);
 
+      if (getenv("IPPFIND_DEBUG"))
+        fprintf(stderr, "Resolving name=\"%s\", regtype=\"%s\", domain=\"%s\"\n", name, regtype, domain);
+
 #ifdef HAVE_DNSSD
       service->ref = dnssd_ref;
       err          = DNSServiceResolve(&(service->ref),
@@ -1274,6 +1282,9 @@ main(int  argc,                           /* I - Number of command-line args */
       * Browse for services of the given type...
       */
 
+      if (getenv("IPPFIND_DEBUG"))
+        fprintf(stderr, "Browsing for regtype=\"%s\", domain=\"%s\"\n", regtype, domain);
+
 #ifdef HAVE_DNSSD
       DNSServiceRef    ref;            /* Browse reference */