mirror of
https://github.com/boostorg/beast.git
synced 2025-08-03 14:54:32 +02:00
Relax ForwardIterator requirements in FieldSequence
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
* Add pause option to on_headers interface
|
* Add pause option to on_headers interface
|
||||||
* Refactor base_parser_v1 callback traits:
|
* Refactor base_parser_v1 callback traits:
|
||||||
* Refine Parser concept
|
* Refine Parser concept
|
||||||
|
* Relax ForwardIterator requirements in FieldSequence
|
||||||
|
|
||||||
API Changes:
|
API Changes:
|
||||||
|
|
||||||
|
@@ -32,11 +32,11 @@ libraries:
|
|||||||
* Leave important decisions to the user, such as
|
* Leave important decisions to the user, such as
|
||||||
allocating memory or managing flow control.
|
allocating memory or managing flow control.
|
||||||
|
|
||||||
Beast uses the __DynamicBuffer__ concept presented in the Netwoking TS,
|
Beast uses the __DynamicBuffer__ concept presented in the Networking TS
|
||||||
and relies heavily on the Boost.Asio __ConstBufferSequence__ and
|
(__N4588__), and relies heavily on the Boost.Asio __ConstBufferSequence__
|
||||||
__MutableBufferSequence__ concepts for passing buffers to functions. The
|
and __MutableBufferSequence__ concepts for passing buffers to functions.
|
||||||
authors have found the dynamic buffer and buffer sequence interfaces to be
|
The authors have found the dynamic buffer and buffer sequence interfaces to
|
||||||
optimal for interacting with Asio, and for other tasks such as incremental
|
be optimal for interacting with Asio, and for other tasks such as incremental
|
||||||
parsing of data in buffers (for example, parsing websocket frames stored
|
parsing of data in buffers (for example, parsing websocket frames stored
|
||||||
in a [link beast.ref.static_streambuf `static_streambuf`]).
|
in a [link beast.ref.static_streambuf `static_streambuf`]).
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ start. Other design goals:
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
[[
|
[[
|
||||||
"What about HTTP/2?""
|
"What about HTTP/2?"
|
||||||
][
|
][
|
||||||
Many reviewers feel that HTTP/2 support is an essential feature of
|
Many reviewers feel that HTTP/2 support is an essential feature of
|
||||||
a HTTP library. The authors agree that HTTP/2 is important but also
|
a HTTP library. The authors agree that HTTP/2 is important but also
|
||||||
@@ -281,7 +281,7 @@ start. Other design goals:
|
|||||||
(18 functions versus 2). Note that websocketpp connections are passed by
|
(18 functions versus 2). Note that websocketpp connections are passed by
|
||||||
`shared_ptr`. Beast does not use `shared_ptr` anywhere in its public interface.
|
`shared_ptr`. Beast does not use `shared_ptr` anywhere in its public interface.
|
||||||
A `beast::websocket::stream` is constructible and movable in a manner identical
|
A `beast::websocket::stream` is constructible and movable in a manner identical
|
||||||
`to a boost::asio::ip::tcp::socket`. Callers can put such objects in a
|
to a `boost::asio::ip::tcp::socket`. Callers can put such objects in a
|
||||||
`shared_ptr` if they want to, but there is no requirement to do so.
|
`shared_ptr` if they want to, but there is no requirement to do so.
|
||||||
|
|
||||||
[table
|
[table
|
||||||
@@ -372,7 +372,7 @@ start. Other design goals:
|
|||||||
|
|
||||||
websocketpp requires a one-time call to set the handler for each event
|
websocketpp requires a one-time call to set the handler for each event
|
||||||
in its interface (for example, upon message receipt). The handler is
|
in its interface (for example, upon message receipt). The handler is
|
||||||
represented by a `std::function equivalent`. Its important to recognize
|
represented by a `std::function` equivalent. Its important to recognize
|
||||||
that the websocketpp interface performs type-erasure on this handler.
|
that the websocketpp interface performs type-erasure on this handler.
|
||||||
|
|
||||||
In comparison, Beast handlers are specified in a manner identical to
|
In comparison, Beast handlers are specified in a manner identical to
|
||||||
|
@@ -30,11 +30,12 @@
|
|||||||
[def __Body__ [link beast.ref.Body [*`Body`]]]
|
[def __Body__ [link beast.ref.Body [*`Body`]]]
|
||||||
[def __CompletionHandler__ [@http://www.boost.org/doc/libs/1_60_0/doc/html/boost_asio/reference/CompletionHandler.html [*CompletionHandler]]]
|
[def __CompletionHandler__ [@http://www.boost.org/doc/libs/1_60_0/doc/html/boost_asio/reference/CompletionHandler.html [*CompletionHandler]]]
|
||||||
[def __ConstBufferSequence__ [@http://www.boost.org/doc/libs/1_61_0/doc/html/boost_asio/reference/ConstBufferSequence.html [*ConstBufferSequence]]]
|
[def __ConstBufferSequence__ [@http://www.boost.org/doc/libs/1_61_0/doc/html/boost_asio/reference/ConstBufferSequence.html [*ConstBufferSequence]]]
|
||||||
[def __DynamicBuffer__ [link beast.ref.DynamicBuffer [*`DynamicBuffer`]]]
|
[def __DynamicBuffer__ [link beast.ref.DynamicBuffer [*DynamicBuffer]]]
|
||||||
[def __FieldSequence__ [link beast.ref.FieldSequence [*`FieldSequence`]]]
|
[def __FieldSequence__ [link beast.ref.FieldSequence [*FieldSequence]]]
|
||||||
[def __message__ [link beast.ref.http__message `message`]]
|
[def __message__ [link beast.ref.http__message `message`]]
|
||||||
[def __message_v1__ [link beast.ref.http__message_v1 `message_v1`]]
|
[def __message_v1__ [link beast.ref.http__message_v1 `message_v1`]]
|
||||||
[def __MutableBufferSequence__ [@http://www.boost.org/doc/libs/1_61_0/doc/html/boost_asio/reference/MutableBufferSequence.html [*MutableBufferSequence]]]
|
[def __MutableBufferSequence__ [@http://www.boost.org/doc/libs/1_61_0/doc/html/boost_asio/reference/MutableBufferSequence.html [*MutableBufferSequence]]]
|
||||||
|
[def __N4588__ [@http://cplusplus.github.io/networking-ts/draft.pdf [*N4588]]]
|
||||||
[def __rfc6455__ [@https://tools.ietf.org/html/rfc6455 rfc6455]]
|
[def __rfc6455__ [@https://tools.ietf.org/html/rfc6455 rfc6455]]
|
||||||
[def __rfc7230__ [@https://tools.ietf.org/html/rfc7230 rfc7230]]
|
[def __rfc7230__ [@https://tools.ietf.org/html/rfc7230 rfc7230]]
|
||||||
[def __streambuf__ [link beast.ref.streambuf `streambuf`]]
|
[def __streambuf__ [link beast.ref.streambuf `streambuf`]]
|
||||||
|
@@ -15,7 +15,7 @@ In this table:
|
|||||||
|
|
||||||
* `X` denotes a type that meets the requirements of [*FieldSequence].
|
* `X` denotes a type that meets the requirements of [*FieldSequence].
|
||||||
|
|
||||||
* `a` is a value of type `X`.
|
* `c` is a value of type `X const`.
|
||||||
|
|
||||||
[table FieldSequence requirements
|
[table FieldSequence requirements
|
||||||
[[operation][type][semantics, pre/post-conditions]]
|
[[operation][type][semantics, pre/post-conditions]]
|
||||||
@@ -23,25 +23,33 @@ In this table:
|
|||||||
[`X::value_type`]
|
[`X::value_type`]
|
||||||
[]
|
[]
|
||||||
[
|
[
|
||||||
A type that meets the requirements of @b Field.
|
A type that meets the requirements of [link beast.ref.Field [*Field]].
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
[`X::const_iterator`]
|
[`X::const_iterator`]
|
||||||
[]
|
[]
|
||||||
[
|
[
|
||||||
A type that meets the requirements of @b ForwardIterator.
|
An iterator type whose `reference` type meets the
|
||||||
|
requirements of [link beast.ref.Field [*Field]], and which
|
||||||
|
satisfies all the requirements of [*ForwardIterator],
|
||||||
|
except that:
|
||||||
|
|
||||||
|
[ordered_list
|
||||||
|
[there is no requirement that `operator->` is provided, and]
|
||||||
|
[there is no requirement that `reference` be a reference type.]
|
||||||
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
[`a.begin()`]
|
[`c.begin()`]
|
||||||
[`X::const_iterator`]
|
[`X::const_iterator`]
|
||||||
[
|
[
|
||||||
Returns an iterator to the beginning of the field sequence.
|
Returns an iterator to the beginning of the field sequence.
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
[`a.end()`]
|
[`c.end()`]
|
||||||
[`X::const_iterator`]
|
[`X::const_iterator`]
|
||||||
[
|
[
|
||||||
Returns an iterator to the end of the field sequence.
|
Returns an iterator to the end of the field sequence.
|
||||||
|
@@ -308,8 +308,8 @@ feature, and the write buffer size option determines the maximum size of
|
|||||||
the fragments:
|
the fragments:
|
||||||
```
|
```
|
||||||
...
|
...
|
||||||
ws.set_option(beast::websocket::auto_fragment{true};
|
ws.set_option(beast::websocket::auto_fragment{true});
|
||||||
ws.set_option(beast::websocket::write_buffer_size{16384};
|
ws.set_option(beast::websocket::write_buffer_size{16384});
|
||||||
```
|
```
|
||||||
|
|
||||||
The WebSocket protocol defines a procedure and control message for initiating
|
The WebSocket protocol defines a procedure and control message for initiating
|
||||||
|
Reference in New Issue
Block a user