summaryrefslogtreecommitdiff
path: root/TAO/tao/IIOP_Acceptor.cpp
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2000-04-10 16:49:29 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2000-04-10 16:49:29 +0000
commitf15d70742d254dea37cd1c7d517ab4d21512877d (patch)
treee4ab076a82a1730f20f725f4e8b2ea2f93286396 /TAO/tao/IIOP_Acceptor.cpp
parent97f67768f0861e844e0aecc3442e85f7fe651b35 (diff)
downloadATCD-f15d70742d254dea37cd1c7d517ab4d21512877d.tar.gz
ChangeLogTag:Mon Apr 10 09:11:43 2000 Ossama Othman <ossama@uci.edu>
Diffstat (limited to 'TAO/tao/IIOP_Acceptor.cpp')
-rw-r--r--TAO/tao/IIOP_Acceptor.cpp41
1 files changed, 5 insertions, 36 deletions
diff --git a/TAO/tao/IIOP_Acceptor.cpp b/TAO/tao/IIOP_Acceptor.cpp
index 4c5f2f5b38b..0c6d915f16e 100644
--- a/TAO/tao/IIOP_Acceptor.cpp
+++ b/TAO/tao/IIOP_Acceptor.cpp
@@ -350,7 +350,10 @@ TAO_IIOP_Acceptor::hostname (TAO_ORB_Core *orb_core,
ACE_INET_Addr &addr,
ACE_CString &host)
{
- if (orb_core->orb_params ()->use_dotted_decimal_addresses ())
+ char tmp_host[MAXHOSTNAMELEN + 1];
+
+ if (orb_core->orb_params ()->use_dotted_decimal_addresses ()
+ || addr.get_host_name (tmp_host, sizeof (tmp_host)) != 0)
{
const char *tmp = addr.get_host_addr ();
if (tmp == 0)
@@ -367,41 +370,7 @@ TAO_IIOP_Acceptor::hostname (TAO_ORB_Core *orb_core,
host = tmp;
}
else
- {
- char tmp_host[MAXHOSTNAMELEN + 1];
- if (addr.get_host_name (tmp_host,
- sizeof (tmp_host)) != 0)
- {
- // If hostname lookup fails, fall back on the IP address.
- const char *tmp = addr.get_host_addr ();
-
- if (tmp == 0)
- {
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT ("\n\nTAO (%P|%t) ")
- ASYS_TEXT ("IIOP_Acceptor::hostname ")
- ASYS_TEXT ("- %p\n\n"),
- ASYS_TEXT ("cannot determine hostname")));
-
- return -1;
- }
- else
- {
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT ("\n\nTAO (%P|%t) ")
- ASYS_TEXT ("IIOP_Acceptor::hostname ")
- ASYS_TEXT ("- %p\n\n"),
- ASYS_TEXT ("hostname lookup failed.\n")
- ASYS_TEXT ("Falling back on IP address")));
-
- host = tmp;
- }
- }
- else
- host = tmp_host;
- }
+ host = tmp_host;
return 0;
}