diff options
author | bala <balanatarajan@users.noreply.github.com> | 2000-03-14 01:15:21 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2000-03-14 01:15:21 +0000 |
commit | 9722542ae67bac6681e1ebd34bbc617336cf616b (patch) | |
tree | 209ea5dadc278303b940b2b252d7c4f0fcded5ce | |
parent | f4ddae089eecd7b8439874b28f920e8938cd28ef (diff) | |
download | ATCD-9722542ae67bac6681e1ebd34bbc617336cf616b.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/tao/GIOP_Message_Acceptors.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/GIOP_Message_Lite.cpp | 141 | ||||
-rw-r--r-- | TAO/tao/GIOP_Message_Lite.h | 14 | ||||
-rw-r--r-- | TAO/tao/GIOP_Message_Lite.i | 68 | ||||
-rw-r--r-- | TAO/tao/GIOP_Server_Request.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/GIOP_Utils.cpp | 9 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connect.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/IIOP_Transport.cpp | 7 | ||||
-rw-r--r-- | TAO/tao/IIOP_Transport.h | 5 | ||||
-rw-r--r-- | TAO/tao/SHMIOP_Connect.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/SHMIOP_Transport.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/SHMIOP_Transport.h | 3 | ||||
-rw-r--r-- | TAO/tao/UIOP_Connect.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/UIOP_Transport.cpp | 7 | ||||
-rw-r--r-- | TAO/tao/UIOP_Transport.h | 3 |
15 files changed, 151 insertions, 124 deletions
diff --git a/TAO/tao/GIOP_Message_Acceptors.cpp b/TAO/tao/GIOP_Message_Acceptors.cpp index 10cb7837d31..d6bfdbc529a 100644 --- a/TAO/tao/GIOP_Message_Acceptors.cpp +++ b/TAO/tao/GIOP_Message_Acceptors.cpp @@ -493,7 +493,7 @@ TAO_GIOP_Message_Acceptors:: ACE_TRY { // Write the exception - CORBA::TypeCode_ptr except_tc = x->_type (); + // CORBA::TypeCode_ptr except_tc = x->_type (); CORBA::exception_type extype = CORBA::USER_EXCEPTION; diff --git a/TAO/tao/GIOP_Message_Lite.cpp b/TAO/tao/GIOP_Message_Lite.cpp index 397df8009cd..0fb55c6d415 100644 --- a/TAO/tao/GIOP_Message_Lite.cpp +++ b/TAO/tao/GIOP_Message_Lite.cpp @@ -11,9 +11,21 @@ # include "tao/GIOP_Message_Lite.i" #endif /* __ACE_INLINE__ */ -TAO_GIOP_Message_Lite::TAO_GIOP_Message_Lite (void) +TAO_GIOP_Message_Lite::TAO_GIOP_Message_Lite (TAO_ORB_Core *orb_core) + :output_ (repbuf_, + sizeof repbuf_, + TAO_ENCAP_BYTE_ORDER, + orb_core->output_cdr_buffer_allocator (), + orb_core->output_cdr_dblock_allocator (), + orb_core->orb_params ()->cdr_memcpy_tradeoff (), + orb_core->to_iso8859 (), + orb_core->to_unicode ()) { - //no-op +#if defined(ACE_HAS_PURIFY) + (void) ACE_OS::memset (repbuf, + '\0', + sizeof repbuf); +#endif /* ACE_HAS_PURIFY */ } TAO_GIOP_Message_Lite::~TAO_GIOP_Message_Lite (void) @@ -145,8 +157,6 @@ TAO_GIOP_Message_Lite:: } else if (n == 0) { - if (errno == EWOULDBLOCK) - return 0; if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("TAO (%P|%t) - %p\n"), @@ -369,21 +379,6 @@ TAO_GIOP_Message_Lite:: TAO_InputCDR &input, CORBA::Octet message_type) { - char repbuf[ACE_CDR::DEFAULT_BUFSIZE]; - -#if defined(ACE_HAS_PURIFY) - (void) ACE_OS::memset (repbuf, - '\0', - sizeof repbuf); -#endif /* ACE_HAS_PURIFY */ - TAO_OutputCDR output (repbuf, - sizeof repbuf, - TAO_ENCAP_BYTE_ORDER, - orb_core->output_cdr_buffer_allocator (), - orb_core->output_cdr_dblock_allocator (), - orb_core->orb_params ()->cdr_memcpy_tradeoff (), - orb_core->to_iso8859 (), - orb_core->to_unicode ()); switch (message_type) { @@ -393,14 +388,13 @@ TAO_GIOP_Message_Lite:: // stream this->process_connector_request (transport, orb_core, - input, - output); + input); break; case TAO_GIOP_LOCATEREQUEST: this->process_connector_locate (transport, orb_core, - input, - output); + input); + break; case TAO_GIOP_MESSAGERROR: case TAO_GIOP_REPLY: @@ -479,59 +473,11 @@ TAO_GIOP_Message_Lite:: } -CORBA::Boolean -TAO_GIOP_Message_Lite:: - write_locate_request_header (CORBA::ULong request_id, - TAO_Target_Specification &spec, - TAO_OutputCDR &msg) -{ - msg << request_id; - - // In this case we cannot recognise anything other than the Object - // key as the address disposition variable. But we do a sanity check - // anyway. - const TAO_ObjectKey *key = spec.object_key (); - if (key) - { - // Put in the object key - msg << *key; - } - else - { - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("(%N |%l) Unable to handle this request \n"))); - return 0; - } - - - return 1; -} - - -int -TAO_GIOP_Message_Lite::parse_header (TAO_GIOP_Message_State *state) -{ - // Get the read pointer - char *buf = state->cdr.rd_ptr (); - - state->byte_order = TAO_ENCAP_BYTE_ORDER; - state->giop_version.major = TAO_DEF_GIOP_MAJOR; - state->giop_version.minor = TAO_DEF_GIOP_MINOR; - state->message_type = buf[TAO_GIOP_LITE_MESSAGE_TYPE_OFFSET]; - - state->cdr.reset_byte_order (state->byte_order); - state->cdr.read_ulong (state->message_size); - - return 0; -} - int TAO_GIOP_Message_Lite:: process_connector_request (TAO_Transport *transport, TAO_ORB_Core* orb_core, - TAO_InputCDR &input, - TAO_OutputCDR &output) + TAO_InputCDR &input) { // Get the revision info TAO_GIOP_Version version (TAO_DEF_GIOP_MAJOR, @@ -541,7 +487,7 @@ TAO_GIOP_Message_Lite:: // and <sync_with_server> as appropriate. TAO_GIOP_ServerRequest request (this, input, - output, + this->output_, orb_core, version); @@ -593,13 +539,13 @@ TAO_GIOP_Message_Lite:: // "Doing the Table Lookup ...\n", // object_id.c_str ())); - CORBA::Object_ptr object_reference = + CORBA::Object_var object_reference = CORBA::Object::_nil (); // Do the Table Lookup. int status = orb_core->orb ()->_tao_find_in_IOR_table (object_id, - object_reference); + object_reference.out ()); // If ObjectID not in table or reference is nil raise // OBJECT_NOT_EXIST. @@ -610,11 +556,11 @@ TAO_GIOP_Message_Lite:: // ObjectID present in the table with an associated NON-NULL // reference. Throw a forward request exception. - CORBA::Object_ptr dup = - CORBA::Object::_duplicate (object_reference); + // CORBA::Object_ptr dup = + // CORBA::Object::_duplicate (object_reference); // @@ We could simply write the response at this point... - ACE_TRY_THROW (PortableServer::ForwardRequest (dup)); + ACE_TRY_THROW (PortableServer::ForwardRequest (object_reference.in ())); } #endif /* TAO_NO_IOR_TABLE */ @@ -633,14 +579,14 @@ TAO_GIOP_Message_Lite:: { // Make the GIOP header and Reply header this->make_reply (request_id, - output); + this->output_); - output.write_ulong (TAO_GIOP_LOCATION_FORWARD); + this->output_.write_ulong (TAO_GIOP_LOCATION_FORWARD); CORBA::Object_ptr object_ptr = forward_request.forward_reference.in(); - output << object_ptr; + this->output_ << object_ptr; // Flag for code below catch blocks. location_forward = 1; @@ -742,7 +688,7 @@ TAO_GIOP_Message_Lite:: || (sync_with_server && location_forward)) { result = this->send_message (transport, - output); + this->output_); if (result == -1) { @@ -765,8 +711,7 @@ int TAO_GIOP_Message_Lite:: process_connector_locate (TAO_Transport *transport, TAO_ORB_Core* orb_core, - TAO_InputCDR &input, - TAO_OutputCDR &output) + TAO_InputCDR &input) { // Get the revision info TAO_GIOP_Version version (TAO_DEF_GIOP_MAJOR, @@ -941,7 +886,7 @@ TAO_GIOP_Message_Lite:: return this->make_locate_reply (transport, - output, + this->output_, locate_request, status_info); } @@ -1050,25 +995,7 @@ TAO_GIOP_Message_Lite:: return hdr_status ? 0 : -1; } -CORBA::Boolean -TAO_GIOP_Message_Lite:: - make_reply (CORBA::ULong request_id, - TAO_OutputCDR &output) -{ - // Write the GIOP header first - this->write_protocol_header (TAO_PLUGGABLE_MESSAGE_REPLY, - output); - - // create and write a dummy context - IOP::ServiceContextList resp_ctx; - resp_ctx.length (0); - output << resp_ctx; - // Write the request ID - output.write_ulong (request_id); - - return 0; -} int TAO_GIOP_Message_Lite:: @@ -1105,7 +1032,7 @@ TAO_GIOP_Message_Lite:: ACE_TRY { // Write the exception - CORBA::TypeCode_ptr except_tc = x->_type (); + // CORBA::TypeCode_ptr except_tc = x->_type (); CORBA::exception_type extype = CORBA::USER_EXCEPTION; @@ -1117,13 +1044,15 @@ TAO_GIOP_Message_Lite:: output.write_ulong (TAO_GIOP_Utils::convert_CORBA_to_GIOP_exception (extype)); + x->_tao_encode (output, ACE_TRY_ENV); + ACE_TRY_CHECK; // @@ Any way to implement this without interpretive // marshaling??? - output.encode (except_tc, + /* output.encode (except_tc, x, 0, ACE_TRY_ENV); - ACE_TRY_CHECK; + ACE_TRY_CHECK; */ } ACE_CATCH (CORBA_Exception, ex) { diff --git a/TAO/tao/GIOP_Message_Lite.h b/TAO/tao/GIOP_Message_Lite.h index f0a1af08b07..9ae76b81a4b 100644 --- a/TAO/tao/GIOP_Message_Lite.h +++ b/TAO/tao/GIOP_Message_Lite.h @@ -33,7 +33,7 @@ class TAO_Export TAO_GIOP_Message_Lite : // interface. Implmenetation may not vary much too. But we are // having a seperate interface to have seperation of concerns. public: - TAO_GIOP_Message_Lite (void); + TAO_GIOP_Message_Lite (TAO_ORB_Core *orb_core); //Ctor virtual ~TAO_GIOP_Message_Lite (void); @@ -92,8 +92,7 @@ private: int process_connector_request (TAO_Transport *transport, TAO_ORB_Core* orb_core, - TAO_InputCDR &input, - TAO_OutputCDR &output); + TAO_InputCDR &input); // A request was received on the server side. <transport> is the // source of the message (and thus where the replies should be // sent). <orb_core> is the ORB that received the message <input> @@ -104,8 +103,7 @@ private: int process_connector_locate (TAO_Transport *transport, TAO_ORB_Core* orb_core, - TAO_InputCDR &input, - TAO_OutputCDR &output); + TAO_InputCDR &input); // A LocateRequest was received on the server side. <transport> is // the source of the message (and thus where the replies should be // sent). <orb_core> is the ORB that received the message <input> @@ -143,8 +141,12 @@ private: const u_char *ptr, size_t len); // Print out the contents of the buffer. - + TAO_OutputCDR output_; + // The output cdr for the GIOP lite message + + char repbuf_[ACE_CDR::DEFAULT_BUFSIZE]; + // Char array to initialise our Output CDR class }; diff --git a/TAO/tao/GIOP_Message_Lite.i b/TAO/tao/GIOP_Message_Lite.i index 4a0148c8e46..a3119f47c4e 100644 --- a/TAO/tao/GIOP_Message_Lite.i +++ b/TAO/tao/GIOP_Message_Lite.i @@ -1,2 +1,70 @@ //$Id$ +ACE_INLINE CORBA::Boolean +TAO_GIOP_Message_Lite:: + write_locate_request_header (CORBA::ULong request_id, + TAO_Target_Specification &spec, + TAO_OutputCDR &msg) +{ + msg << request_id; + + // In this case we cannot recognise anything other than the Object + // key as the address disposition variable. But we do a sanity check + // anyway. + const TAO_ObjectKey *key = spec.object_key (); + if (key) + { + // Put in the object key + msg << *key; + } + else + { + if (TAO_debug_level) + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("(%N |%l) Unable to handle this request \n"))); + return 0; + } + + + return 1; +} + +ACE_INLINE int +TAO_GIOP_Message_Lite::parse_header (TAO_GIOP_Message_State *state) +{ + // Get the read pointer + char *buf = state->cdr.rd_ptr (); + + state->byte_order = TAO_ENCAP_BYTE_ORDER; + state->giop_version.major = TAO_DEF_GIOP_MAJOR; + state->giop_version.minor = TAO_DEF_GIOP_MINOR; + state->message_type = buf[TAO_GIOP_LITE_MESSAGE_TYPE_OFFSET]; + + state->cdr.reset_byte_order (state->byte_order); + state->cdr.read_ulong (state->message_size); + + return 0; +} + +ACE_INLINE CORBA::Boolean +TAO_GIOP_Message_Lite:: + make_reply (CORBA::ULong request_id, + TAO_OutputCDR &output) +{ + // Write the GIOP header first + this->write_protocol_header (TAO_PLUGGABLE_MESSAGE_REPLY, + output); + + // create and write a dummy context + // We dont really need this. But for some reason the reply is not + // parsable on the receiving side? + // @@Bala, look in to this + IOP::ServiceContextList resp_ctx; + resp_ctx.length (0); + output << resp_ctx; + + // Write the request ID + output.write_ulong (request_id); + + return 0; +} diff --git a/TAO/tao/GIOP_Server_Request.cpp b/TAO/tao/GIOP_Server_Request.cpp index d9dd357be29..43b219a410b 100644 --- a/TAO/tao/GIOP_Server_Request.cpp +++ b/TAO/tao/GIOP_Server_Request.cpp @@ -94,8 +94,8 @@ TAO_GIOP_ServerRequest:: operation_ (operation), incoming_ (0), outgoing_ (&output), - sync_with_server_ (0), response_expected_ (response_expected), + sync_with_server_ (0), lazy_evaluation_ (0), #if !defined (TAO_HAS_MINIMUM_CORBA) diff --git a/TAO/tao/GIOP_Utils.cpp b/TAO/tao/GIOP_Utils.cpp index d97d5d2e3b3..f4a5257e377 100644 --- a/TAO/tao/GIOP_Utils.cpp +++ b/TAO/tao/GIOP_Utils.cpp @@ -183,18 +183,27 @@ TAO_GIOP_Reply_Status_Type TAO_GIOP_Utils:: convert_CORBA_to_GIOP_exception (CORBA::exception_type corba_type) { + switch (corba_type) { case CORBA::NO_EXCEPTION: + ACE_DEBUG ((LM_DEBUG, + "(%N|%l) \n")); return TAO_GIOP_NO_EXCEPTION; case CORBA::SYSTEM_EXCEPTION: + ACE_DEBUG ((LM_DEBUG, + "(%N|%l) \n")); return TAO_GIOP_SYSTEM_EXCEPTION; case CORBA::USER_EXCEPTION: + ACE_DEBUG ((LM_DEBUG, + "(%N|%l) \n")); return TAO_GIOP_USER_EXCEPTION; default: + ACE_DEBUG ((LM_DEBUG, + "(%N|%l) \n")); // Don't know what to do here?? return TAO_GIOP_SYSTEM_EXCEPTION; } diff --git a/TAO/tao/IIOP_Connect.cpp b/TAO/tao/IIOP_Connect.cpp index 3c71c926911..963eff518bd 100644 --- a/TAO/tao/IIOP_Connect.cpp +++ b/TAO/tao/IIOP_Connect.cpp @@ -97,7 +97,7 @@ TAO_IIOP_Server_Connection_Handler::TAO_IIOP_Server_Connection_Handler (TAO_ORB_ if (lite_flag_) { ACE_NEW (this->acceptor_factory_, - TAO_GIOP_Message_Lite); + TAO_GIOP_Message_Lite (orb_core)); } else { diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp index 30131f90af0..949ae2937ac 100644 --- a/TAO/tao/IIOP_Transport.cpp +++ b/TAO/tao/IIOP_Transport.cpp @@ -130,7 +130,10 @@ TAO_IIOP_Client_Transport:: : TAO_IIOP_Transport (handler, orb_core), client_handler_ (handler), - client_mesg_factory_ (0) + client_mesg_factory_ (0), + orb_core_ (orb_core), + lite_flag_ (0), + params_ () { } @@ -321,7 +324,7 @@ TAO_IIOP_Client_Transport::messaging_init (CORBA::Octet major, if (this->lite_flag_) { ACE_NEW_RETURN (this->client_mesg_factory_, - TAO_GIOP_Message_Lite, + TAO_GIOP_Message_Lite (this->orb_core_), -1); } else if (major == TAO_DEF_GIOP_MAJOR) diff --git a/TAO/tao/IIOP_Transport.h b/TAO/tao/IIOP_Transport.h index 290e882c2bc..08a2adf3e0b 100644 --- a/TAO/tao/IIOP_Transport.h +++ b/TAO/tao/IIOP_Transport.h @@ -155,11 +155,14 @@ public: private: TAO_IIOP_Client_Connection_Handler *client_handler_; // pointer to the corresponding client side connection handler. - + TAO_Pluggable_Messaging_Interface *client_mesg_factory_; // The message_factor instance specific for this particular // transport protocol. + TAO_ORB_Core *orb_core_; + // Our ORB core + CORBA::Boolean lite_flag_; // Are we using lite? diff --git a/TAO/tao/SHMIOP_Connect.cpp b/TAO/tao/SHMIOP_Connect.cpp index 0aa4bccffe8..5f447825277 100644 --- a/TAO/tao/SHMIOP_Connect.cpp +++ b/TAO/tao/SHMIOP_Connect.cpp @@ -96,7 +96,7 @@ TAO_SHMIOP_Server_Connection_Handler::TAO_SHMIOP_Server_Connection_Handler (TAO_ if (lite_flag_) { ACE_NEW (this->acceptor_factory_, - TAO_GIOP_Message_Lite); + TAO_GIOP_Message_Lite (orb_core)); } else { diff --git a/TAO/tao/SHMIOP_Transport.cpp b/TAO/tao/SHMIOP_Transport.cpp index f66d228c5ee..a346fa5fe74 100644 --- a/TAO/tao/SHMIOP_Transport.cpp +++ b/TAO/tao/SHMIOP_Transport.cpp @@ -126,7 +126,11 @@ TAO_SHMIOP_Client_Transport:: TAO_ORB_Core *orb_core) : TAO_SHMIOP_Transport (handler, orb_core), - client_handler_ (handler) + client_handler_ (handler), + client_mesg_factory_ (0), + orb_core_ (orb_core), + lite_flag_ (0), + params_ () { } @@ -314,7 +318,7 @@ TAO_SHMIOP_Client_Transport::messaging_init (CORBA::Octet major, if (this->lite_flag_) { ACE_NEW_RETURN (this->client_mesg_factory_, - TAO_GIOP_Message_Lite, + TAO_GIOP_Message_Lite (this->orb_core_), -1); } else if (major == TAO_DEF_GIOP_MAJOR) diff --git a/TAO/tao/SHMIOP_Transport.h b/TAO/tao/SHMIOP_Transport.h index c6702801247..8216336a303 100644 --- a/TAO/tao/SHMIOP_Transport.h +++ b/TAO/tao/SHMIOP_Transport.h @@ -158,6 +158,9 @@ private: // The message_factor instance specific for this particular // transport protocol. + TAO_ORB_Core *orb_core_; + // Our ORB core + CORBA::Boolean lite_flag_; // Are we using lite? diff --git a/TAO/tao/UIOP_Connect.cpp b/TAO/tao/UIOP_Connect.cpp index e159bfbd159..c11308ff822 100644 --- a/TAO/tao/UIOP_Connect.cpp +++ b/TAO/tao/UIOP_Connect.cpp @@ -100,7 +100,7 @@ TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (TAO_ORB_ if (lite_flag_) { ACE_NEW (this->acceptor_factory_, - TAO_GIOP_Message_Lite); + TAO_GIOP_Message_Lite (orb_core)); } else { diff --git a/TAO/tao/UIOP_Transport.cpp b/TAO/tao/UIOP_Transport.cpp index 7b64fc34cf3..8137513472f 100644 --- a/TAO/tao/UIOP_Transport.cpp +++ b/TAO/tao/UIOP_Transport.cpp @@ -132,7 +132,10 @@ TAO_UIOP_Client_Transport:: TAO_ORB_Core *orb_core) : TAO_UIOP_Transport (handler, orb_core), client_handler_ (handler), - client_mesg_factory_ (0) + client_mesg_factory_ (0), + orb_core_ (orb_core), + lite_flag_ (0), + params_ () { } @@ -328,7 +331,7 @@ TAO_UIOP_Client_Transport:: if (this->lite_flag_) { ACE_NEW_RETURN (this->client_mesg_factory_, - TAO_GIOP_Message_Lite, + TAO_GIOP_Message_Lite (this->orb_core_), -1); } else if (major == TAO_DEF_GIOP_MAJOR) diff --git a/TAO/tao/UIOP_Transport.h b/TAO/tao/UIOP_Transport.h index 32740e3bbdf..9415f7a541c 100644 --- a/TAO/tao/UIOP_Transport.h +++ b/TAO/tao/UIOP_Transport.h @@ -168,6 +168,9 @@ private: TAO_Pluggable_Messaging_Interface *client_mesg_factory_; // The message_factor instance specific for this particular // transport protocol. + + TAO_ORB_Core *orb_core_; + // Our orb Core CORBA::Boolean lite_flag_; // We using GIOP lite? |