diff options
Diffstat (limited to 'ace')
-rw-r--r-- | ace/Asynch_IO.cpp | 17 | ||||
-rw-r--r-- | ace/Message_Block.cpp | 20 | ||||
-rw-r--r-- | ace/Message_Block.h | 4 | ||||
-rw-r--r-- | ace/Message_Block.i | 12 | ||||
-rw-r--r-- | ace/Proactor.cpp | 2 |
5 files changed, 24 insertions, 31 deletions
diff --git a/ace/Asynch_IO.cpp b/ace/Asynch_IO.cpp index 5bc572fa8e0..4d4c98802d4 100644 --- a/ace/Asynch_IO.cpp +++ b/ace/Asynch_IO.cpp @@ -219,6 +219,7 @@ ACE_Asynch_Operation::register_aio_with_proactor (aiocb *aiocb_ptr) // Store the pointers. this->proactor_->aiocb_list_[ai] = aiocb_ptr; this->proactor_->aiocb_list_cur_size_ ++; + return 0; } #endif /* ACE_HAS_AIO_CALLS */ @@ -1336,7 +1337,7 @@ ACE_Asynch_Transmit_Handler::ACE_Asynch_Transmit_Handler (ACE_Asynch_Transmit_Fi ACE_Asynch_Transmit_Handler::~ACE_Asynch_Transmit_Handler (void) { delete result_; - delete mb_; + mb_->release (); } // Do the transmission. @@ -1375,11 +1376,16 @@ ACE_Asynch_Transmit_Handler::transmit (void) while (!error && !this->transmit_file_done_) error = this->proactor_->handle_events (); - if (!error && this->transmit_file_done_) - // No error, transmission done. - return 0; + if (!error) + { + // No error, transmission done. + delete this; + return 0; + } else - return -1; + { + return -1; + } } void @@ -1456,7 +1462,6 @@ ACE_Asynch_Transmit_Handler::handle_write_stream (const ACE_Asynch_Write_Stream: ACE_SEH_FINALLY { transmit_file_done_ = 1; - delete this; } break; diff --git a/ace/Message_Block.cpp b/ace/Message_Block.cpp index 27e2fd95aee..1c0f00bf4c4 100644 --- a/ace/Message_Block.cpp +++ b/ace/Message_Block.cpp @@ -199,18 +199,6 @@ ACE_Message_Block::size (size_t length) if (this->data_block ()->size (length) == -1) return -1; - // Reset the read and write pointers if we've changed the underlying - // memory buffer. - else if (this->data_block ()->base () != old_base) - { - // Compute the old deltas... - int r_delta = this->rd_ptr_ - old_base; - int w_delta = this->wr_ptr_ - old_base; - - // ... and use them to initialize the new deltas. - this->rd_ptr_ = this->data_block ()->base () + r_delta; - this->wr_ptr_ = this->data_block ()->base () + w_delta; - } return 0; } @@ -711,8 +699,8 @@ ACE_Message_Block::duplicate (void) const // same relative offset as in the existing <Message_Block>. Note // that we are assuming that the data_block()->base() pointer // doesn't change when it's duplicated. - nb->rd_ptr (this->rd_ptr_ - this->data_block ()->base ()); - nb->wr_ptr (this->wr_ptr_ - this->data_block ()->base ()); + nb->rd_ptr (this->rd_ptr_); + nb->wr_ptr (this->wr_ptr_); // Increment the reference counts of all the continuation messages. if (this->cont_) @@ -807,8 +795,8 @@ ACE_Message_Block::clone (Message_Flags mask) const // Set the read and write pointers in the new <Message_Block> to the // same relative offset as in the existing <Message_Block>. - nb->rd_ptr (this->rd_ptr_ - this->data_block ()->base ()); - nb->wr_ptr (this->wr_ptr_ - this->data_block ()->base ()); + nb->rd_ptr (this->rd_ptr_); + nb->wr_ptr (this->wr_ptr_); // Clone all the continuation messages if necessary. if (this->cont () != 0 diff --git a/ace/Message_Block.h b/ace/Message_Block.h index be987b9c27d..f8e823a4514 100644 --- a/ace/Message_Block.h +++ b/ace/Message_Block.h @@ -367,10 +367,10 @@ private: ACE_Allocator *data_block_allocator); // Perform the actual initialization. - char *rd_ptr_; + size_t rd_ptr_; // Pointer to beginning of next read. - char *wr_ptr_; + size_t wr_ptr_; // Pointer to beginning of next write. u_long priority_; diff --git a/ace/Message_Block.i b/ace/Message_Block.i index 0207fbe7f1e..ff3f8152cb0 100644 --- a/ace/Message_Block.i +++ b/ace/Message_Block.i @@ -219,8 +219,8 @@ ACE_Message_Block::base (char *msg_data, Message_Flags msg_flags) { ACE_TRACE ("ACE_Message_Block::base"); - this->rd_ptr_ = msg_data; - this->wr_ptr_ = msg_data; + this->rd_ptr_ = 0; + this->wr_ptr_ = 0; this->data_block ()->base (msg_data, msg_length, msg_flags); } @@ -228,14 +228,14 @@ ACE_INLINE char * ACE_Message_Block::rd_ptr (void) const { ACE_TRACE ("ACE_Message_Block::rd_ptr"); - return this->rd_ptr_; + return this->base () + this->rd_ptr_; } ACE_INLINE void ACE_Message_Block::wr_ptr (char *new_ptr) { ACE_TRACE ("ACE_Message_Block::wr_ptr"); - this->wr_ptr_ = new_ptr; + this->wr_ptr_ = new_ptr - this->base (); } // Return a pointer to 1 past the end of the data buffer. @@ -259,7 +259,7 @@ ACE_INLINE void ACE_Message_Block::rd_ptr (char *new_ptr) { ACE_TRACE ("ACE_Message_Block::rd_ptr"); - this->rd_ptr_ = new_ptr; + this->rd_ptr_ = new_ptr - this->base (); } ACE_INLINE void @@ -273,7 +273,7 @@ ACE_INLINE char * ACE_Message_Block::wr_ptr (void) const { ACE_TRACE ("ACE_Message_Block::wr_ptr"); - return this->wr_ptr_; + return this->base () + this->wr_ptr_; } ACE_INLINE void diff --git a/ace/Proactor.cpp b/ace/Proactor.cpp index 60d5091c2cf..dcd606d19a4 100644 --- a/ace/Proactor.cpp +++ b/ace/Proactor.cpp @@ -192,7 +192,7 @@ private: ACE_AIO_Accept_Handler::ACE_AIO_Accept_Handler (ACE_Proactor *proactor) : proactor_ (proactor), - message_block_ (sizeof (ACE_Asynch_Accept::Result *)) + message_block_ (sizeof (ACE_Asynch_Accept::Result *) + 64) { // Open the pipe. this->pipe_.open (); |