diff options
Diffstat (limited to 'modules/io_codec/c++')
-rw-r--r-- | modules/io_codec/c++/io_peer.tmpl.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/io_codec/c++/io_peer.tmpl.hpp b/modules/io_codec/c++/io_peer.tmpl.hpp index f4f965f..4deabd3 100644 --- a/modules/io_codec/c++/io_peer.tmpl.hpp +++ b/modules/io_codec/c++/io_peer.tmpl.hpp @@ -91,13 +91,15 @@ error_or<void> streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentE msg) { bool restart_write = (out_buffer_.read_segment_length() == 0u); - /* + auto eov = out_buffer_.write_from(msg.get_buffer()); if (eov.is_error()) { - return eov; + auto& err = eov.get_error(); + return std::move(err); } - */ + auto& len_val = eov.get_value(); + out_buffer_.write_advance(len_val); - if (false && restart_write) { + if (restart_write && out_buffer_.read_segment_length() > 0u) { io_stream_->write(&out_buffer_.read(), out_buffer_.read_segment_length()); } |