mirror of
https://github.com/boostorg/beast.git
synced 2025-07-29 20:37:31 +02:00
header::version is unsigned (API Change)
This commit is contained in:
@ -6,6 +6,10 @@ Version 61:
|
||||
* Tidy up some integer conversion warnings
|
||||
* Add message::header_part()
|
||||
|
||||
API Changes:
|
||||
|
||||
* header::version is unsigned
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Version 60:
|
||||
|
@ -23,9 +23,9 @@ In this table:
|
||||
|
||||
* `f` is a value of type `F`.
|
||||
|
||||
* `v` is an integer representing the HTTP version.
|
||||
* `v` is an `unsigned` value representing the HTTP version.
|
||||
|
||||
* `c` is an integer representing the HTTP status-code.
|
||||
* `c` is an `unsigned` representing the HTTP status-code.
|
||||
|
||||
* `m` is a value of type [link beast.ref.beast__http__verb `verb`].
|
||||
|
||||
@ -75,4 +75,23 @@ In this table:
|
||||
]
|
||||
]
|
||||
|
||||
Exemplar:
|
||||
```
|
||||
struct FieldsReader
|
||||
{
|
||||
// The type of buffers returned by `get`
|
||||
using const_buffers_type = implementation-defined;
|
||||
|
||||
// Constructor for requests
|
||||
FieldsReader(F const& f, unsigned version, verb method);
|
||||
|
||||
// Constructor for responses
|
||||
FieldsReader(F const& f, unsigned version, unsigned status);
|
||||
|
||||
// Returns the serialized header buffers
|
||||
const_buffers_type
|
||||
get();
|
||||
};
|
||||
```
|
||||
|
||||
[endsect]
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 37 KiB |
@ -135,12 +135,12 @@ public:
|
||||
template<class String>
|
||||
void
|
||||
prepare(String& s, basic_fields const& f,
|
||||
int version, verb v);
|
||||
unsigned version, verb v);
|
||||
|
||||
template<class String>
|
||||
void
|
||||
prepare(String&s, basic_fields const& f,
|
||||
int version, int code);
|
||||
unsigned version, int code);
|
||||
|
||||
basic_fields const& f_;
|
||||
static_string<max_static_start_line> ss_;
|
||||
@ -154,9 +154,11 @@ public:
|
||||
field_range,
|
||||
boost::asio::const_buffers_1>;
|
||||
|
||||
reader(basic_fields const& f, int version, verb v);
|
||||
reader(basic_fields const& f,
|
||||
unsigned version, verb v);
|
||||
|
||||
reader(basic_fields const& f, int version, int code);
|
||||
reader(basic_fields const& f,
|
||||
unsigned version, int code);
|
||||
|
||||
const_buffers_type
|
||||
get() const
|
||||
@ -173,7 +175,7 @@ template<class String>
|
||||
void
|
||||
basic_fields<Allocator>::reader::
|
||||
prepare(String& s, basic_fields const& f,
|
||||
int version, verb v)
|
||||
unsigned version, verb v)
|
||||
{
|
||||
if(v == verb::unknown)
|
||||
{
|
||||
@ -214,7 +216,7 @@ template<class String>
|
||||
void
|
||||
basic_fields<Allocator>::reader::
|
||||
prepare(String& s,basic_fields const& f,
|
||||
int version, int code)
|
||||
unsigned version, int code)
|
||||
{
|
||||
if(version == 11)
|
||||
{
|
||||
@ -253,7 +255,8 @@ prepare(String& s,basic_fields const& f,
|
||||
|
||||
template<class Allocator>
|
||||
basic_fields<Allocator>::reader::
|
||||
reader(basic_fields const& f, int version, verb v)
|
||||
reader(basic_fields const& f,
|
||||
unsigned version, verb v)
|
||||
: f_(f)
|
||||
{
|
||||
try
|
||||
@ -270,7 +273,8 @@ reader(basic_fields const& f, int version, verb v)
|
||||
|
||||
template<class Allocator>
|
||||
basic_fields<Allocator>::reader::
|
||||
reader(basic_fields const& f, int version, int code)
|
||||
reader(basic_fields const& f,
|
||||
unsigned version, int code)
|
||||
: f_(f)
|
||||
{
|
||||
try
|
||||
|
@ -63,13 +63,13 @@ struct header<true, Fields> : Fields
|
||||
This holds both the major and minor version numbers,
|
||||
using these formulas:
|
||||
@code
|
||||
int major = version / 10;
|
||||
int minor = version % 10;
|
||||
unsigned major = version / 10;
|
||||
unsigned minor = version % 10;
|
||||
@endcode
|
||||
|
||||
Newly constructed headers will use HTTP/1.1 by default.
|
||||
*/
|
||||
int version = 11;
|
||||
unsigned version = 11;
|
||||
|
||||
/// Default constructor
|
||||
header() = default;
|
||||
@ -207,13 +207,13 @@ struct header<false, Fields> : Fields
|
||||
This holds both the major and minor version numbers,
|
||||
using these formulas:
|
||||
@code
|
||||
major = version / 10;
|
||||
minor = version % 10;
|
||||
unsigned major = version / 10;
|
||||
unsigned minor = version % 10;
|
||||
@endcode
|
||||
|
||||
Newly constructed headers will use HTTP/1.1 by default.
|
||||
*/
|
||||
int version = 11;
|
||||
unsigned version = 11;
|
||||
|
||||
/// Default constructor.
|
||||
header() = default;
|
||||
|
Reference in New Issue
Block a user