Clear error codes idiomatically

This commit is contained in:
Vinnie Falco committed 2019-01-20 09:50:43 -08:00
1 parent 9ea70bfbe5
commit 944b5dcda7
29 files changed
+118 -112

No files matched your search

+9 -9
View File
@@ -164,7 +164,7 @@ public:
on_request_impl(verb, string_view,
string_view, int, error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
}
void
@@ -172,20 +172,20 @@ public:
string_view,
int, error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
}
void
on_field_impl(field,
string_view, string_view, error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
}
void
on_header_impl(error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
}
void
@@ -193,13 +193,13 @@ public:
boost::optional<std::uint64_t> const&,
error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
}
std::size_t
on_body_impl(string_view s, error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
return s.size();
}
@@ -207,21 +207,21 @@ public:
on_chunk_header_impl(std::uint64_t,
string_view, error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
}
std::size_t
on_chunk_body_impl(std::uint64_t,
string_view s, error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
return s.size();
}
void
on_finish_impl(error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
}
};
+2 -2
View File
@@ -572,7 +572,7 @@ private:
// Transfer-Encoding, see if we can reserve the buffer.
//
// r_.reserve(content_length)
ec.assign(0, ec.category());
ec = {};
}
bool
@@ -625,7 +625,7 @@ private:
void
on_body(void const*, std::size_t, error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
}
void