From: Michael R Sweet Date: Thu, 5 Apr 2018 21:25:31 +0000 (-0400) Subject: Fix ippfind _regtype X-Git-Tag: v2.3b5~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15fe2ddc7f2662d8fffcec4d577618a85002f7db;p=thirdparty%2Fcups.git Fix ippfind _regtype --- diff --git a/test/ippfind.c b/test/ippfind.c index c7e8765d0d..79c0a06556 100644 --- a/test/ippfind.c +++ b/test/ippfind.c @@ -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 */