Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
SRV: fix geting the SRV for the right scheme
Baptiste Daroussin committed 2 years ago
commit 4947f75107a38bb7ce94e68dd3b6960553b9df1e
parent 96231cd
1 file changed +4 -2
modified libpkg/fetch_libcurl.c
@@ -311,12 +311,14 @@ curl_open(struct pkg_repo *repo, struct fetch_item *fi __unused)

		if (repo->srv == NULL) {
			char *zone;
-
			char *host = NULL;
+
			char *host = NULL, *scheme = NULL;
			curl_url_get(cr->url, CURLUPART_HOST, &host, 0);
-
			xasprintf(&zone, "_http._tcp.%s", host);
+
			curl_url_get(cr->url, CURLUPART_SCHEME, &scheme, 0);
+
			xasprintf(&zone, "_%s._tcp.%s", scheme, host);
			repo->srv = dns_getsrvinfo(zone);
			free(zone);
			free(host);
+
			free(scheme);
			if (repo->srv == NULL) {
				pkg_emit_error("No SRV record found for the "
				    "repo '%s'", repo->name);