Skip to content

Commit f15db75

Browse files
anarthalashtum
authored andcommitted
Fixed error code loss caused by async_immediate
1 parent d22db88 commit f15db75

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

include/boost/http_io/impl/read.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class read_body_op
142142
__FILE__, __LINE__,
143143
"immediate"));
144144
asio::async_immediate(
145-
self.get_io_executor(), std::move(self));
145+
self.get_io_executor(), asio::append(std::move(self), ec));
146146
}
147147
goto upcall;
148148
}

include/boost/http_io/impl/write.hpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,12 @@ class write_some_op
4343
{
4444
}
4545

46-
template<class Self>
47-
void
48-
operator()(Self& self)
49-
{
50-
(*this)(self, {}, 0, true);
51-
}
52-
5346
template<class Self>
5447
void
5548
operator()(
5649
Self& self,
5750
system::error_code ec = {},
58-
std::size_t bytes_transferred = {},
59-
bool do_post = false)
51+
std::size_t bytes_transferred = {})
6052
{
6153
system::result<buffers_type> rv;
6254

@@ -66,15 +58,13 @@ class write_some_op
6658
if(! rv)
6759
{
6860
ec = rv.error();
69-
if(! do_post)
70-
goto upcall;
7161
BOOST_ASIO_CORO_YIELD
7262
{
7363
BOOST_ASIO_HANDLER_LOCATION((
7464
__FILE__, __LINE__,
7565
"http_io::write_some_op"));
7666
asio::async_immediate(
77-
self.get_io_executor(), std::move(self));
67+
self.get_io_executor(), asio::append(std::move(self), ec));
7868
}
7969
goto upcall;
8070
}

0 commit comments

Comments
 (0)