summaryrefslogtreecommitdiff
path: root/lib/hostip4.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-04-15 13:04:01 +0200
committerDaniel Stenberg <daniel@haxx.se>2010-04-15 13:04:01 +0200
commit68aae7f57913ad91e1a6584654cd3408ed6ecad3 (patch)
treefc2ac60fbff44e0124f110ff04c752b04d8d29eb /lib/hostip4.c
parenta76fa1768103d075afd828a7f400390ddd4fd07b (diff)
downloadcurl-68aae7f57913ad91e1a6584654cd3408ed6ecad3.tar.gz
Curl_ipv4_resolve_r: only set AI_CANONNAME when needed
As reported in bug report #2987196, the code for ipv6 already did the setting of this bit correctly so we copied that logic into the Curl_ipv4_resolve_r() function as well. KRB code is the only code we know that might need the cannonical name so only resolve it for such requests!
Diffstat (limited to 'lib/hostip4.c')
-rw-r--r--lib/hostip4.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/hostip4.c b/lib/hostip4.c
index fbc7d49bf..aa33fb965 100644
--- a/lib/hostip4.c
+++ b/lib/hostip4.c
@@ -160,7 +160,12 @@ Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname,
snprintf(sbuf, sizeof(sbuf), "%d", port);
sbufptr = sbuf;
}
- hints.ai_flags = AI_CANONNAME;
+#ifdef HAVE_GSSAPI
+ if(conn->data->set.krb)
+ /* if krb is used, we (might) need the canonical host name */
+ hints.ai_flags |= AI_CANONNAME;
+#endif
+
(void)Curl_getaddrinfo_ex(hostname, sbufptr, &hints, &ai);
#elif defined(HAVE_GETHOSTBYNAME_R)