Fix forwarding async operations in buffered streams.
This commit is contained in:
parent
5bebdf6e8c
commit
6c303a2efd
@ -158,15 +158,8 @@ public:
|
||||
async_write_some(const ConstBufferSequence& buffers,
|
||||
ASIO_MOVE_ARG(WriteHandler) handler)
|
||||
{
|
||||
async_completion<WriteHandler,
|
||||
void (asio::error_code, std::size_t)> init(handler);
|
||||
|
||||
next_layer_.async_write_some(buffers,
|
||||
ASIO_MOVE_CAST(ASIO_HANDLER_TYPE(WriteHandler,
|
||||
void (asio::error_code, std::size_t)))(
|
||||
init.completion_handler));
|
||||
|
||||
return init.result.get();
|
||||
return next_layer_.async_write_some(buffers,
|
||||
ASIO_MOVE_CAST(WriteHandler)(handler));
|
||||
}
|
||||
|
||||
/// Fill the buffer with some data. Returns the number of bytes placed in the
|
||||
|
@ -193,15 +193,8 @@ public:
|
||||
async_read_some(const MutableBufferSequence& buffers,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler)
|
||||
{
|
||||
async_completion<ReadHandler,
|
||||
void (asio::error_code, std::size_t)> init(handler);
|
||||
|
||||
next_layer_.async_read_some(buffers,
|
||||
ASIO_MOVE_CAST(ASIO_HANDLER_TYPE(ReadHandler,
|
||||
void (asio::error_code, std::size_t)))(
|
||||
init.completion_handler));
|
||||
|
||||
return init.result.get();
|
||||
return next_layer_.async_read_some(buffers,
|
||||
ASIO_MOVE_CAST(ReadHandler)(handler));
|
||||
}
|
||||
|
||||
/// Peek at the incoming data on the stream. Returns the number of bytes read.
|
||||
|
Loading…
Reference in New Issue
Block a user