summaryrefslogtreecommitdiff
path: root/modules/io_codec
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2024-07-20 16:57:22 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2024-07-20 16:57:22 +0200
commitf802fb4d988a9b6ebfe49120343561232396cab6 (patch)
tree7a42c5fc58967019c86cb7dcc656901b1b36a83c /modules/io_codec
parent53d47a9a5a8130e5af1215bbb2c2fb663a81dc30 (diff)
wip
Diffstat (limited to 'modules/io_codec')
-rw-r--r--modules/io_codec/c++/io_peer.tmpl.hpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/modules/io_codec/c++/io_peer.tmpl.hpp b/modules/io_codec/c++/io_peer.tmpl.hpp
index 4e20bd0..a3ef9b6 100644
--- a/modules/io_codec/c++/io_peer.tmpl.hpp
+++ b/modules/io_codec/c++/io_peer.tmpl.hpp
@@ -7,7 +7,7 @@ streaming_io_peer<Incoming, Outgoing, Encoding,
streaming_io_peer(
own<conveyor_feeder<data<Incoming, Encoding>>> feed,
own<async_io_stream> str)
- : streaming_io_peer{std::move(feed), std::move(str), {}, {}, {}} {}
+ : streaming_io_peer{std::move(feed), std::move(str), {}, {}, {}, {}} {}
template <typename Incoming, typename Outgoing, typename Encoding, typename BufferT>
streaming_io_peer<Incoming, Outgoing, Encoding,
@@ -34,20 +34,9 @@ streaming_io_peer<Incoming, Outgoing, Encoding,
while (true) {
buffer_view in_view{in_buffer_};
- auto in_data = data<Incoming, Encoding>(in_view);
- auto nat_data = data<Incoming>{};
-
- error err = in_codec_.template decode<Incoming, Encoding>(
- in_data, nat_data);
- if (err.is_critical()) {
- return err;
- }
-
- if (!err.failed()) {
- incoming_feeder_->feed(std::move(nat_data));
- } else {
- break;
- }
+ auto in_data = data<Incoming, Encoding>{in_view};
+
+ incoming_feeder_->feed(std::move(in_data));
}
return void_t{};
@@ -108,7 +97,7 @@ std::pair<own<streaming_io_peer<Incoming, Outgoing, Encoding, BufferT>>,
conveyor<data<Incoming,Encoding>>>
new_streaming_io_peer(own<async_io_stream> stream) {
auto caf =
- new_conveyor_and_feeder<data<Incoming>>();
+ new_conveyor_and_feeder<data<Incoming, Encoding>>();
return {heap<streaming_io_peer<Incoming, Outgoing, Encoding,BufferT>>(
std::move(caf.feeder), std::move(stream)),