summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2000-03-23 05:06:17 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2000-03-23 05:06:17 +0000
commit089dd34dffdeb194dc9cd50f1e46dfae668416e0 (patch)
treef2afd1e2d5337f3c94282a4f96a70e5f9491b80e
parent2b269e154f5cc72fe858322fc49366a7025d3707 (diff)
downloadATCD-089dd34dffdeb194dc9cd50f1e46dfae668416e0.tar.gz
ChangeLogTag:Wed Mar 22 21:02:07 2000 Ossama Othman <ossama@uci.edu>
-rw-r--r--TAO/tao/IIOP_Acceptor.cpp39
1 files changed, 29 insertions, 10 deletions
diff --git a/TAO/tao/IIOP_Acceptor.cpp b/TAO/tao/IIOP_Acceptor.cpp
index 82dda5f0dee..8aeb05d71b4 100644
--- a/TAO/tao/IIOP_Acceptor.cpp
+++ b/TAO/tao/IIOP_Acceptor.cpp
@@ -352,7 +352,7 @@ TAO_IIOP_Acceptor::hostname (TAO_ORB_Core *orb_core,
ASYS_TEXT ("\n\nTAO (%P|%t) ")
ASYS_TEXT ("IIOP_Acceptor::hostname ")
ASYS_TEXT ("- %p\n\n"),
- ASYS_TEXT ("cannot cache hostname")));
+ ASYS_TEXT ("cannot determine hostname")));
return -1;
}
@@ -364,16 +364,35 @@ TAO_IIOP_Acceptor::hostname (TAO_ORB_Core *orb_core,
if (addr.get_host_name (tmp_host,
sizeof (tmp_host)) != 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 cache hostname")));
- return -1;
- }
+ // If hostname lookup fails, fall back on the IP address.
+ const char *tmp = addr.get_host_addr ();
- host = tmp_host;
+ 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;
}
return 0;