Clear the error faster

This commit is contained in:
Vinnie Falco committed 2017-07-20 08:15:27 -07:00
1 parent fc09a4cad1
commit 4d393f4c2a
28 files changed
+117 -116

No files matched your search

+6 -6
View File
@@ -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