Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tests / GIOP_Fragments / PMB_With_Fragments / Transport.patch
blob65433d3548882ba817e4f934617567512d13147e
1 Index: Transport.cpp
2 ===================================================================
3 RCS file: /project/cvs-repository/ACE_wrappers-repository/TAO/tao/Transport.cpp,v
4 retrieving revision 1.115
5 diff -u -r1.115 Transport.cpp
6 --- Transport.cpp 7 Feb 2005 19:27:20 -0000 1.115
7 +++ Transport.cpp 21 Feb 2005 14:23:10 -0000
8 @@ -106,6 +106,29 @@
9 ACE_Log_Msg::instance ()->release ();
12 +#define TAO_DUMP_TRANSPORT_DATA
14 +#if defined (TAO_DUMP_TRANSPORT_DATA)
15 +static void
16 +dump_transport_data(size_t id,
17 + const ACE_Message_Block* message_block)
19 + char dump_path[PATH_MAX];
20 + ACE_OS::sprintf(dump_path, "transport_data_dump_%d.dat", id);
22 + ACE_HANDLE dump_out = ACE_OS::open(dump_path, O_WRONLY|O_APPEND);
23 + if (dump_out == ACE_INVALID_HANDLE) {
24 + dump_out = ACE_OS::open(dump_path, O_WRONLY|O_CREAT,
25 + ACE_DEFAULT_FILE_PERMS);
26 + }
27 + if (dump_out != ACE_INVALID_HANDLE) {
28 + ACE_OS::write(dump_out,
29 + message_block->rd_ptr (), message_block->length ());
30 + ACE_OS::close(dump_out);
31 + }
33 +#endif /* TAO_DUMP_TRANSPORT_DATA */
35 TAO_Transport::TAO_Transport (CORBA::ULong tag,
36 TAO_ORB_Core *orb_core)
37 : tag_ (tag)
38 @@ -1332,6 +1355,10 @@
39 // Set the write pointer in the stack buffer
40 message_block.wr_ptr (n);
42 +#if defined (TAO_DUMP_TRANSPORT_DATA)
43 + dump_transport_data (this->id (), &message_block);
44 +#endif /* TAO_DUMP_TRANSPORT_DATA */
46 // Parse the message and try consolidating the message if
47 // needed.
48 retval = this->parse_consolidate_messages (message_block,
49 @@ -1551,6 +1578,10 @@
51 incoming.wr_ptr (n);
52 missing_data -= n;
54 +#if defined (TAO_DUMP_TRANSPORT_DATA)
55 + dump_transport_data (this->id (), &incoming);
56 +#endif /* TAO_DUMP_TRANSPORT_DATA */
59 // If we got an error..
60 @@ -1981,6 +2012,10 @@
61 // Move the write pointer
62 qd->msg_block_->wr_ptr (n);
64 +#if defined (TAO_DUMP_TRANSPORT_DATA)
65 + dump_transport_data (this->id (), qd->msg_block_);
66 +#endif /* TAO_DUMP_TRANSPORT_DATA */
68 // Decrement the missing data
69 qd->missing_data_ -= n;