Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions include/boost/burl/detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,6 @@ namespace burl
#include <boost/config/auto_link.hpp>
#endif

//------------------------------------------------

// Add source location to error codes
#ifdef BOOST_BURL_NO_SOURCE_LOCATION
#define BOOST_BURL_ERR(ev) (::boost::system::error_code(ev))
#define BOOST_BURL_RETURN_EC(ev) return (ev)
#else
#define BOOST_BURL_ERR(ev) \
(::boost::system::error_code( \
(ev), \
[] \
{ \
static constexpr auto loc((BOOST_CURRENT_LOCATION)); \
return &loc; \
}()))
#define BOOST_BURL_RETURN_EC(ev) \
do \
{ \
static constexpr auto loc##__LINE__((BOOST_CURRENT_LOCATION)); \
return ::boost::system::error_code((ev), &loc##__LINE__); \
} while(0)
#endif

} // burl

} // boost
Expand Down
8 changes: 4 additions & 4 deletions include/boost/burl/head_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <boost/burl/response_head_base.hpp>

#include <boost/http/error.hpp>
#include <boost/system/error_code.hpp>
#include <system_error>

#include <cstdint>

Expand Down Expand Up @@ -259,7 +259,7 @@ class head_parser
void
parse(
std::size_t n,
system::error_code& ec) noexcept;
std::error_code& ec) noexcept;

/** Return the limits enforced by the parser.

Expand Down Expand Up @@ -402,13 +402,13 @@ class head_parser
parse_start_line_(
char const*& it,
char const* end,
system::error_code& ec) noexcept;
std::error_code& ec) noexcept;

void
parse_fields_(
char const*& it,
char const* end,
system::error_code& ec) noexcept;
std::error_code& ec) noexcept;
};

} // namespace burl
Expand Down
8 changes: 4 additions & 4 deletions include/boost/burl/message_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ read_header_(S& stream, parser& pr)
{
for(;;)
{
system::error_code ec;
std::error_code ec;
pr.parse_header(ec);
if(!ec)
co_return {};
Expand All @@ -286,7 +286,7 @@ read_body_(S& stream, parser& pr)
{
for(;;)
{
system::error_code ec;
std::error_code ec;
auto const sv = pr.flatten_body(ec);
if(ec != http::error::need_data)
co_return { std::error_code(ec), sv };
Expand All @@ -306,7 +306,7 @@ read_some_(
{
for(;;)
{
system::error_code ec;
std::error_code ec;
auto const n = pr.read_some(buffers, ec);
if(ec != http::error::need_data)
co_return { std::error_code(ec), n };
Expand Down Expand Up @@ -365,7 +365,7 @@ pull_(
{
for(;;)
{
system::error_code ec;
std::error_code ec;
auto const bufs = pr.pull(dest, ec);
if(ec != http::error::need_data)
co_return { std::error_code(ec), bufs };
Expand Down
2 changes: 1 addition & 1 deletion include/boost/burl/message_writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ drive_(
std::size_t total = 0;
for(;;)
{
system::error_code ec;
std::error_code ec;
auto const body = bp.data();
auto const bufs = sr.frame(
dest, body, more || bp.more(), ec);
Expand Down
17 changes: 8 additions & 9 deletions include/boost/burl/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

#include <boost/capy/buffers.hpp>
#include <boost/http/metadata.hpp>
#include <boost/system/error_code.hpp>

#include <array>
#include <cstddef>
Expand Down Expand Up @@ -346,7 +345,7 @@ class parser
*/
BOOST_BURL_DECL
void
parse_header(system::error_code& ec);
parse_header(std::error_code& ec);

/** Flatten the body in place and return it.

Expand All @@ -373,7 +372,7 @@ class parser
*/
BOOST_BURL_DECL
std::string_view
flatten_body(system::error_code& ec);
flatten_body(std::error_code& ec);

