diff options
author | msmit <msmit@remedy.nl> | 2009-03-05 07:41:07 +0000 |
---|---|---|
committer | msmit <msmit@remedy.nl> | 2009-03-05 07:41:07 +0000 |
commit | e7cfbeb6d5b7efb3c8194822743889eb8cc87ffb (patch) | |
tree | 0f4a8bf789ea1a972242c44e624a1a7368bcccf2 /TAO/tao/GIOP_Message_Base.cpp | |
parent | 90b96e68a1108ac985ae8bdfc76006735c23a1dc (diff) | |
download | ATCD-e7cfbeb6d5b7efb3c8194822743889eb8cc87ffb.tar.gz |
Thu Mar 5 07:36:08 UTC 2009 Marcel Smit <msmit@remedy.nl>
* tao/GIOP_Message_Base.cpp
* tao/GIOP_Message_Base.h
* tao/ZIOP/ZIOP.cpp
* tao/ZIOP/ZIOP.h
* tao/ZIOP_Adapter.h
Reverted last changes.
Resolved memory leak and assert error during
release of an ACE_Data_Block.
* tao/Transport.cpp
No need to set read write pointer correctly. ZIOP
is responsible for that.
* tests/ZIOP/client.cpp
Enabled all tests again
* tests/Bug_3553_Regression/Bug_3553_Regression_client.cpp
* tests/Bug_3553_Regression/Bug_3553_Regression_server.cpp
Reverted last changes. Compiler errors should be resolved.
Diffstat (limited to 'TAO/tao/GIOP_Message_Base.cpp')
-rw-r--r-- | TAO/tao/GIOP_Message_Base.cpp | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp index 447e5d49332..8157026e9cf 100644 --- a/TAO/tao/GIOP_Message_Base.cpp +++ b/TAO/tao/GIOP_Message_Base.cpp @@ -678,15 +678,13 @@ TAO_GIOP_Message_Base::process_request_message (TAO_Transport *transport, // heap. db = qd->msg_block ()->data_block ()->duplicate (); } - ACE_Data_Block *db_new = db; #if defined (TAO_HAS_ZIOP) && TAO_HAS_ZIOP ==1 - db_new = this->decompress (*db, *qd, rd_pos, wr_pos); - if (db_new == 0) + if (!this->decompress (&db, *qd, rd_pos, wr_pos)) return -1; #endif - TAO_InputCDR input_cdr (db_new, + TAO_InputCDR input_cdr (db, flg, rd_pos, wr_pos, @@ -726,30 +724,27 @@ TAO_GIOP_Message_Base::process_request_message (TAO_Transport *transport, } #if defined (TAO_HAS_ZIOP) && TAO_HAS_ZIOP ==1 -ACE_Data_Block * -TAO_GIOP_Message_Base::decompress (ACE_Data_Block& db, TAO_Queued_Data& qd, +bool +TAO_GIOP_Message_Base::decompress (ACE_Data_Block **db, TAO_Queued_Data& qd, size_t& rd_pos, size_t& wr_pos) { - ACE_Data_Block *db_new = &db; - if (qd.state().compressed ()) { TAO_ZIOP_Adapter* adapter = this->orb_core_->ziop_adapter (); if (adapter) { - db_new = adapter->decompress (db, qd, *this->orb_core_); - if (db_new == 0) - return 0; + qd.consolidate (); + if (!adapter->decompress (db, qd, *this->orb_core_)) + return false; rd_pos = TAO_GIOP_MESSAGE_HEADER_LEN; - wr_pos = db_new->size(); + wr_pos = (*db)->size(); if (TAO_debug_level >= 5) { ACE_HEX_DUMP ((LM_DEBUG, - const_cast <char*> (db_new->base ()), - db_new->size (), + const_cast <char*> ((*db)->base ()), + (*db)->size (), ACE_TEXT ("GIOP message after decompression"))); } - qd.msg_block ()->data_block (db_new); } else { @@ -758,10 +753,10 @@ TAO_GIOP_Message_Base::decompress (ACE_Data_Block& db, TAO_Queued_Data& qd, ACE_TEXT ("TAO (%P|%t) ERROR: Unable to decompress ") ACE_TEXT ("data.\n"))); - return 0; + return false; } } - return db_new; + return true; } #endif @@ -787,18 +782,16 @@ TAO_GIOP_Message_Base::process_reply_message ( } ACE_Data_Block *db = qd->msg_block ()->data_block (); - ACE_Data_Block *db_new = db; #if defined (TAO_HAS_ZIOP) && TAO_HAS_ZIOP ==1 - db_new = this->decompress (*db, *qd, rd_pos, wr_pos); - if (db_new == 0) + if (!this->decompress (&db, *qd, rd_pos, wr_pos)) return -1; #endif // Create a empty buffer on stack // NOTE: We use the same data block in which we read the message and // we pass it on to the higher layers of the ORB. So we dont to any // copies at all here. - TAO_InputCDR input_cdr (db_new, + TAO_InputCDR input_cdr (db, ACE_Message_Block::DONT_DELETE, rd_pos, wr_pos, |