diff options
author | bala <balanatarajan@users.noreply.github.com> | 2000-02-28 21:56:26 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2000-02-28 21:56:26 +0000 |
commit | 040de6f334bb21c0743a03080987c89545d6c12e (patch) | |
tree | ecb98c6baa228cad41c399415bda128e07229e6a | |
parent | fc93177553795458af9bc38553c122cf7674c9e4 (diff) | |
download | ATCD-040de6f334bb21c0743a03080987c89545d6c12e.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/tao/GIOP_Message_Acceptors.cpp | 127 | ||||
-rw-r--r-- | TAO/tao/GIOP_Message_Acceptors.h | 8 | ||||
-rw-r--r-- | TAO/tao/GIOP_Message_Acceptors.i | 117 | ||||
-rw-r--r-- | TAO/tao/GIOP_Message_Connectors.h | 14 |
4 files changed, 132 insertions, 134 deletions
diff --git a/TAO/tao/GIOP_Message_Acceptors.cpp b/TAO/tao/GIOP_Message_Acceptors.cpp index dbd5c514555..1e892280aee 100644 --- a/TAO/tao/GIOP_Message_Acceptors.cpp +++ b/TAO/tao/GIOP_Message_Acceptors.cpp @@ -1,6 +1,5 @@ //$Id$ #include "tao/GIOP_Message_Acceptors.h" -#include "tao/debug.h" #include "tao/POA.h" #if !defined (__ACE_INLINE__) @@ -151,7 +150,7 @@ TAO_GIOP_Message_Acceptors:: ACE_CATCH (PortableServer::ForwardRequest, forward_request) { // Make the GIOP header and Reply header - this->make_reply (request_id, + this->make_reply (request_id, this->output_); this->output_.write_ulong (TAO_GIOP_LOCATION_FORWARD); @@ -457,69 +456,9 @@ TAO_GIOP_Message_Acceptors:: ACE_ENDTRY; - return this->make_locate_reply (transport, - this->output_, - locate_request, - status_info); -} - - - -CORBA::Boolean -TAO_GIOP_Message_Acceptors:: - make_reply (CORBA::ULong request_id, - TAO_OutputCDR &output) -{ - // Write the GIOP header first - this->write_protocol_header (TAO_PLUGGABLE_MESSAGE_REPLY, - output); - - // Write the reply header - this->accept_state_->write_reply_header (output, - request_id); - - return 0; - -} - -int -TAO_GIOP_Message_Acceptors:: - make_locate_reply (TAO_Transport *transport, - TAO_OutputCDR & output, - TAO_GIOP_Locate_Request_Header &request, - TAO_GIOP_Locate_Status_Msg &status_info) -{ - // Note here we are making the Locate reply header which is *QUITE* - // different from the reply header made by the make_reply () call.. - - // Make the GIOP message header - this->write_protocol_header (TAO_PLUGGABLE_MESSAGE_LOCATEREPLY, - output); - - - // This writes the header & body - this->accept_state_->write_locate_reply_mesg (output, - request.request_id (), - status_info); - - - - // Send the message - int result = this->send_message (transport, - output); - - // Print out message if there is an error - if (result == -1) - { - if (TAO_debug_level > 0) - { - ACE_ERROR ((LM_ERROR, - ASYS_TEXT ("TAO: (%P|%t) %p: cannot send reply\n"), - ASYS_TEXT ("TAO_GIOP::process_server_message"))); - } - } - - return result; + return this->make_send_locate_reply (transport, + locate_request, + status_info); } @@ -596,62 +535,16 @@ TAO_GIOP_Message_Acceptors:: } -int -TAO_GIOP_Message_Acceptors:: - validate_version (TAO_GIOP_Message_State *state) +ACE_INLINE CORBA::Octet +TAO_GIOP_Message_Acceptors::major_version (void) { - char *buf = state->cdr.rd_ptr (); - CORBA::Octet incoming_major = - buf[this->major_version_offset ()]; - CORBA::Octet incoming_minor = - buf[this->minor_version_offset ()]; - - if (this->implementations_.check_revision (incoming_major, - incoming_minor) == 0) - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("TAO (%P|%t|%N|%l) bad version <%d.%d>\n"), - incoming_major, incoming_minor)); - return -1; - } - - // Sets the version - // @@Bala Need to remove this as redundant data - state->giop_version.minor = incoming_minor; - state->giop_version.major = incoming_major; - - // Sets the state - this->set_state (incoming_major, - incoming_minor); - - return 0; + return this->accept_state_->major_version (); } -void -TAO_GIOP_Message_Acceptors:: -set_state (CORBA::Octet def_major, - CORBA::Octet def_minor) +ACE_INLINE CORBA::Octet +TAO_GIOP_Message_Acceptors::minor_version (void) { - // @@Bala Need to find a better way - switch (def_major) - { - case 1: - switch (def_minor) - { - case 0: - this->accept_state_ = &this->implementations_.version_10; - break; - case 1: - this->accept_state_ = &this->implementations_.version_11; - break; - default: - break; - } - break; - default: - break; - } + return this->accept_state_->minor_version (); } diff --git a/TAO/tao/GIOP_Message_Acceptors.h b/TAO/tao/GIOP_Message_Acceptors.h index 22371cdb90e..e3459a0b106 100644 --- a/TAO/tao/GIOP_Message_Acceptors.h +++ b/TAO/tao/GIOP_Message_Acceptors.h @@ -23,6 +23,7 @@ #include "tao/GIOP_Utils.h" #include "tao/GIOP_Message_Accept_State.h" #include "tao/ORB_Core.h" +#include "tao/debug.h" class TAO_Export TAO_GIOP_Message_Acceptors: public TAO_GIOP_Message_Base @@ -81,10 +82,9 @@ private: // sensitive. Only the common stuff for all the replies to be // sent would be handled. - int make_locate_reply (TAO_Transport *transport, - TAO_OutputCDR & output, - TAO_GIOP_Locate_Request_Header &request, - TAO_GIOP_Locate_Status_Msg &status); + int make_send_locate_reply (TAO_Transport *transport, + TAO_GIOP_Locate_Request_Header &request, + TAO_GIOP_Locate_Status_Msg &status); // As on date 1.1 & 1.2 seem to have similar headers. Til an // unmanageable difference comes let them be implemented here. diff --git a/TAO/tao/GIOP_Message_Acceptors.i b/TAO/tao/GIOP_Message_Acceptors.i index 63a44f5b391..a7063d165d2 100644 --- a/TAO/tao/GIOP_Message_Acceptors.i +++ b/TAO/tao/GIOP_Message_Acceptors.i @@ -1,3 +1,4 @@ +// -*- C++ -*- //$Id$ ACE_INLINE @@ -20,14 +21,118 @@ TAO_GIOP_Message_Acceptors:: #endif /* ACE_HAS_PURIFY */ } -ACE_INLINE CORBA::Octet -TAO_GIOP_Message_Acceptors::major_version (void) + +ACE_INLINE CORBA::Boolean +TAO_GIOP_Message_Acceptors:: + make_reply (CORBA::ULong request_id, + TAO_OutputCDR &output) { - return this->accept_state_->major_version (); + // Write the GIOP header first + this->write_protocol_header (TAO_PLUGGABLE_MESSAGE_REPLY, + output); + + // Write the reply header + this->accept_state_->write_reply_header (output, + request_id); + + return 0; + } -ACE_INLINE CORBA::Octet -TAO_GIOP_Message_Acceptors::minor_version (void) +ACE_INLINE int +TAO_GIOP_Message_Acceptors:: + make_send_locate_reply (TAO_Transport *transport, + TAO_GIOP_Locate_Request_Header &request, + TAO_GIOP_Locate_Status_Msg &status_info) { - return this->accept_state_->minor_version (); + // Note here we are making the Locate reply header which is *QUITE* + // different from the reply header made by the make_reply () call.. + // Make the GIOP message header + this->write_protocol_header (TAO_PLUGGABLE_MESSAGE_LOCATEREPLY, + this->output_); + + + // This writes the header & body + this->accept_state_->write_locate_reply_mesg (this->output_, + request.request_id (), + status_info); + + // Send the message + int result = this->send_message (transport, + this->output_); + + // Print out message if there is an error + if (result == -1) + { + if (TAO_debug_level > 0) + { + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("TAO: (%P|%t) %p: cannot send reply\n"), + ASYS_TEXT ("TAO_GIOP::process_server_message"))); + } + } + + return result; } + + +ACE_INLINE int +TAO_GIOP_Message_Acceptors:: + validate_version (TAO_GIOP_Message_State *state) +{ + char *buf = state->cdr.rd_ptr (); + CORBA::Octet incoming_major = + buf[this->major_version_offset ()]; + CORBA::Octet incoming_minor = + buf[this->minor_version_offset ()]; + + if (this->implementations_.check_revision (incoming_major, + incoming_minor) == 0) + { + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("TAO (%P|%t|%N|%l) bad version <%d.%d>\n"), + incoming_major, incoming_minor)); + return -1; + } + + // Sets the version + // @@Bala Need to remove this as redundant data + state->giop_version.minor = incoming_minor; + state->giop_version.major = incoming_major; + + // Sets the state + this->set_state (incoming_major, + incoming_minor); + + return 0; +} + +ACE_INLINE void +TAO_GIOP_Message_Acceptors:: +set_state (CORBA::Octet def_major, + CORBA::Octet def_minor) +{ + // @@Bala Need to find a better way + switch (def_major) + { + case 1: + switch (def_minor) + { + case 0: + this->accept_state_ = &this->implementations_.version_10; + break; + case 1: + this->accept_state_ = &this->implementations_.version_11; + break; + default: + break; + } + break; + default: + break; + } +} + + + diff --git a/TAO/tao/GIOP_Message_Connectors.h b/TAO/tao/GIOP_Message_Connectors.h index 634408aa0cc..b1bf7a06846 100644 --- a/TAO/tao/GIOP_Message_Connectors.h +++ b/TAO/tao/GIOP_Message_Connectors.h @@ -31,13 +31,6 @@ class TAO_Export TAO_GIOP_Message_Connectors: // common code between different versions of GIOP in a single // class. - int process_connector_messages (TAO_Transport *transport, - TAO_ORB_Core *orb_core, - TAO_InputCDR &input, - CORBA::Octet message_type); - // Processes the messages from the connectors so that they can be - // passed on to the appropriate states. - protected: virtual CORBA::Boolean write_request_header (const TAO_Operation_Details &opdetails, @@ -65,6 +58,13 @@ private: // Virtual methods that will be implemented by the version specific // class. There may be a feeling that this declaration may not be // required, but some of the code in the class look for this method + + int process_connector_messages (TAO_Transport *transport, + TAO_ORB_Core *orb_core, + TAO_InputCDR &input, + CORBA::Octet message_type); + // Processes the messages from the connectors so that they can be + // passed on to the appropriate states. }; ////////////////////////////////////////////////// |