summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-01-17 22:29:11 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-01-17 22:29:11 +0000
commitbffe9e8dac6bbdc2a43b0b13751c82243c6e891f (patch)
tree935f8ad601067632fc175d827c2cfc7d434ee80c
parentca4f5f62a50d6e057702a504d7440d0f4c90a7bf (diff)
downloadATCD-bffe9e8dac6bbdc2a43b0b13751c82243c6e891f.tar.gz
ChangeLogTag:Sun Jan 17 16:15:10 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r--TAO/ChangeLog-99c10
-rw-r--r--TAO/tao/GIOP.cpp42
-rw-r--r--TAO/tao/GIOP.h8
3 files changed, 42 insertions, 18 deletions
diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c
index 166123557a9..3d7db6e544a 100644
--- a/TAO/ChangeLog-99c
+++ b/TAO/ChangeLog-99c
@@ -1,3 +1,13 @@
+Sun Jan 17 16:15:10 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
+
+ * tao/GIOP.h:
+ * tao/GIOP.cpp:
+ Checked the return value of some send_n() calls, at least to
+ print appropiate debug messages if TAO_orbdebug is not 0.
+ Also added constants to document the size of the IIOP_Lite
+ header (vs. the GIOP header) and the offset of the message size
+ in the GIOP and the IIOP_Lite headers.
+
Sun Jan 17 15:51:39 1999 Vishal Kachroo <vishal@merengue.cs.wustl.edu>
* orbsvcs/Time_Service/Time_Service_Server.dsp: Added the generated
diff --git a/TAO/tao/GIOP.cpp b/TAO/tao/GIOP.cpp
index dd7915fe460..7c13351a94f 100644
--- a/TAO/tao/GIOP.cpp
+++ b/TAO/tao/GIOP.cpp
@@ -208,16 +208,12 @@ TAO_GIOP::send_request (TAO_SVC_HANDLER *handler,
// this particular environment and that isn't handled by the
// networking infrastructure (e.g., IPSEC).
- size_t offset = 8;
- // @@ Carlos, can you please make this more "abstract" rather
- // than hard-coding it to 8!!!
size_t header_len = TAO_GIOP_HEADER_LEN;
+ size_t offset = TAO_GIOP_MESSAGE_SIZE_OFFSET;
if (orb_core->orb_params ()->use_IIOP_lite_protocol ())
{
- offset = 0;
- // @@ Carlos, can you please make this more "abstract" rather
- // than hard-coding it to 5!!!
- header_len = 5;
+ header_len = TAO_IIOP_LITE_HEADER_LEN;
+ offset = TAO_IIOP_LITE_MESSAGE_SIZE_OFFSET;
}
CORBA::ULong bodylen = buflen - header_len;
@@ -360,14 +356,19 @@ TAO_GIOP::close_connection (TAO_Client_Connection_Handler *&handler,
// @@ should recv and discard queued data for portability; note
// that this won't block (long) since we never set SO_LINGER
- TAO_GIOP::dump_msg ("send",
+ TAO_GIOP::dump_msg ("close_connection",
(const u_char *) close_message,
TAO_GIOP_HEADER_LEN);
- // @@ Carlos, can you please check the return value on this?
- handler->peer ().send (close_message,
- TAO_GIOP_HEADER_LEN);
ACE_HANDLE which = handler->peer ().get_handle ();
+ if (handler->peer ().send_n (close_message,
+ TAO_GIOP_HEADER_LEN) == -1)
+ {
+ if (TAO_orbdebug)
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) error closing connection %d\n",
+ which));
+ }
handler->handle_close ();
handler = 0;
ACE_DEBUG ((LM_DEBUG,
@@ -395,19 +396,24 @@ error_message [TAO_GIOP_HEADER_LEN] =
void
TAO_GIOP::send_error (TAO_SVC_HANDLER *&handler)
{
- TAO_GIOP::dump_msg ("send",
+ TAO_GIOP::dump_msg ("send_error",
(const u_char *) error_message,
TAO_GIOP_HEADER_LEN);
- // @@ Carlos, can you please check to see if <send_n> should have
- // it's reply checked?
- handler->peer ().send_n (error_message,
- TAO_GIOP_HEADER_LEN);
+ ACE_HANDLE which = handler->peer ().get_handle ();
+ if (handler->peer ().send_n (error_message,
+ TAO_GIOP_HEADER_LEN) == -1)
+ {
+ if (TAO_orbdebug != 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) error sending error to %d\n",
+ which));
+
+ }
if (TAO_orbdebug)
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) aborted socket %d\n",
- handler->peer ().get_handle ()));
-// handler->handle_close ();
+ which));
handler = 0;
}
diff --git a/TAO/tao/GIOP.h b/TAO/tao/GIOP.h
index ca91fcc9eb0..fa234570eb4 100644
--- a/TAO/tao/GIOP.h
+++ b/TAO/tao/GIOP.h
@@ -161,6 +161,14 @@ public:
// @@ - I made this explicitly 12 (ASG)
#define TAO_GIOP_HEADER_LEN 12
+// The offset the message_size field inside the GIOP HEADER
+#define TAO_GIOP_MESSAGE_SIZE_OFFSET 8
+
+// The IIOP Lite header length and the offset of the message size
+// field in it.
+#define TAO_IIOP_LITE_HEADER_LEN 5
+#define TAO_IIOP_LITE_MESSAGE_SIZE_OFFSET 0
+
// Support for Implicit ORB Service Context.
typedef CORBA::ULong TAO_GIOP_ServiceID;