diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-11-26 04:35:09 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-11-26 04:35:09 +0000 |
commit | fff7f78f20b3b08466e75c5359aa7131e18f2c3a (patch) | |
tree | 919d92122a13a8b98d76a8fdafd48cc8d81a0008 | |
parent | 0a9a584abd66fa1999afb44cd77ed6d3f5fe5a1d (diff) | |
download | ATCD-fff7f78f20b3b08466e75c5359aa7131e18f2c3a.tar.gz |
ChangeLogTag:Wed Nov 25 22:28:44 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r-- | ChangeLog-98b | 11 | ||||
-rw-r--r-- | ace/INET_Addr.cpp | 40 |
2 files changed, 23 insertions, 28 deletions
diff --git a/ChangeLog-98b b/ChangeLog-98b index b772fdab870..8b0640d421e 100644 --- a/ChangeLog-98b +++ b/ChangeLog-98b @@ -1,3 +1,14 @@ +Wed Nov 25 22:28:44 1998 Carlos O'Ryan <coryan@cs.wustl.edu> + + * ace/INET_Addr.cpp: + Reverted the behavior to version 4.35, we don't use the first + alias as the hostname, but the value returned in the h_name + field. + This change was to support TAO in our local site, but it caused + many problems for other configurations of /etc/hosts and DNS. We + found another workaround for our local site which makes more + sense to the rest of the world. + Wed Nov 25 20:34:12 1998 Kirthika Parameswaran <kirthika@cs.wustl.edu> * tests/DLL_Test.cpp (main): Removed ACE_OS::strcat which was diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp index 9691ed0d884..02e13f49d24 100644 --- a/ace/INET_Addr.cpp +++ b/ace/INET_Addr.cpp @@ -411,7 +411,7 @@ ACE_INET_Addr::get_host_name (ASYS_TCHAR hostname[], size_t len) const hostent *hp = ACE_OS::gethostbyaddr ((char *) &this->inet_addr_.sin_addr, a_len, this->addr_type_); - if (!hp) + if (hp == 0) error = errno; // So that the errno gets propagated back; it is // loaded from error below. #else @@ -430,35 +430,19 @@ ACE_INET_Addr::get_host_name (ASYS_TCHAR hostname[], size_t len) const errno = error; return -1; } - else + + if (hp->h_name == 0) + return -1; + + if (ACE_OS::strlen (hp->h_name) >= len) { - char **p; - - for (p = hp->h_addr_list; *p != 0; ++p) - if (ACE_OS::memcmp (&inet_addr_.sin_addr, - *p, - hp->h_length) == 0) - break; - - if (*p == 0) - return -1; - - char *h = hp->h_aliases[p - hp->h_addr_list]; - - if (h == 0) - h = hp->h_name; - if (ACE_OS::strlen (h) >= len) - { - errno = ENOSPC; - return -1; - } - else - { - ACE_OS::strcpy (hostname, - ASYS_WIDE_STRING (h)); - return 0; - } + errno = ENOSPC; + return -1; } + + ACE_OS::strcpy (hostname, + ASYS_WIDE_STRING (hp->h_name)); + return 0; #endif /* VXWORKS */ } } |