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