From 92932f26495fe12e67f469464752b97540368e04 Mon Sep 17 00:00:00 2001 From: fhunleth Date: Wed, 7 Feb 2001 19:01:25 +0000 Subject: ChangeLogTag: Wed Feb 7 12:57:35 2001 Frank Hunleth --- TAO/ChangeLogs/ChangeLog-02a | 7 +++++++ TAO/tao/Acceptor_Registry.cpp | 18 ++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 3b03aba23e9..bb27a691b97 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,10 @@ +Wed Feb 7 12:57:35 2001 Frank Hunleth + + * tao/Acceptor_Registry.cpp: + Fixed redundant call to strtok_r in open_i when a + protocol is specified without an endpoint. This was + causing core dumps on Linux platforms. + Tue Feb 6 22:39:06 2001 Frank Hunleth * tao/Connection_Cache_Manager.cpp: diff --git a/TAO/tao/Acceptor_Registry.cpp b/TAO/tao/Acceptor_Registry.cpp index b157f91620a..94d106a5d29 100644 --- a/TAO/tao/Acceptor_Registry.cpp +++ b/TAO/tao/Acceptor_Registry.cpp @@ -498,18 +498,16 @@ TAO_Acceptor_Registry::open_i (TAO_ORB_Core *orb_core, const char *astr = ACE_OS::strtok_r (addr_str.get (), ",", &last_addr); - if (astr == 0) - astr = ""; // Iterate over the addrs specified in the endpoint. - for ( ; - astr != 0; - astr = ACE_OS::strtok_r (0, - ",", - &last_addr)) + do { - ACE_CString address (astr); + // For the first time only through the loop, it is + // possible for astr to be 0. This indicates that + // the user is requesting the default endpoint for + // the specified protocol. + ACE_CString address (astr == 0 ? "" : astr); TAO_Acceptor *acceptor = (*factory)->factory ()->make_acceptor (); @@ -591,6 +589,10 @@ TAO_Acceptor_Registry::open_i (TAO_ORB_Core *orb_core, -1); } } + while ((astr != 0) && + ((astr = ACE_OS::strtok_r (0, + ",", + &last_addr)) != 0)); return 0; } -- cgit v1.2.1