diff options
author | Chris Cleeland <chris.cleeland@gmail.com> | 2001-03-23 04:51:31 +0000 |
---|---|---|
committer | Chris Cleeland <chris.cleeland@gmail.com> | 2001-03-23 04:51:31 +0000 |
commit | 802dd148df768ecbd9b4691229bd2280d0833924 (patch) | |
tree | dc1c151e4e985d3bdfb7c684d1a2b6fd1f14b8df | |
parent | b787e7a5df2a9ff183b3b5e76da0b7384977c2e5 (diff) | |
download | ATCD-802dd148df768ecbd9b4691229bd2280d0833924.tar.gz |
ChangeLogTag: Thu Mar 22 21:33:37 2001 Chris Cleeland <cleeland_c@ociweb.com>
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 14 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 14 | ||||
-rw-r--r-- | ace/INET_Addr.h | 8 | ||||
-rw-r--r-- | ace/INET_Addr.i | 10 |
5 files changed, 60 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index 08a1f909d61..ce8f651407a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +Thu Mar 22 21:33:37 2001 Chris Cleeland <cleeland_c@ociweb.com> + + * ace/INET_Addr.h: VxWorks' inet_ntoa doesn't behave like most + others, and our use was causing memory leaks. VxWorks prefers + that you use its own inet_ntoa_b, which takes the buffer to fill + as an argument. Thus, for VxWorks, added a data member char buf + of the appropriate length so that get_host_addr can use + inet_ntoa_b to fill that in. + + * ace/INET_Addr.i (get_host_addr): For VxWorks only, changed this + to use the preferred inet_ntoa_b. This eliminate memory leaks + under VxWorks. Thanks to Erik Johannes <ejohannes@oresis.com> for + the suggested fix. + Wed Mar 21 19:20:02 2001 Balachandran Natarajan <bala@cs.wustl.edu> * apps/Gateway/Peer/Peer.cpp (nonblk_put): Fixed a compile error diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 08a1f909d61..ce8f651407a 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,17 @@ +Thu Mar 22 21:33:37 2001 Chris Cleeland <cleeland_c@ociweb.com> + + * ace/INET_Addr.h: VxWorks' inet_ntoa doesn't behave like most + others, and our use was causing memory leaks. VxWorks prefers + that you use its own inet_ntoa_b, which takes the buffer to fill + as an argument. Thus, for VxWorks, added a data member char buf + of the appropriate length so that get_host_addr can use + inet_ntoa_b to fill that in. + + * ace/INET_Addr.i (get_host_addr): For VxWorks only, changed this + to use the preferred inet_ntoa_b. This eliminate memory leaks + under VxWorks. Thanks to Erik Johannes <ejohannes@oresis.com> for + the suggested fix. + Wed Mar 21 19:20:02 2001 Balachandran Natarajan <bala@cs.wustl.edu> * apps/Gateway/Peer/Peer.cpp (nonblk_put): Fixed a compile error diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 08a1f909d61..ce8f651407a 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,17 @@ +Thu Mar 22 21:33:37 2001 Chris Cleeland <cleeland_c@ociweb.com> + + * ace/INET_Addr.h: VxWorks' inet_ntoa doesn't behave like most + others, and our use was causing memory leaks. VxWorks prefers + that you use its own inet_ntoa_b, which takes the buffer to fill + as an argument. Thus, for VxWorks, added a data member char buf + of the appropriate length so that get_host_addr can use + inet_ntoa_b to fill that in. + + * ace/INET_Addr.i (get_host_addr): For VxWorks only, changed this + to use the preferred inet_ntoa_b. This eliminate memory leaks + under VxWorks. Thanks to Erik Johannes <ejohannes@oresis.com> for + the suggested fix. + Wed Mar 21 19:20:02 2001 Balachandran Natarajan <bala@cs.wustl.edu> * apps/Gateway/Peer/Peer.cpp (nonblk_put): Fixed a compile error diff --git a/ace/INET_Addr.h b/ace/INET_Addr.h index f60235f7d41..0d23ddff521 100644 --- a/ace/INET_Addr.h +++ b/ace/INET_Addr.h @@ -23,6 +23,10 @@ #include "ace/Addr.h" +#if defined(VXWORKS) +# include "inetLib.h" +#endif /* VXWORKS */ + /** * @class ACE_INET_Addr * @@ -271,6 +275,10 @@ public: private: /// Underlying representation. sockaddr_in inet_addr_; + +#if defined (VXWORKS) + char buf_[INET_ADDR_LEN]; +#endif }; #if defined (__ACE_INLINE__) diff --git a/ace/INET_Addr.i b/ace/INET_Addr.i index c0197cc9572..912e8628c37 100644 --- a/ace/INET_Addr.i +++ b/ace/INET_Addr.i @@ -33,7 +33,17 @@ ACE_INLINE const char * ACE_INET_Addr::get_host_addr (void) const { ACE_TRACE ("ACE_INET_Addr::get_host_addr"); +#if defined (VXWORKS) + // It would be nice to be able to encapsulate this into + // ACE_OS::inet_ntoa(), but that would lead to either inefficiencies + // on vxworks or lack of thread safety. + // + // So, we use the way that vxworks suggests. + inet_ntoa_b (this->inet_addr_.sin_addr, this->buf_); + return &buf_[0]; +#else /* VXWORKS */ return ACE_OS::inet_ntoa (this->inet_addr_.sin_addr); +#endif /* VXWORKS */ } // Return the 4-byte IP address, converting it into host byte order. |