Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
/bin64
/_build*
temp
/build/CMakeCache.txt
/build/CMakeFiles/
/build/DartConfiguration.tcl

# Emacs
*#
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/ROOT/pages/reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cpp:boost::http_proto::file_source[file_source]

cpp:boost::http_proto::header_limits[header_limits]

cpp:boost::http_proto::message_base[message_base]
cpp:boost::http_proto::header[header]

cpp:boost::http_proto::metadata[metadata]

Expand Down
2 changes: 1 addition & 1 deletion include/boost/http_proto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <boost/http_proto/file_sink.hpp>
#include <boost/http_proto/file_source.hpp>
#include <boost/http_proto/header_limits.hpp>
#include <boost/http_proto/message_base.hpp>
#include <boost/http_proto/header.hpp>
#include <boost/http_proto/method.hpp>
#include <boost/http_proto/parser.hpp>
#include <boost/http_proto/request.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/boost/http_proto/fields_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class fields_base
};

friend class fields;
friend class message_base;
friend class header;
friend class request_base;
friend class request;
friend class static_request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// Official repository: https://github.com/cppalliance/http_proto
//

#ifndef BOOST_HTTP_PROTO_MESSAGE_BASE_HPP
#define BOOST_HTTP_PROTO_MESSAGE_BASE_HPP
#ifndef BOOST_HTTP_PROTO_HEADER_HPP
#define BOOST_HTTP_PROTO_HEADER_HPP

#include <boost/http_proto/detail/config.hpp>
#include <boost/http_proto/fields_base.hpp>
Expand All @@ -19,7 +19,7 @@ namespace boost {
namespace http_proto {

/** Mixin for modifing common metadata
in HTTP request and response messages.
in HTTP request and response headers.

This type is useful for modifying common
properties shared by both requests
Expand All @@ -32,7 +32,7 @@ namespace http_proto {
@ref static_request,
@ref metadata.
*/
class message_base
class header
: public fields_base
{
friend class request_base;
Expand Down
4 changes: 2 additions & 2 deletions include/boost/http_proto/impl/serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ template<
void
serializer::
start(
message_base const& m,
header const& m,
ConstBufferSequence&& cbs)
{
static_assert(buffers::is_const_buffer_sequence<
Expand All @@ -139,7 +139,7 @@ template<
Source&
serializer::
start(
message_base const& m,
header const& m,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot the variable should be renamed from m to h, and this should happen everywhere that a message_base variable is changed to be a header

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit 6b19f77. Renamed all header const& m parameters to header const& h and updated all usages throughout the serializer code.

Args&&... args)
{
static_assert(
Expand Down
12 changes: 6 additions & 6 deletions include/boost/http_proto/request_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,39 @@
#define BOOST_HTTP_PROTO_REQUEST_BASE_HPP

#include <boost/http_proto/detail/config.hpp>
#include <boost/http_proto/message_base.hpp>
#include <boost/http_proto/header.hpp>

namespace boost {
namespace http_proto {

/** Mixin for modifing HTTP requests.

@see
@ref message_base,
@ref header,
@ref request,
@ref static_request.
*/
class request_base
: public message_base
: public header
{
friend class request;
friend class static_request;

request_base() noexcept
: message_base(detail::kind::request)
: header(detail::kind::request)
{
}

explicit
request_base(core::string_view s)
: message_base(detail::kind::request, s)
: header(detail::kind::request, s)
{
}

request_base(
void* storage,
std::size_t cap) noexcept
: message_base(
: header(
detail::kind::request, storage, cap)
{
}
Expand Down
12 changes: 6 additions & 6 deletions include/boost/http_proto/response_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#define BOOST_HTTP_PROTO_RESPONSE_BASE_HPP

#include <boost/http_proto/detail/config.hpp>
#include <boost/http_proto/message_base.hpp>
#include <boost/http_proto/header.hpp>
#include <boost/http_proto/status.hpp>

namespace boost {
Expand All @@ -22,31 +22,31 @@ namespace http_proto {
/** Mixin for modifing HTTP responses.

@see
@ref message_base,
@ref header,
@ref response,
@ref static_response.
*/
class response_base
: public message_base
: public header
{
friend class response;
friend class static_response;

response_base() noexcept
: message_base(detail::kind::response)
: header(detail::kind::response)
{
}

explicit
response_base(core::string_view s)
: message_base(detail::kind::response, s)
: header(detail::kind::response, s)
{
}

response_base(
void* storage,
std::size_t cap) noexcept
: message_base(
: header(
detail::kind::response, storage, cap)
{
}
Expand Down
24 changes: 12 additions & 12 deletions include/boost/http_proto/serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace boost {
namespace http_proto {

// Forward declaration
class message_base;
class header;

/** A serializer for HTTP/1 messages

Expand Down Expand Up @@ -191,11 +191,11 @@ class serializer
start-line and headers from.

@see
@ref message_base.
@ref header.
*/
void
BOOST_HTTP_PROTO_DECL
start(message_base const& m);
start(header const& m);

/** Prepare the serializer for a new message with a ConstBufferSequence body.

Expand Down Expand Up @@ -248,7 +248,7 @@ class serializer
until @ref is_done returns `true`.

@see
@ref message_base.
@ref header.
*/
template<
class ConstBufferSequence,
Expand All @@ -258,7 +258,7 @@ class serializer
>
void
start(
message_base const& m,
header const& m,
ConstBufferSequence&& buffers);

/** Prepare the serializer for a new message with a Source body.
Expand Down Expand Up @@ -321,7 +321,7 @@ class serializer
@see
@ref source,
@ref file_source,
@ref message_base.
@ref header.
*/
template<
class Source,
Expand All @@ -330,7 +330,7 @@ class serializer
is_source<Source>::value>::type>
Source&
start(
message_base const& m,
header const& m,
Args&&... args);

/** Prepare the serializer for a new message using a stream interface.
Expand Down Expand Up @@ -402,12 +402,12 @@ class serializer

@see
@ref stream,
@ref message_base.
@ref header.
*/
BOOST_HTTP_PROTO_DECL
stream
start_stream(
message_base const& m);
header const& m);

/** Return the output area.

Expand Down Expand Up @@ -527,18 +527,18 @@ class serializer
BOOST_HTTP_PROTO_DECL
void
start_init(
message_base const&);
header const&);

BOOST_HTTP_PROTO_DECL
void
start_buffers(
message_base const&,
header const&,
cbs_gen&);

BOOST_HTTP_PROTO_DECL
void
start_source(
message_base const&,
header const&,
source&);

impl* impl_;
Expand Down
10 changes: 5 additions & 5 deletions src/message_base.cpp → src/header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Official repository: https://github.com/cppalliance/http_proto
//

#include <boost/http_proto/message_base.hpp>
#include <boost/http_proto/header.hpp>
#include <boost/http_proto/rfc/list_rule.hpp>
#include <boost/http_proto/rfc/token_rule.hpp>
#include <boost/http_proto/detail/except.hpp>
Expand All @@ -20,7 +20,7 @@ namespace boost {
namespace http_proto {

void
message_base::
header::
set_payload_size(
std::uint64_t n)
{
Expand All @@ -39,7 +39,7 @@ set_payload_size(
}

void
message_base::
header::
set_content_length(
std::uint64_t n)
{
Expand All @@ -48,7 +48,7 @@ set_content_length(
}

void
message_base::
header::
set_chunked(bool value)
{
if(value)
Expand All @@ -70,7 +70,7 @@ set_chunked(bool value)
}

void
message_base::
header::
set_keep_alive(bool value)
{
if(h_.md.connection.ec.failed())
Expand Down
Loading