diff options
author | bala <balanatarajan@users.noreply.github.com> | 2000-03-01 18:32:39 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2000-03-01 18:32:39 +0000 |
commit | f444bfbd5a5345c7b8b2ae46189e5f15183fd23b (patch) | |
tree | 2e9d466298769177d7b4fa1eac3a29b4680b8278 | |
parent | ae9d3630b47d4b5c1325590453eb7bcf6812cd2e (diff) | |
download | ATCD-f444bfbd5a5345c7b8b2ae46189e5f15183fd23b.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/tao/GIOP_Message_Acceptors.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/GIOP_Message_Base.cpp | 52 | ||||
-rw-r--r-- | TAO/tao/GIOP_Message_Base.h | 9 | ||||
-rw-r--r-- | TAO/tao/GIOP_Message_Base.i | 19 | ||||
-rw-r--r-- | TAO/tao/GIOP_Message_Connectors.cpp | 8 |
5 files changed, 52 insertions, 40 deletions
diff --git a/TAO/tao/GIOP_Message_Acceptors.cpp b/TAO/tao/GIOP_Message_Acceptors.cpp index af112ee2363..6f3499640ad 100644 --- a/TAO/tao/GIOP_Message_Acceptors.cpp +++ b/TAO/tao/GIOP_Message_Acceptors.cpp @@ -553,9 +553,9 @@ TAO_GIOP_Message_Acceptors:: { char *buf = state->cdr.rd_ptr (); CORBA::Octet incoming_major = - buf[this->major_version_offset ()]; + buf[TAO_GIOP_VERSION_MAJOR_OFFSET]; CORBA::Octet incoming_minor = - buf[this->minor_version_offset ()]; + buf[TAO_GIOP_VERSION_MINOR_OFFSET]; if (this->implementations_.check_revision (incoming_major, incoming_minor) == 0) diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp index 45fcdb3792b..0d59a051853 100644 --- a/TAO/tao/GIOP_Message_Base.cpp +++ b/TAO/tao/GIOP_Message_Base.cpp @@ -129,10 +129,10 @@ TAO_GIOP_Message_Base::send_message (TAO_Transport *transport, int two_way) { // Get the header length - const size_t header_len = this->header_len (); + const size_t header_len = TAO_GIOP_MESSAGE_HEADER_LEN ; // Get the message size offset - const size_t offset = this->message_size_offset (); + const size_t offset = TAO_GIOP_MESSAGE_SIZE_OFFSET; // Ptr to first buffer. char *buf = (char *) stream.buffer (); @@ -165,11 +165,13 @@ TAO_GIOP_Message_Base::send_message (TAO_Transport *transport, // Strictly speaking, should not need to loop here because the // socket never gets set to a nonblocking mode ... some Linux // versions seem to need it though. Leaving it costs little. - this->dump_msg ("send", - ACE_reinterpret_cast (u_char *, - buf), - stream.length ()); - + if (TAO_debug_level > 2) + { + this->dump_msg ("send", + ACE_reinterpret_cast (u_char *, + buf), + stream.length ()); + } return this->transport_message (transport, stream, two_way, @@ -193,7 +195,7 @@ TAO_GIOP_Message_Base:: int retval = TAO_GIOP_Utils::read_bytes_input (transport, state->cdr, - this->header_len (), + TAO_GIOP_MESSAGE_HEADER_LEN , max_wait_time); if (retval == -1 && TAO_debug_level > 0) { @@ -224,7 +226,7 @@ TAO_GIOP_Message_Base:: return -1; } - if (state->cdr.grow (this->header_len () + + if (state->cdr.grow (TAO_GIOP_MESSAGE_HEADER_LEN + state->message_size) == -1) { if (TAO_debug_level > 0) @@ -237,7 +239,7 @@ TAO_GIOP_Message_Base:: // Growing the buffer may have reset the rd_ptr(), but we want // to leave it just after the GIOP header (that was parsed // already); - state->cdr.skip_bytes (this->header_len ()); + state->cdr.skip_bytes (TAO_GIOP_MESSAGE_HEADER_LEN ); } size_t missing_data = @@ -274,7 +276,7 @@ TAO_GIOP_Message_Base:: { if (TAO_debug_level >= 4) { - size_t header_len = this->header_len (); + size_t header_len = TAO_GIOP_MESSAGE_HEADER_LEN ; // Need to include GIOPlite too. char *buf = state->cdr.rd_ptr (); @@ -312,23 +314,23 @@ TAO_GIOP_Message_Base::dump_msg (const char *label, { // Message name. const char *message_name = "UNKNOWN MESSAGE"; - u_long slot = ptr[this->message_type_offset ()]; + u_long slot = ptr[TAO_GIOP_MESSAGE_TYPE_OFFSET]; if (slot < sizeof (names)/sizeof(names[0])) message_name = names [slot]; // Byte order. - int byte_order = ptr[this->flags_offset ()] & 0x01; + int byte_order = ptr[TAO_GIOP_MESSAGE_FLAGS_OFFSET] & 0x01; // request/reply id. CORBA::ULong tmp = 0; CORBA::ULong *id = &tmp; - if (ptr[this->message_type_offset ()] == TAO_GIOP_REQUEST || - ptr[this->message_type_offset ()] == TAO_GIOP_REPLY) + if (ptr[TAO_GIOP_MESSAGE_TYPE_OFFSET] == TAO_GIOP_REQUEST || + ptr[TAO_GIOP_MESSAGE_TYPE_OFFSET] == TAO_GIOP_REPLY) { // @@ Only works if ServiceContextList is empty.... id = ACE_reinterpret_cast (CORBA::ULong *, - (char * ) (ptr + this->header_len () + 4)); + (char * ) (ptr + TAO_GIOP_MESSAGE_HEADER_LEN + 4)); } // Print. @@ -336,9 +338,9 @@ TAO_GIOP_Message_Base::dump_msg (const char *label, ASYS_TEXT ("(%P | %t):%s GIOP v%c.%c msg, ") ASYS_TEXT ("%d data bytes, %s endian, %s = %d\n"), label, - digits[ptr[this->major_version_offset ()]], - digits[ptr[this->minor_version_offset ()]], - len - this->header_len (), + digits[ptr[TAO_GIOP_VERSION_MAJOR_OFFSET]], + digits[ptr[TAO_GIOP_VERSION_MINOR_OFFSET]], + len - TAO_GIOP_MESSAGE_HEADER_LEN , (byte_order == TAO_ENCAP_BYTE_ORDER) ? "my" : "other", message_name, *id)); @@ -356,7 +358,7 @@ int TAO_GIOP_Message_Base::send_error (TAO_Transport *transport) { const char - error_message [TAO_GIOP_HEADER_LEN] = + error_message [TAO_GIOP_MESSAGE_HEADER_LEN] = { // The following works on non-ASCII platforms, such as MVS (which // uses EBCDIC). @@ -376,12 +378,12 @@ TAO_GIOP_Message_Base::send_error (TAO_Transport *transport) this->dump_msg ("send_error", (const u_char *) error_message, - this->header_len ()); + TAO_GIOP_MESSAGE_HEADER_LEN ); ACE_HANDLE which = transport->handle (); int result = transport->send ((const u_char *)error_message, - this->header_len ()); + TAO_GIOP_MESSAGE_HEADER_LEN ); if (result == -1) { if (TAO_debug_level > 0) @@ -418,7 +420,7 @@ TAO_GIOP_Message_Base:: // static CORBA::Octet // I hate this in every method. Till the time I figure out a way // around I will have them here hanging around. - const char close_message [TAO_GIOP_HEADER_LEN] = + const char close_message [TAO_GIOP_MESSAGE_HEADER_LEN] = { // The following works on non-ASCII platforms, such as MVS (which // uses EBCDIC). @@ -441,7 +443,7 @@ TAO_GIOP_Message_Base:: this->dump_msg ("send_close_connection", (const u_char *) close_message, - TAO_GIOP_HEADER_LEN); + TAO_GIOP_MESSAGE_HEADER_LEN); ACE_HANDLE which = transport->handle (); if (which == ACE_INVALID_HANDLE) @@ -454,7 +456,7 @@ TAO_GIOP_Message_Base:: } if (transport->send ((const u_char *) close_message, - TAO_GIOP_HEADER_LEN) == -1) + TAO_GIOP_MESSAGE_HEADER_LEN) == -1) { if (TAO_orbdebug) ACE_ERROR ((LM_ERROR, diff --git a/TAO/tao/GIOP_Message_Base.h b/TAO/tao/GIOP_Message_Base.h index 3945ab26ef8..155f0605ca4 100644 --- a/TAO/tao/GIOP_Message_Base.h +++ b/TAO/tao/GIOP_Message_Base.h @@ -79,6 +79,12 @@ public: // passed on to the appropriate states. protected: + +#if 0 + // It would be really cool to have something like this. But, as they + // are along the critical path such fancy stuff results in reduced + // performance. But let it me here till we get to a time where in we + // are forced to use these methods const size_t header_len (void); // This will give the size of the header for different versions of // GIOP. @@ -104,6 +110,7 @@ protected: // versions of GIOP // @@The above methods may not be required. But we have it for a // later date use wherein things can changes in GIOP +#endif /*if 0*/ int send_error (TAO_Transport *transport); // Send error messages @@ -146,7 +153,7 @@ private: // Close a connection, first sending GIOP::CloseConnection. }; -const size_t TAO_GIOP_HEADER_LEN = 12; +const size_t TAO_GIOP_MESSAGE_HEADER_LEN = 12; const size_t TAO_GIOP_MESSAGE_SIZE_OFFSET = 8; const size_t TAO_GIOP_VERSION_MINOR_OFFSET = 5; const size_t TAO_GIOP_VERSION_MAJOR_OFFSET = 4; diff --git a/TAO/tao/GIOP_Message_Base.i b/TAO/tao/GIOP_Message_Base.i index b4807d45ff1..5b1d898f6dd 100644 --- a/TAO/tao/GIOP_Message_Base.i +++ b/TAO/tao/GIOP_Message_Base.i @@ -4,10 +4,11 @@ // // GIOP_Message_Base // +# if 0 ACE_INLINE const size_t TAO_GIOP_Message_Base::header_len (void) { - return TAO_GIOP_HEADER_LEN; + return TAO_GIOP_MESSAGE_HEADER_LEN; } ACE_INLINE const size_t @@ -40,6 +41,8 @@ TAO_GIOP_Message_Base::message_type_offset (void) return TAO_GIOP_MESSAGE_TYPE_OFFSET; } +#endif /*if 0*/ + ACE_INLINE int TAO_GIOP_Message_Base::parse_magic_bytes ( @@ -88,7 +91,7 @@ TAO_GIOP_Message_Base::parse_header (TAO_GIOP_Message_State *state) if (this->minor_version () == 0 && this->major_version () == 1) { - state->byte_order = buf[this->flags_offset ()]; + state->byte_order = buf[TAO_GIOP_MESSAGE_FLAGS_OFFSET]; if (TAO_debug_level > 2 && state->byte_order != 0 && state->byte_order != 1) { @@ -102,17 +105,17 @@ TAO_GIOP_Message_Base::parse_header (TAO_GIOP_Message_State *state) else { state->byte_order = - (CORBA::Octet) (buf[this->flags_offset ()]& 0x01); + (CORBA::Octet) (buf[TAO_GIOP_MESSAGE_FLAGS_OFFSET]& 0x01); state->more_fragments = - (CORBA::Octet) (buf[this->flags_offset ()]& 0x02); + (CORBA::Octet) (buf[TAO_GIOP_MESSAGE_FLAGS_OFFSET]& 0x02); if (TAO_debug_level > 2 - && (buf[this->flags_offset ()] & ~0x3) != 0) + && (buf[TAO_GIOP_MESSAGE_FLAGS_OFFSET] & ~0x3) != 0) { ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("TAO (%P|%t) invalid flags for <%d>") ASYS_TEXT (" for version <%d %d> \n"), - buf[this->flags_offset ()], + buf[TAO_GIOP_MESSAGE_FLAGS_OFFSET], this->major_version (), this->minor_version ())); return -1; @@ -120,13 +123,13 @@ TAO_GIOP_Message_Base::parse_header (TAO_GIOP_Message_State *state) } // Get the message type - state->message_type = buf[this->message_type_offset ()]; + state->message_type = buf[TAO_GIOP_MESSAGE_TYPE_OFFSET]; // Reset our input CDR stream state->cdr.reset_byte_order (state->byte_order); - state->cdr.skip_bytes (this->message_size_offset ()); + state->cdr.skip_bytes (TAO_GIOP_MESSAGE_SIZE_OFFSET); state->cdr.read_ulong (state->message_size); if (TAO_debug_level > 2) diff --git a/TAO/tao/GIOP_Message_Connectors.cpp b/TAO/tao/GIOP_Message_Connectors.cpp index 9cbeec4355d..04e3855365d 100644 --- a/TAO/tao/GIOP_Message_Connectors.cpp +++ b/TAO/tao/GIOP_Message_Connectors.cpp @@ -100,12 +100,12 @@ TAO_GIOP_Message_Connectors::validate_version (TAO_GIOP_Message_State *state) // Grab the read pointer char *buf = state->cdr.rd_ptr (); - if ((buf[this->major_version_offset ()] != this->major_version ()) || - (buf[this->minor_version_offset ()] != this->minor_version ())) + if ((buf[TAO_GIOP_VERSION_MAJOR_OFFSET] != this->major_version ()) || + (buf[TAO_GIOP_VERSION_MINOR_OFFSET] != this->minor_version ())) return -1; - state->giop_version.major = buf[this->major_version_offset ()]; - state->giop_version.minor = buf[this->minor_version_offset ()]; + state->giop_version.major = buf[TAO_GIOP_VERSION_MAJOR_OFFSET]; + state->giop_version.minor = buf[TAO_GIOP_VERSION_MINOR_OFFSET]; return 0; } |