| 41 | template <typename SyncWriteStream, typename ConstBufferSequence, |
| 42 | typename ConstBufferIterator, typename CompletionCondition> |
| 43 | std::size_t write_buffer_sequence(SyncWriteStream& s, |
| 44 | const ConstBufferSequence& buffers, const ConstBufferIterator&, |
| 45 | CompletionCondition completion_condition, asio::error_code& ec) |
| 46 | { |
| 47 | ec = asio::error_code(); |
| 48 | asio::detail::consuming_buffers<const_buffer, |
| 49 | ConstBufferSequence, ConstBufferIterator> tmp(buffers); |
| 50 | while (!tmp.empty()) |
| 51 | { |
| 52 | if (std::size_t max_size = detail::adapt_completion_condition_result( |
| 53 | completion_condition(ec, tmp.total_consumed()))) |
| 54 | tmp.consume(s.write_some(tmp.prepare(max_size), ec)); |
| 55 | else |
| 56 | break; |
| 57 | } |
| 58 | return tmp.total_consumed(); |
| 59 | } |
| 60 | } // namespace detail |
| 61 | |
| 62 | template <typename SyncWriteStream, typename ConstBufferSequence, |
no test coverage detected