forked from boostorg/beast
Clear the error faster
This commit is contained in:
1 parent
fc09a4cad1
commit
4d393f4c2a
28 files changed
+117
-116
No files matched your search
@@ -63,13 +63,13 @@ struct string_body
|
||||
void
|
||||
init(error_code& ec)
|
||||
{
|
||||
ec = {};
|
||||
ec.assign(0, ec.category());
|
||||
}
|
||||
|
||||
boost::optional<std::pair<const_buffers_type, bool>>
|
||||
get(error_code& ec)
|
||||
{
|
||||
ec = {};
|
||||
ec.assign(0, ec.category());
|
||||
return {{const_buffers_type{
|
||||
body_.data(), body_.size()}, false}};
|
||||
}
|
||||
@@ -77,7 +77,7 @@ struct string_body
|
||||
void
|
||||
finish(error_code& ec)
|
||||
{
|
||||
ec = {};
|
||||
ec.assign(0, ec.category());
|
||||
}
|
||||
};
|
||||
#endif
|
||||
@@ -111,7 +111,7 @@ struct string_body
|
||||
errc::not_enough_memory);
|
||||
return;
|
||||
}
|
||||
ec = {};
|
||||
ec.assign(0, ec.category());
|
||||
body_.reserve(static_cast<
|
||||
std::size_t>(*content_length));
|
||||
}
|
||||
@@ -135,7 +135,7 @@ struct string_body
|
||||
ec = error::buffer_overflow;
|
||||
return;
|
||||
}
|
||||
ec = {};
|
||||
ec.assign(0, ec.category());
|
||||
buffer_copy(boost::asio::buffer(
|
||||
&body_[0] + len, n), buffers);
|
||||
}
|
||||
@@ -143,7 +143,7 @@ struct string_body
|
||||
void
|
||||
finish(error_code& ec)
|
||||
{
|
||||
ec = {};
|
||||
ec.assign(0, ec.category());
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user