/** Copy body octets into caller-supplied memory.

Expand All @@ -397,7 +396,7 @@ class parser
std::size_t
read_some(
MB const& buffers,
system::error_code& ec);
std::error_code& ec);

/** Return available body octets in place.

Expand All @@ -424,7 +423,7 @@ class parser
std::span<capy::const_buffer>
pull(
std::span<capy::const_buffer> dest,
system::error_code& ec);
std::error_code& ec);

/** Release body octets returned by @ref pull.

Expand Down Expand Up @@ -464,7 +463,7 @@ class parser
void
parse_trailer(
fields_base& f,
system::error_code& ec);
std::error_code& ec);

protected:
parser() = default;
Expand Down Expand Up @@ -522,12 +521,12 @@ class parser
std::size_t
read_some_(
capy::mutable_buffer dest,
system::error_code& ec);
std::error_code& ec);

std::size_t
decode_some_(
capy::mutable_buffer dest,
system::error_code& ec);
std::error_code& ec);

std::unique_ptr<char[]> buf_;
head_parser hp_;
Expand Down Expand Up @@ -556,7 +555,7 @@ std::size_t
parser::
read_some(
MB const& buffers,
system::error_code& ec)
std::error_code& ec)
{
std::size_t n = 0;
auto const end = capy::end(buffers);
Expand Down
11 changes: 5 additions & 6 deletions include/boost/burl/serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include <boost/assert.hpp>
#include <boost/capy/buffers.hpp>
#include <boost/system/error_code.hpp>

#include <cstddef>
#include <cstdint>
Expand Down Expand Up @@ -467,7 +466,7 @@ class serializer
std::span<capy::const_buffer> dest,
CB const& buffers,
bool more,
system::error_code& ec)
std::error_code& ec)
{
source_of<CB> src(buffers);
return frame_(dest, src, more, ec);
Expand Down Expand Up @@ -496,7 +495,7 @@ class serializer
frame(
std::span<capy::const_buffer> dest,
bool more,
system::error_code& ec)
std::error_code& ec)
{
source src;
return frame_(dest, src, more, ec);
Expand Down Expand Up @@ -586,7 +585,7 @@ class serializer
std::span<capy::const_buffer> dest,
source& src,
bool more,
system::error_code& ec);
std::error_code& ec);

bool
chunked_() const noexcept;
Expand Down Expand Up @@ -620,13 +619,13 @@ class serializer
void
encode_(
source& src,
system::error_code& ec);
std::error_code& ec);

bool
ingest_(
source& src,
bool more,
system::error_code& ec);
std::error_code& ec);

std::span<capy::const_buffer const>
gather_(
Expand Down
2 changes: 1 addition & 1 deletion include/boost/burl/test/response_factory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class response_factory
{
if(auto [ec] = co_await message_reader{
&conn, &parser }.read_header(); ec)
throw system::system_error(ec);
throw std::system_error(ec);
}());

return response{
Expand Down
8 changes: 4 additions & 4 deletions src/detail/grammar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include <boost/config.hpp>
#include <boost/http/error.hpp>
#include <boost/system/error_code.hpp>
#include <system_error>

#include <cstddef>
#include <string_view>
Expand Down Expand Up @@ -123,7 +123,7 @@ parse_token_to_eol(
char const* it,
char const* end,
char const*& token_end,
system::error_code& ec) noexcept
std::error_code& ec) noexcept
{
for(;; ++it)
{
Expand Down Expand Up @@ -175,7 +175,7 @@ parse_field(
char const* end,
std::string_view& name,
std::string_view& value,
system::error_code& ec)
std::error_code& ec)
{
/* header-field = field-name ":" OWS field-value OWS

Expand Down Expand Up @@ -253,7 +253,7 @@ parse_limited(
char const* end,
std::size_t limit,
http::error limit_err,
system::error_code& ec) noexcept
std::error_code& ec) noexcept
{
bool const limited = [&]()
{
Expand Down
16 changes: 8 additions & 8 deletions src/head_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ parse_method(
char const*& it,
char const* end,
std::string_view& result,
system::error_code& ec)
std::error_code& ec)
{
// parse token SP
auto const first = it;
Expand Down Expand Up @@ -92,7 +92,7 @@ parse_target(
char const*& it,
char const* end,
std::string_view& result,
system::error_code& ec)
std::error_code& ec)
{
// parse target SP
auto const first = it;
Expand Down Expand Up @@ -125,7 +125,7 @@ parse_version(
char const*& it,
char const* end,
version& result,
system::error_code& ec)
std::error_code& ec)
{
if(distance(it, end) < 8)
{
Expand All @@ -152,7 +152,7 @@ parse_status(
char const*& it,
char const* end,
std::uint16_t& result,
system::error_code& ec)
std::error_code& ec)
{
// parse 3(digit) SP
if(distance(it, end) < 4)
Expand Down Expand Up @@ -193,7 +193,7 @@ parse_reason(
char const*& it,
char const* end,
std::string_view& result,
system::error_code& ec)
std::error_code& ec)
{
auto const first = it;
char const* token_end = nullptr;
Expand Down Expand Up @@ -309,7 +309,7 @@ void
head_parser::
parse(
std::size_t n,
system::error_code& ec) noexcept
std::error_code& ec) noexcept
{
ec.clear();
auto const& h = h_();
Expand Down Expand Up @@ -369,7 +369,7 @@ head_parser::
parse_start_line_(
char const*& it,
char const* end,
system::error_code& ec) noexcept
std::error_code& ec) noexcept
{
auto& h = h_();
auto const first = it;
Expand Down Expand Up @@ -454,7 +454,7 @@ head_parser::
parse_fields_(
char const*& it,
char const* end,
system::error_code& ec) noexcept
std::error_code& ec) noexcept
{
auto& h = h_();
std::string_view name;
Expand Down
Loading
Loading