diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2001-03-21 14:01:52 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2001-03-21 14:01:52 +0000 |
commit | 67e5846388dae63e53b5843c170b2296e697d8d0 (patch) | |
tree | 70f2df0f6f94a6393e06ccc17631f21a26823ae6 | |
parent | ee0955f9220613f74cb54eaf30dced9bfc8dca6d (diff) | |
download | ATCD-67e5846388dae63e53b5843c170b2296e697d8d0.tar.gz |
ChangeLogTag:Wed Mar 21 07:23:15 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu>
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 6 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 6 | ||||
-rw-r--r-- | tests/SOCK_Connector_Test.cpp | 19 |
4 files changed, 28 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog index 9e9168e1a0b..8d94e79ecd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Mar 21 07:23:15 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu> + + * tests/SOCK_Connector_Test.cpp (find_another_host): Make the + test a bit more resilent against errors with gethostbyname(). + Thanks to Lu Yunhai <luyunhai@huawei.com> for this fix. + Tue Mar 20 17:31:21 2001 Carlos O'Ryan <coryan@uci.edu> * tests/run_test.lst: diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 9e9168e1a0b..8d94e79ecd1 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,9 @@ +Wed Mar 21 07:23:15 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu> + + * tests/SOCK_Connector_Test.cpp (find_another_host): Make the + test a bit more resilent against errors with gethostbyname(). + Thanks to Lu Yunhai <luyunhai@huawei.com> for this fix. + Tue Mar 20 17:31:21 2001 Carlos O'Ryan <coryan@uci.edu> * tests/run_test.lst: diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 9e9168e1a0b..8d94e79ecd1 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,9 @@ +Wed Mar 21 07:23:15 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu> + + * tests/SOCK_Connector_Test.cpp (find_another_host): Make the + test a bit more resilent against errors with gethostbyname(). + Thanks to Lu Yunhai <luyunhai@huawei.com> for this fix. + Tue Mar 20 17:31:21 2001 Carlos O'Ryan <coryan@uci.edu> * tests/run_test.lst: diff --git a/tests/SOCK_Connector_Test.cpp b/tests/SOCK_Connector_Test.cpp index 945b3935033..baf3037e163 100644 --- a/tests/SOCK_Connector_Test.cpp +++ b/tests/SOCK_Connector_Test.cpp @@ -86,8 +86,11 @@ find_another_host (ACE_TCHAR other_host[]) h = ACE_OS::gethostbyname (un.nodename); - // Use me if can't find another - ACE_OS::strcpy (other_host, ACE_TEXT_CHAR_TO_TCHAR (h->h_name)); + if (h == 0) + ACE_OS::strcpy (other_host, ACE_LOCALHOST); + else + // Use me if can't find another + ACE_OS::strcpy (other_host, ACE_TEXT_CHAR_TO_TCHAR (h->h_name)); // @@ We really need to add wrappers for these hostent methods. @@ -126,13 +129,11 @@ find_another_host (ACE_TCHAR other_host[]) // Now try to connect to candidates for (int i = 0; i < candidate_count; i++) - { - if (host_is_up (candidate[i].host_name)) - { - ACE_OS::strcpy (other_host, candidate[i].host_name); - break; - } - } + if (host_is_up (candidate[i].host_name)) + { + ACE_OS::strcpy (other_host, candidate[i].host_name); + break; + } endhostent (); #endif /* ! ACE_LACKS_GETHOSTENT */ |