#endif /* USE_ALARM_TIMEOUT */
+#ifdef USE_UNIX_SOCKETS
+static CURLcode resolv_unix(struct Curl_easy *data,
+ const char *unix_path,
+ bool abstract_path,
+ struct Curl_dns_entry **pdns)
+{
+ struct Curl_addrinfo *addr;
+ CURLcode result;
+
+ DEBUGASSERT(unix_path);
+ *pdns = NULL;
+
+ result = Curl_unix2addr(unix_path, abstract_path, &addr);
+ if(result) {
+ if(result == CURLE_TOO_LARGE) {
+ /* Long paths are not supported for now */
+ failf(data, "Unix socket path too long: '%s'", unix_path);
+ result = CURLE_COULDNT_RESOLVE_HOST;
+ }
+ return result;
+ }
+
+ *pdns = Curl_dnscache_mk_entry(data, 0, &addr, NULL, 0);
+ return *pdns ? CURLE_OK : CURLE_OUT_OF_MEMORY;
+}
+#endif /* USE_UNIX_SOCKETS */
+
/*
* Curl_resolv() is the main name resolve function within libcurl. It resolves
* a name and returns a pointer to the entry in the 'entry' argument. This
#ifdef USE_UNIX_SOCKETS
if(peer->unix_socket)
- return Curl_resolv_unix(data, peer->hostname, (bool)peer->abstract_uds,
- pdns);
+ return resolv_unix(data, peer->hostname, (bool)peer->abstract_uds, pdns);
#else
if(peer->unix_socket)
return hostip_resolv_failed(data, peer->hostname, for_proxy);
}
#endif /* USE_CURL_ASYNC */
-
-#ifdef USE_UNIX_SOCKETS
-CURLcode Curl_resolv_unix(struct Curl_easy *data,
- const char *unix_path,
- bool abstract_path,
- struct Curl_dns_entry **pdns)
-{
- struct Curl_addrinfo *addr;
- CURLcode result;
-
- DEBUGASSERT(unix_path);
- *pdns = NULL;
-
- result = Curl_unix2addr(unix_path, abstract_path, &addr);
- if(result) {
- if(result == CURLE_TOO_LARGE) {
- /* Long paths are not supported for now */
- failf(data, "Unix socket path too long: '%s'", unix_path);
- result = CURLE_COULDNT_RESOLVE_HOST;
- }
- return result;
- }
-
- *pdns = Curl_dnscache_mk_entry(data, 0, &addr, NULL, 0);
- return *pdns ? CURLE_OK : CURLE_OUT_OF_MEMORY;
-}
-#endif /* USE_UNIX_SOCKETS */