summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-06-05 18:03:05 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-06-05 18:03:05 +0000
commit13cfc5ff6bbab8875c02d9c1216b509bded379e6 (patch)
treed9c2c0589850bb6c39da915f48086a5ec55791bd
parent4b900b2b089d066475a641adf6ea4974741df551 (diff)
downloadATCD-13cfc5ff6bbab8875c02d9c1216b509bded379e6.tar.gz
ChangeLogTag:Sat Jun 5 12:58:00 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r--TAO/ChangeLog-99c19
-rw-r--r--TAO/tao/CDR.h3
-rw-r--r--TAO/tao/DomainS_T.i70
-rw-r--r--TAO/tao/GIOP.cpp64
-rw-r--r--TAO/tao/GIOP.h10
-rw-r--r--TAO/tao/IIOP_Connect.cpp15
-rw-r--r--TAO/tao/IIOP_Connect.h3
-rw-r--r--TAO/tao/IIOP_Transport.cpp4
-rw-r--r--TAO/tao/MessagingS_T.cpp165
-rw-r--r--TAO/tao/UIOP_Connect.cpp15
-rw-r--r--TAO/tao/UIOP_Connect.h3
-rw-r--r--TAO/tao/UIOP_Transport.cpp4
12 files changed, 128 insertions, 247 deletions
diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c
index 670a99ed4d1..7172930c351 100644
--- a/TAO/ChangeLog-99c
+++ b/TAO/ChangeLog-99c
@@ -1,3 +1,22 @@
+Sat Jun 5 12:58:00 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
+
+ * tao/CDR.h:
+ * tao/GIOP.cpp:
+ * tao/GIOP.h:
+ * tao/IIOP_Connect.cpp:
+ * tao/IIOP_Connect.h:
+ * tao/IIOP_Transport.cpp:
+ * tao/UIOP_Connect.cpp:
+ * tao/UIOP_Connect.h:
+ * tao/UIOP_Transport.cpp:
+ Removed several memory allocations from the critical path, they
+ were introduced in the flurry of changes to support asynch
+ messaging and pluggable protocols.
+
+ * tao/MessagingS_T.cpp:
+ * tao/DomainS_T.i:
+ Removed several uses of TAO_ORB_Core_instance()
+
Sat Jun 05 06:15:00 1999 Chris Gill <cdgill@cs.wustl.edu>
* orbsvcs/orbsvcs/Sched/Reconfig_Scheduler.cpp
diff --git a/TAO/tao/CDR.h b/TAO/tao/CDR.h
index cee1f85eadf..fdeb718c212 100644
--- a/TAO/tao/CDR.h
+++ b/TAO/tao/CDR.h
@@ -160,9 +160,6 @@ class TAO_Export TAO_InputCDR : public ACE_InputCDR
// support all OMG-IDL datatypes, even those not supported
// directly by put/get primitives.
public:
- friend class TAO_GIOP;
- // This class is able to "read" an InputCDR from a socket.
-
TAO_InputCDR (const char* buf,
size_t bufsiz,
int byte_order = ACE_CDR_BYTE_ORDER,
diff --git a/TAO/tao/DomainS_T.i b/TAO/tao/DomainS_T.i
index fdb9a68330d..eace8fe801c 100644
--- a/TAO/tao/DomainS_T.i
+++ b/TAO/tao/DomainS_T.i
@@ -12,30 +12,30 @@
#if defined (ACE_HAS_USING_KEYWORD)
template <class T> ACE_INLINE
POA_CORBA::DomainManager_tie<T>::DomainManager_tie (T &t)
- : ptr_ (&t),
- poa_ (PortableServer::POA::_nil ()),
- rel_ (0)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
{}
template <class T> ACE_INLINE
POA_CORBA::DomainManager_tie<T>::DomainManager_tie (T &t, PortableServer::POA_ptr poa)
- : ptr_ (&t),
- poa_ (PortableServer::POA::_duplicate (poa)),
- rel_ (0)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
{}
template <class T> ACE_INLINE
POA_CORBA::DomainManager_tie<T>::DomainManager_tie (T *tp, CORBA::Boolean release)
- : ptr_ (tp),
- poa_ (PortableServer::POA::_nil ()),
- rel_ (release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
{}
template <class T> ACE_INLINE
POA_CORBA::DomainManager_tie<T>::DomainManager_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release)
- : ptr_ (tp),
- poa_ (PortableServer::POA::_duplicate (poa)),
- rel_ (release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
{}
template <class T> ACE_INLINE
@@ -83,15 +83,8 @@ POA_CORBA::DomainManager_tie<T>::_default_POA (CORBA::Environment &env)
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->DomainManager::_default_POA (env);
}
template <class T> ACE_INLINE
@@ -113,30 +106,30 @@ CORBA::Policy_ptr POA_CORBA::DomainManager_tie<T>::get_domain_policy (
#if defined (ACE_HAS_USING_KEYWORD)
template <class T> ACE_INLINE
POA_CORBA::ConstructionPolicy_tie<T>::ConstructionPolicy_tie (T &t)
- : ptr_ (&t),
- poa_ (PortableServer::POA::_nil ()),
- rel_ (0)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
{}
template <class T> ACE_INLINE
POA_CORBA::ConstructionPolicy_tie<T>::ConstructionPolicy_tie (T &t, PortableServer::POA_ptr poa)
- : ptr_ (&t),
- poa_ (PortableServer::POA::_duplicate (poa)),
- rel_ (0)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
{}
template <class T> ACE_INLINE
POA_CORBA::ConstructionPolicy_tie<T>::ConstructionPolicy_tie (T *tp, CORBA::Boolean release)
- : ptr_ (tp),
- poa_ (PortableServer::POA::_nil ()),
- rel_ (release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
{}
template <class T> ACE_INLINE
POA_CORBA::ConstructionPolicy_tie<T>::ConstructionPolicy_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release)
- : ptr_ (tp),
- poa_ (PortableServer::POA::_duplicate (poa)),
- rel_ (release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
{}
template <class T> ACE_INLINE
@@ -184,15 +177,8 @@ POA_CORBA::ConstructionPolicy_tie<T>::_default_POA (CORBA::Environment &env)
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->Construction::_default_POA (env);
}
template <class T> ACE_INLINE
diff --git a/TAO/tao/GIOP.cpp b/TAO/tao/GIOP.cpp
index e25b0461acf..d2c032000d6 100644
--- a/TAO/tao/GIOP.cpp
+++ b/TAO/tao/GIOP.cpp
@@ -553,25 +553,23 @@ TAO_GIOP::read_header (TAO_Transport *transport,
TAO_ORB_Core *orb_core,
TAO_GIOP_MessageHeader &header,
CORBA::ULong &header_size,
- ACE_Message_Block *payload)
+ TAO_InputCDR &input)
{
// Default header length.
header_size = TAO_GIOP_HEADER_LEN;
if (orb_core->orb_params ()->use_lite_protocol ())
header_size = TAO_GIOP_LITE_HEADER_LEN;
- if (ACE_CDR::grow (payload, header_size) == -1)
+ if (input.grow (header_size) == -1)
return -1;
- ACE_CDR::mb_align (payload);
-
// Read until all the header is received. There should be no
// problems with locking, the header is only a few bytes so they
// should all be available on the socket, otherwise there is a
// problem with the underlying transport, in which case we have more
// problems than just this small loop.
- char* buf = payload->rd_ptr ();
+ char* buf = input.rd_ptr ();
int t = header_size;
while (t != 0)
{
@@ -584,10 +582,7 @@ TAO_GIOP::read_header (TAO_Transport *transport,
t -= n;
}
- // Adjust the length of the payload
- payload->wr_ptr (header_size);
-
- if (TAO_GIOP::parse_header (orb_core, payload, header) == -1)
+ if (TAO_GIOP::parse_header (orb_core, input, header) == -1)
return -1;
return header_size;
}
@@ -597,7 +592,7 @@ TAO_GIOP::handle_input (TAO_Transport *transport,
TAO_ORB_Core *orb_core,
TAO_GIOP_MessageHeader &header,
CORBA::ULong &current_offset,
- ACE_Message_Block *payload)
+ TAO_InputCDR& input)
{
if (header.message_size == 0)
{
@@ -607,7 +602,7 @@ TAO_GIOP::handle_input (TAO_Transport *transport,
orb_core,
header,
header_size,
- payload) == -1)
+ input) == -1)
{
if (TAO_debug_level > 0)
{
@@ -618,9 +613,8 @@ TAO_GIOP::handle_input (TAO_Transport *transport,
return -1;
}
- if (ACE_CDR::grow (payload,
- header_size +
- header.message_size) == -1)
+ if (input.grow (header_size +
+ header.message_size) == -1)
{
ACE_DEBUG ((LM_DEBUG,
"TAO (%P|%t) - %p\n",
@@ -630,17 +624,14 @@ TAO_GIOP::handle_input (TAO_Transport *transport,
// Growing the buffer may have reset the rd_ptr(), but we want to
// leave it just after the GIOP header (that was parsed already);
- ACE_CDR::mb_align (payload);
- payload->wr_ptr (header_size);
- payload->wr_ptr (header.message_size);
- payload->rd_ptr (header_size);
+ input.skip_bytes (header_size);
}
size_t missing_data =
header.message_size - current_offset;
ssize_t n =
TAO_GIOP::read_buffer (transport,
- payload->rd_ptr () + current_offset,
+ input.rd_ptr () + current_offset,
missing_data);
if (n == -1)
{
@@ -675,9 +666,9 @@ TAO_GIOP::handle_input (TAO_Transport *transport,
if (orb_core->orb_params ()->use_lite_protocol ())
header_len = TAO_GIOP_LITE_HEADER_LEN;
- char* buf = payload->rd_ptr ();
+ char* buf = input.rd_ptr ();
buf -= header_len;
- size_t msg_len = payload->length () + header_len;
+ size_t msg_len = input.length () + header_len;
TAO_GIOP::dump_msg ("recv",
ACE_reinterpret_cast (u_char *, buf),
msg_len);
@@ -1298,7 +1289,6 @@ TAO_GIOP::start_message_std (TAO_GIOP::Message_Type type,
msg.write_octet (type);
// Write a dummy <size> later it is set to the right value...
- // @@ TODO Maybe we should store the OutputCDR status in
CORBA::ULong size = 0;
msg.write_ulong (size);
@@ -1357,22 +1347,20 @@ TAO_GIOP::write_request_header_lite (const TAO_GIOP_ServiceContextList&,
int
TAO_GIOP::parse_header (TAO_ORB_Core *orb_core,
- ACE_Message_Block *payload,
+ TAO_InputCDR &input,
TAO_GIOP_MessageHeader& header)
{
if (orb_core->orb_params ()->use_lite_protocol ())
- return TAO_GIOP::parse_header_lite (payload,
- header);
+ return TAO_GIOP::parse_header_lite (input, header);
else
- return TAO_GIOP::parse_header_std (payload,
- header);
+ return TAO_GIOP::parse_header_std (input, header);
}
int
-TAO_GIOP::parse_header_std (ACE_Message_Block *payload,
+TAO_GIOP::parse_header_std (TAO_InputCDR &input,
TAO_GIOP_MessageHeader &header)
{
- char *buf = payload->rd_ptr ();
+ char *buf = input.rd_ptr ();
// The values are hard-coded to support non-ASCII platforms
if (!(buf [0] == 0x47 // 'G'
@@ -1400,11 +1388,9 @@ TAO_GIOP::parse_header_std (ACE_Message_Block *payload,
header.byte_order = buf[6];
header.message_type = buf[7];
- TAO_InputCDR cdr (payload,
- ACE_static_cast(int,header.byte_order));
-
- cdr.skip_bytes (TAO_GIOP_MESSAGE_SIZE_OFFSET);
- cdr.read_ulong (header.message_size);
+ input.reset_byte_order (header.byte_order);
+ input.skip_bytes (TAO_GIOP_MESSAGE_SIZE_OFFSET);
+ input.read_ulong (header.message_size);
if (TAO_debug_level > 2)
{
@@ -1420,10 +1406,10 @@ TAO_GIOP::parse_header_std (ACE_Message_Block *payload,
}
int
-TAO_GIOP::parse_header_lite (ACE_Message_Block *payload,
+TAO_GIOP::parse_header_lite (TAO_InputCDR &input,
TAO_GIOP_MessageHeader& header)
{
- char *buf = payload->rd_ptr ();
+ char *buf = input.rd_ptr ();
#if 0
// @@ Nobody uses this magic number, no sense in wasting time here.
@@ -1437,10 +1423,8 @@ TAO_GIOP::parse_header_lite (ACE_Message_Block *payload,
header.byte_order = TAO_ENCAP_BYTE_ORDER;
header.message_type = buf[4];
- TAO_InputCDR cdr (payload,
- ACE_static_cast(int,header.byte_order));
-
- cdr.read_ulong (header.message_size);
+ input.reset_byte_order (header.byte_order);
+ input.read_ulong (header.message_size);
return 0;
}
diff --git a/TAO/tao/GIOP.h b/TAO/tao/GIOP.h
index 0bfbe30e9b3..2a7e619772b 100644
--- a/TAO/tao/GIOP.h
+++ b/TAO/tao/GIOP.h
@@ -372,12 +372,12 @@ public:
TAO_ORB_Core *orb_core,
TAO_GIOP_MessageHeader &header,
CORBA::ULong &header_size,
- ACE_Message_Block *payload);
+ TAO_InputCDR &input);
static int handle_input (TAO_Transport *transport,
TAO_ORB_Core *orb_core,
TAO_GIOP_MessageHeader &header,
CORBA::ULong &current_offset,
- ACE_Message_Block *payload);
+ TAO_InputCDR& input);
static int parse_reply (TAO_Transport *transport,
TAO_ORB_Core *orb_core,
@@ -462,14 +462,14 @@ private:
// GIOP header is already there.
static int parse_header (TAO_ORB_Core *orb_core,
- ACE_Message_Block *payload,
+ TAO_InputCDR &input,
TAO_GIOP_MessageHeader& header);
// Parse the header, extracting all the relevant info.
- static int parse_header_std (ACE_Message_Block *payload,
+ static int parse_header_std (TAO_InputCDR &input,
TAO_GIOP_MessageHeader& header);
- static int parse_header_lite (ACE_Message_Block *payload,
+ static int parse_header_lite (TAO_InputCDR &input,
TAO_GIOP_MessageHeader& header);
};
diff --git a/TAO/tao/IIOP_Connect.cpp b/TAO/tao/IIOP_Connect.cpp
index 8e5bd6c89d2..52b7b6e8f83 100644
--- a/TAO/tao/IIOP_Connect.cpp
+++ b/TAO/tao/IIOP_Connect.cpp
@@ -75,7 +75,8 @@ TAO_IIOP_Handler_Base::TAO_IIOP_Handler_Base (ACE_Thread_Manager *t)
TAO_IIOP_Server_Connection_Handler::TAO_IIOP_Server_Connection_Handler (ACE_Thread_Manager *t)
: TAO_IIOP_Handler_Base (t),
orb_core_ (0),
- tss_resources_ (0)
+ tss_resources_ (0),
+ input_ (ACE_CDR::DEFAULT_BUFSIZE)
{
// This constructor should *never* get called, it is just here to
// make the compiler happy: the default implementation of the
@@ -88,7 +89,10 @@ TAO_IIOP_Server_Connection_Handler::TAO_IIOP_Server_Connection_Handler (ACE_Thre
TAO_IIOP_Server_Connection_Handler::TAO_IIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core)
: TAO_IIOP_Handler_Base (orb_core),
orb_core_ (orb_core),
- tss_resources_ (TAO_ORB_CORE_TSS_RESOURCES::instance ())
+ tss_resources_ (TAO_ORB_CORE_TSS_RESOURCES::instance ()),
+ input_ (orb_core->create_input_cdr_data_block (ACE_CDR::DEFAULT_BUFSIZE),
+ TAO_ENCAP_BYTE_ORDER,
+ orb_core)
{
transport_ = new TAO_IIOP_Server_Transport (this,
this->orb_core_);
@@ -293,7 +297,7 @@ TAO_IIOP_Server_Connection_Handler::handle_input (ACE_HANDLE)
this->orb_core_,
this->message_header_,
this->current_offset_,
- &this->payload_);
+ this->input_);
if (result == -1 && TAO_debug_level > 0)
{
@@ -305,12 +309,9 @@ TAO_IIOP_Server_Connection_Handler::handle_input (ACE_HANDLE)
{
TAO_GIOP_MessageHeader header_copy = this->message_header_;
this->message_header_.message_size = 0;
- TAO_InputCDR input (&this->payload_,
- header_copy.byte_order,
- this->orb_core_);
TAO_GIOP::process_server_message (this->transport (),
this->orb_core_,
- input,
+ this->input_,
header_copy);
result = 0;
}
diff --git a/TAO/tao/IIOP_Connect.h b/TAO/tao/IIOP_Connect.h
index 087a75c26fa..5e06f08ec76 100644
--- a/TAO/tao/IIOP_Connect.h
+++ b/TAO/tao/IIOP_Connect.h
@@ -30,6 +30,7 @@
#include "tao/corbafwd.h"
#include "tao/GIOP.h"
+#include "tao/CDR.h"
// Forward Decls
class TAO_Transport;
@@ -178,7 +179,7 @@ protected:
TAO_GIOP_MessageHeader message_header_;
CORBA::ULong current_offset_;
- ACE_Message_Block payload_;
+ TAO_InputCDR input_;
// This keep the state of the current message, to enable
// non-blocking reads.
};
diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp
index e10d41e2be4..bcd5b929ddd 100644
--- a/TAO/tao/IIOP_Transport.cpp
+++ b/TAO/tao/IIOP_Transport.cpp
@@ -168,14 +168,12 @@ TAO_IIOP_Client_Transport::handle_client_input (int block)
// Do I make any sense?
TAO_InputCDR* cdr = this->tms_->get_cdr_stream ();
- ACE_Message_Block* payload =
- ACE_const_cast(ACE_Message_Block*, cdr->start ());
int result = TAO_GIOP::handle_input (this,
this->orb_core_,
this->message_header_,
this->current_offset_,
- payload);
+ *cdr);
if (result == -1)
{
if (TAO_debug_level > 0)
diff --git a/TAO/tao/MessagingS_T.cpp b/TAO/tao/MessagingS_T.cpp
index 97db2c29473..db15d875142 100644
--- a/TAO/tao/MessagingS_T.cpp
+++ b/TAO/tao/MessagingS_T.cpp
@@ -28,15 +28,8 @@ POA_Messaging::RebindPolicy_tie<T>::_default_POA (CORBA::Environment &env)
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->RebindPolicy::_default_POA (env);
}
template <class T> PortableServer::POA_ptr
@@ -44,15 +37,8 @@ POA_Messaging::SyncScopePolicy_tie<T>::_default_POA (CORBA::Environment &env)
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->SyncScopePolicy::_default_POA (env);
}
template <class T> PortableServer::POA_ptr
@@ -60,15 +46,8 @@ POA_Messaging::RequestPriorityPolicy_tie<T>::_default_POA (CORBA::Environment &e
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->RequestPriorityPolicy::_default_POA (env);
}
template <class T> PortableServer::POA_ptr
@@ -76,15 +55,8 @@ POA_Messaging::ReplyPriorityPolicy_tie<T>::_default_POA (CORBA::Environment &env
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->ReplyPriorityPolicy::_default_POA (env);
}
template <class T> PortableServer::POA_ptr
@@ -92,15 +64,8 @@ POA_Messaging::RequestStartTimePolicy_tie<T>::_default_POA (CORBA::Environment &
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->RequestStartTimePolicy::_default_POA (env);
}
template <class T> PortableServer::POA_ptr
@@ -108,15 +73,8 @@ POA_Messaging::RequestEndTimePolicy_tie<T>::_default_POA (CORBA::Environment &en
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->RequestEndTimePolicy::_default_POA (env);
}
template <class T> PortableServer::POA_ptr
@@ -124,15 +82,8 @@ POA_Messaging::ReplyStartTimePolicy_tie<T>::_default_POA (CORBA::Environment &en
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->ReplyStartTimePolicy::_default_POA (env);
}
template <class T> PortableServer::POA_ptr
@@ -140,15 +91,8 @@ POA_Messaging::ReplyEndTimePolicy_tie<T>::_default_POA (CORBA::Environment &env)
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->ReplyEndTimePolicy::_default_POA (env);
}
template <class T> PortableServer::POA_ptr
@@ -156,15 +100,8 @@ POA_Messaging::RelativeRequestTimeoutPolicy_tie<T>::_default_POA (CORBA::Environ
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->RelativeRequestTimeoutPolicy::_default_POA (env);
}
template <class T> PortableServer::POA_ptr
@@ -172,15 +109,8 @@ POA_Messaging::RelativeRoundtripTimeoutPolicy_tie<T>::_default_POA (CORBA::Envir
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->RelativeRoundtripTimeoutPolicy::_default_POA (env);
}
template <class T> PortableServer::POA_ptr
@@ -188,15 +118,8 @@ POA_Messaging::RoutingPolicy_tie<T>::_default_POA (CORBA::Environment &env)
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->RoutingPolicy::_default_POA (env);
}
template <class T> PortableServer::POA_ptr
@@ -204,15 +127,8 @@ POA_Messaging::MaxHopsPolicy_tie<T>::_default_POA (CORBA::Environment &env)
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->MaxHopsPolicy::_default_POA (env);
}
template <class T> PortableServer::POA_ptr
@@ -220,15 +136,8 @@ POA_Messaging::QueueOrderPolicy_tie<T>::_default_POA (CORBA::Environment &env)
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->QueueOrderPolicy::_default_POA (env);
}
#if defined (TAO_POLLER)
@@ -238,15 +147,8 @@ POA_Messaging::ReplyHandler_tie<T>::_default_POA (CORBA::Environment &env)
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->ReplyHandler::_default_POA (env);
}
template <class T> PortableServer::POA_ptr
@@ -254,15 +156,8 @@ POA_Messaging::Poller_tie<T>::_default_POA (CORBA::Environment &env)
{
if (!CORBA::is_nil (this->poa_.in ()))
return PortableServer::POA::_duplicate (this->poa_.in ());
- else
- {
- TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
- PortableServer::POA_var result = poa->_this (env);
- if (env.exception () != 0)
- return PortableServer::POA::_nil ();
- else
- return result._retn ();
- }
+
+ return this->Poller::_default_POA (env);
}
#endif /* TAO_POLLER */
diff --git a/TAO/tao/UIOP_Connect.cpp b/TAO/tao/UIOP_Connect.cpp
index 863bb39b3e1..70b63f951ca 100644
--- a/TAO/tao/UIOP_Connect.cpp
+++ b/TAO/tao/UIOP_Connect.cpp
@@ -34,7 +34,8 @@ TAO_UIOP_Handler_Base::TAO_UIOP_Handler_Base (ACE_Thread_Manager *t)
TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (ACE_Thread_Manager *t)
: TAO_UIOP_Handler_Base (t),
orb_core_ (0),
- tss_resources_ (0)
+ tss_resources_ (0),
+ input_ (ACE_CDR::DEFAULT_BUFSIZE)
{
// This constructor should *never* get called, it is just here to
// make the compiler happy: the default implementation of the
@@ -49,7 +50,10 @@ TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (ACE_Thre
TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core)
: TAO_UIOP_Handler_Base (orb_core),
orb_core_ (orb_core),
- tss_resources_ (TAO_ORB_CORE_TSS_RESOURCES::instance ())
+ tss_resources_ (TAO_ORB_CORE_TSS_RESOURCES::instance ()),
+ input_ (orb_core->create_input_cdr_data_block (ACE_CDR::DEFAULT_BUFSIZE),
+ TAO_ENCAP_BYTE_ORDER,
+ orb_core)
{
transport_ = new TAO_UIOP_Server_Transport (this,
this->orb_core_);
@@ -245,7 +249,7 @@ TAO_UIOP_Server_Connection_Handler::handle_input (ACE_HANDLE)
this->orb_core_,
this->message_header_,
this->current_offset_,
- &this->payload_);
+ this->input_);
if (result == -1 && TAO_debug_level > 0)
{
@@ -257,12 +261,9 @@ TAO_UIOP_Server_Connection_Handler::handle_input (ACE_HANDLE)
{
TAO_GIOP_MessageHeader header_copy = this->message_header_;
this->message_header_.message_size = 0;
- TAO_InputCDR input (&this->payload_,
- header_copy.byte_order,
- this->orb_core_);
TAO_GIOP::process_server_message (this->transport (),
this->orb_core_,
- input,
+ this->input_,
header_copy);
result = 0;
}
diff --git a/TAO/tao/UIOP_Connect.h b/TAO/tao/UIOP_Connect.h
index f8a5748be40..8d9367a8aba 100644
--- a/TAO/tao/UIOP_Connect.h
+++ b/TAO/tao/UIOP_Connect.h
@@ -32,6 +32,7 @@
#include "tao/corbafwd.h"
#include "tao/GIOP.h"
+#include "tao/CDR.h"
// Forward Decls
class TAO_Transport;
@@ -179,7 +180,7 @@ protected:
TAO_GIOP_MessageHeader message_header_;
CORBA::ULong current_offset_;
- ACE_Message_Block payload_;
+ TAO_InputCDR input_;
// This keep the state of the current message, to enable
// non-blocking reads.
};
diff --git a/TAO/tao/UIOP_Transport.cpp b/TAO/tao/UIOP_Transport.cpp
index d1a0682b9db..8c74fa2ca7f 100644
--- a/TAO/tao/UIOP_Transport.cpp
+++ b/TAO/tao/UIOP_Transport.cpp
@@ -168,14 +168,12 @@ TAO_UIOP_Client_Transport::handle_client_input (int block)
// Do I make any sense?
TAO_InputCDR* cdr = this->tms_->get_cdr_stream ();
- ACE_Message_Block* payload =
- ACE_const_cast(ACE_Message_Block*, cdr->start ());
int result = TAO_GIOP::handle_input (this,
this->orb_core_,
this->message_header_,
this->current_offset_,
- payload);
+ *cdr);
if (result == -1)
{
if (TAO_debug_level > 0)