From 2298daa8b661049c324207bf6e75cbcbc23ce430 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Fri, 11 Feb 2005 22:48:17 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=5405 --- checkin_notes | 7 +++++++ client/net_xfer.C | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index e8160ff4af..bbb566e290 100755 --- a/checkin_notes +++ b/checkin_notes @@ -24595,3 +24595,10 @@ Janus 11 Feb 2005 languages/translations/ en.po +Rom 11 Feb 2005 + - Bug Fix: Check to see if the hostname given to us is in dotted decimal + notation, if so, convert it into an ip address, otherwise pass it to + a name resolution service. + + client/ + net_xfer.C diff --git a/client/net_xfer.C b/client/net_xfer.C index 4a040cca4f..f2ea5ce9db 100644 --- a/client/net_xfer.C +++ b/client/net_xfer.C @@ -117,13 +117,24 @@ int NET_XFER::get_ip_addr(int &ip_addr) { } int NET_XFER::get_ip_addr(char *hostname, int &ip_addr) { - hostent* hep; #ifdef WIN32 int retval; retval = NetOpen(); if (retval) return retval; #endif + + // Check to see if the hostname is in Internet Standard dotted notation, + // if so, return that address instead of hitting the various + // name resolution services. + int temp_ip_addr = inet_addr(hostname); + if (-1 != temp_ip_addr) { + ip_addr = temp_ip_addr; + return 0; + } + + // The hostname is really a name that we must resolve. + hostent* hep; hep = gethostbyname(hostname); if (!hep) { char msg[256];