summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohn_c <john_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-10-07 16:36:25 +0000
committerjohn_c <john_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-10-07 16:36:25 +0000
commit52c0839166a88fdf2bc3cbdf52eccdf2ea1ba8c6 (patch)
tree7078f126586b6e25dd59161e1e37307ae7e10094
parentbe65e45fdaf9a2956a338e99783bebab12c6fd6d (diff)
downloadATCD-52c0839166a88fdf2bc3cbdf52eccdf2ea1ba8c6.tar.gz
When closing stream pipes, only one end was being closed.
This led to file descriptors being leaked each time an SPIPE_Acceptor is opened. Now both the file descriptors are being closed in close method. Extended 'decode_string_to_sequence' to successfully parse URL style IOR's generated from pre 1.4 TAO releases. Earlier the escape charecter was '\' (currently '%').
-rw-r--r--ChangeLog10
-rw-r--r--TAO/ChangeLog7
-rw-r--r--TAO/tao/Object_KeyC.cpp2
-rw-r--r--ace/SPIPE.cpp12
-rw-r--r--ace/SPIPE.h12
-rw-r--r--ace/SPIPE_Acceptor.cpp1
6 files changed, 43 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d9bed1a7c0..fa0e9ccb2f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Thu Oct 7 11:21:37 2004 john_c <john_c@ociweb.com>
+
+ * ace/SPIPE.cpp
+ * ace/SPIPE.h
+ * ace/SPIPE_Acceptor.cpp
+ When closing stream pipes, only one end was being closed.
+ This led to file descriptors being leaked each time an
+ SPIPE_Acceptor is opened. Now both the file
+ descriptors are being closed in close method.
+
Thu Oct 7 11:56:12 UTC 2004 Johnny Willemsen <jwillemsen@remedy.nl>
Reverted my change below, broke the LynxOS build
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 32ad10e2098..326a2e4b647 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,10 @@
+Thu Oct 7 11:25:51 2004 john_c <john_c@ociweb>
+
+ * TAO\tao\Object_KeyC.cpp:
+ Extended 'decode_string_to_sequence' to successfully parse
+ URL style IOR's generated from pre 1.4 TAO releases. Earlier
+ the escape charecter was '\\' (currently '%').
+
Tue Oct 5 20:01:17 2004 Carlos O'Ryan <coryan@atdesk.com>
* tests/Sequence_Unit_Tests/string_traits_base.hpp:
diff --git a/TAO/tao/Object_KeyC.cpp b/TAO/tao/Object_KeyC.cpp
index 7c673f39ba0..ff73e6bd910 100644
--- a/TAO/tao/Object_KeyC.cpp
+++ b/TAO/tao/Object_KeyC.cpp
@@ -175,7 +175,7 @@ TAO::ObjectKey::decode_string_to_sequence (TAO_Unbounded_Sequence<CORBA::Octet>
cp < eos && i < seq.length ();
++i)
{
- if (*cp == '%')
+ if (*cp == '%' || *cp == '\\')
{
// This is an escaped non-printable,
// so we decode the hex values into
diff --git a/ace/SPIPE.cpp b/ace/SPIPE.cpp
index a87967a6249..f69c8b63b33 100644
--- a/ace/SPIPE.cpp
+++ b/ace/SPIPE.cpp
@@ -48,6 +48,9 @@ ACE_SPIPE::close (void)
if (this->get_handle () != ACE_INVALID_HANDLE)
{
result = ACE_OS::close (this->get_handle ());
+#if defined (ACE_HAS_STREAM_PIPES)
+ result = (ACE_OS::close (duplex_pipe_handle_) || result);
+#endif /* ACE_HAS_STREAM_PIPES */
this->set_handle (ACE_INVALID_HANDLE);
}
return result;
@@ -64,3 +67,12 @@ ACE_SPIPE::remove (void)
return ACE_OS::unlink (this->local_addr_.get_path_name ()) == -1 || result == -1 ? -1 : 0;
}
+#if defined (ACE_HAS_STREAM_PIPES)
+/// Temporary store of duplex pipe handle.
+void
+ACE_SPIPE::set_duplex_handle (ACE_HANDLE handle)
+{
+ ACE_TRACE ("ACE_SPIPE::set_duplex_handle");
+ this->duplex_pipe_handle_ = handle;
+}
+#endif /* ACE_HAS_STREAM_PIPES */
diff --git a/ace/SPIPE.h b/ace/SPIPE.h
index 9524698baa2..61278aac517 100644
--- a/ace/SPIPE.h
+++ b/ace/SPIPE.h
@@ -81,9 +81,21 @@ public:
/// Dump the state of an object.
void dump (void) const;
+#if defined (ACE_HAS_STREAM_PIPES)
+ /// Temporary store of duplex pipe handle.
+ void set_duplex_handle (ACE_HANDLE handle);
+#endif /* ACE_HAS_STREAM_PIPES */
+
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
+private:
+#if defined (ACE_HAS_STREAM_PIPES)
+ /// Duplex to the pipe I/O handle.
+ /// Stored here for latter cleaning.
+ ACE_HANDLE duplex_pipe_handle_;
+#endif /* ACE_HAS_STREAM_PIPES */
+
protected:
/// Ensure that this class is an abstract base class
ACE_SPIPE (void);
diff --git a/ace/SPIPE_Acceptor.cpp b/ace/SPIPE_Acceptor.cpp
index deeead76ef3..84e3d517b2c 100644
--- a/ace/SPIPE_Acceptor.cpp
+++ b/ace/SPIPE_Acceptor.cpp
@@ -94,6 +94,7 @@ ACE_SPIPE_Acceptor::create_new_instance (int perms)
this->local_addr_.get_path_name ()) == -1)
return -1;
+ this->set_duplex_handle (spipe[0]);
this->set_handle (spipe[1]);
return 0;