diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2006-08-15 14:03:18 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2006-08-15 14:03:18 +0000 |
commit | 77fd02eb77c16bf4eadc10ad8896ab5bccf34a34 (patch) | |
tree | e0ed7f6c225de2813a405d450b46efc683a3f7aa /TAO/tao | |
parent | 654c9765d4d42afb68e51d35071e2929244f1c26 (diff) | |
download | ATCD-77fd02eb77c16bf4eadc10ad8896ab5bccf34a34.tar.gz |
ChangeLogTag: Tue Aug 15 14:02:23 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/CSD_Framework/CSD_FW_Server_Request_Wrapper.cpp | 95 |
1 files changed, 49 insertions, 46 deletions
diff --git a/TAO/tao/CSD_Framework/CSD_FW_Server_Request_Wrapper.cpp b/TAO/tao/CSD_Framework/CSD_FW_Server_Request_Wrapper.cpp index 48d4adcf556..3a6e3120650 100644 --- a/TAO/tao/CSD_Framework/CSD_FW_Server_Request_Wrapper.cpp +++ b/TAO/tao/CSD_Framework/CSD_FW_Server_Request_Wrapper.cpp @@ -336,58 +336,61 @@ TAO::CSD::FW_Server_Request_Wrapper::clone (TAO_Operation_Details const *& from, // use the marshaling technique to copy the arguments TAO::Argument** cloned_args = 0; CORBA::ULong num_cloned_args = 0; - TAO::Argument* retval = from->args_[0]->clone(); - if (retval != 0) + if (from->num_args_ > 0) { - ACE_NEW_RETURN (cloned_args, - TAO::Argument*[from->num_args_], - false); - cloned_args[0] = retval; - for (CORBA::ULong i = 1; i < from->num_args_; i++) + TAO::Argument* retval = from->args_[0]->clone(); + if (retval != 0) { - cloned_args[i] = from->args_[i]->clone(); + ACE_NEW_RETURN (cloned_args, + TAO::Argument*[from->num_args_], + false); + cloned_args[0] = retval; + for (CORBA::ULong i = 1; i < from->num_args_; i++) + { + cloned_args[i] = from->args_[i]->clone(); + } + num_cloned_args = from->num_args_; } - num_cloned_args = from->num_args_; - } - else - { - static const size_t mb_size = 2048; - ACE_NEW_RETURN (cdr, - TAO_InputCDR (mb_size), - false); + else + { + static const size_t mb_size = 2048; + ACE_NEW_RETURN (cdr, + TAO_InputCDR (mb_size), + false); - // To avoid duplicating and copying the data block, allow the - // TAO_OutputCDR to share the data block of TAO_InputCDR's message block. - ACE_Message_Block* mb = const_cast<ACE_Message_Block*> (cdr->start ()); - TAO_OutputCDR outcdr (mb); + // To avoid duplicating and copying the data block, allow the + // TAO_OutputCDR to share the data block of TAO_InputCDR's message block. + ACE_Message_Block* mb = const_cast<ACE_Message_Block*> (cdr->start ()); + TAO_OutputCDR outcdr (mb); - if (! from_non_const->marshal_args (outcdr)) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT("(%P|%T) TAO::CSD::FW_Server_Request_Wrapper::") - ACE_TEXT("clone TAO_Operation_Details failed\n"))); - return false; - } + if (! from_non_const->marshal_args (outcdr)) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT("(%P|%T) TAO::CSD::FW_Server_Request_Wrapper::") + ACE_TEXT("clone TAO_Operation_Details failed\n"))); + return false; + } - // The TAO_OutputCDR made a new message block around the data block - // held by the message block owned by the TAO_InputCDR. We need to - // make sure that the results of marshaling are propagated back to the - // message block in the TAO_InputCDR. - const ACE_Message_Block* begin = outcdr.begin (); - if (begin == outcdr.current ()) - { - // A chain was not made, so we can just adjust the read and write - // pointers - mb->rd_ptr (begin->rd_ptr ()); - mb->wr_ptr (begin->wr_ptr ()); - } - else - { - // A costly, but necessary, copying of data blocks. This shouldn't - // happen that often assuming that the size of the message block - // allocated during the allocation of TAO_InputCDR is "big enough" - // for most operation parameters. - cdr->reset (begin, outcdr.byte_order ()); + // The TAO_OutputCDR made a new message block around the data block + // held by the message block owned by the TAO_InputCDR. We need to + // make sure that the results of marshaling are propagated back to the + // message block in the TAO_InputCDR. + const ACE_Message_Block* begin = outcdr.begin (); + if (begin == outcdr.current ()) + { + // A chain was not made, so we can just adjust the read and write + // pointers + mb->rd_ptr (begin->rd_ptr ()); + mb->wr_ptr (begin->wr_ptr ()); + } + else + { + // A costly, but necessary, copying of data blocks. This shouldn't + // happen that often assuming that the size of the message block + // allocated during the allocation of TAO_InputCDR is "big enough" + // for most operation parameters. + cdr->reset (begin, outcdr.byte_order ()); + } } } |