diff options
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/CDR.cpp | 5 | ||||
-rw-r--r-- | TAO/tao/encode.cpp | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/TAO/tao/CDR.cpp b/TAO/tao/CDR.cpp index 27d438e665a..3e1bb59fbd9 100644 --- a/TAO/tao/CDR.cpp +++ b/TAO/tao/CDR.cpp @@ -544,12 +544,15 @@ TAO_OutputCDR::write_octet_array_mb (const ACE_Message_Block* mb) continue; } - ACE_Message_Block* cont = ACE_Message_Block::duplicate (i); + ACE_Message_Block* cont = + new ACE_Message_Block (i->data_block ()->duplicate ()); if (cont != 0) { cont->cont (this->current_->cont ()); this->current_->cont (cont); this->current_ = cont; + cont->rd_ptr (i->rd_ptr ()); + cont->wr_ptr (i->wr_ptr ()); } else { diff --git a/TAO/tao/encode.cpp b/TAO/tao/encode.cpp index 02be856670f..c721ffefc10 100644 --- a/TAO/tao/encode.cpp +++ b/TAO/tao/encode.cpp @@ -787,9 +787,10 @@ TAO_Marshal_Sequence::encode (CORBA::TypeCode_ptr tc, // less/equal to the bounds if (bounds == 0 || len <= bounds) { - bounds = len; // number of times you encode - continue_encoding = stream->write_ulong (seq->length_); - if (continue_encoding && seq->length_ != 0) + // We just encode the current elements in the sequence + bounds = len; + continue_encoding = stream->write_ulong (bounds); + if (continue_encoding && bounds != 0) { // get element typecode tc2 = tc->content_type (env); |