mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 12:57: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
|
* Tidy up some integer conversion warnings
|
||||||
* Add message::header_part()
|
* Add message::header_part()
|
||||||
|
|
||||||
|
API Changes:
|
||||||
|
|
||||||
|
* header::version is unsigned
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Version 60:
|
Version 60:
|
||||||
|
@ -23,9 +23,9 @@ In this table:
|
|||||||
|
|
||||||
* `f` is a value of type `F`.
|
* `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`].
|
* `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]
|
[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>
|
template<class String>
|
||||||
void
|
void
|
||||||
prepare(String& s, basic_fields const& f,
|
prepare(String& s, basic_fields const& f,
|
||||||
int version, verb v);
|
unsigned version, verb v);
|
||||||
|
|
||||||
template<class String>
|
template<class String>
|
||||||
void
|
void
|
||||||
prepare(String&s, basic_fields const& f,
|
prepare(String&s, basic_fields const& f,
|
||||||
int version, int code);
|
unsigned version, int code);
|
||||||
|
|
||||||
basic_fields const& f_;
|
basic_fields const& f_;
|
||||||
static_string<max_static_start_line> ss_;
|
static_string<max_static_start_line> ss_;
|
||||||
@ -154,9 +154,11 @@ public:
|
|||||||
field_range,
|
field_range,
|
||||||
boost::asio::const_buffers_1>;
|
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
|
const_buffers_type
|
||||||
get() const
|
get() const
|
||||||
@ -173,7 +175,7 @@ template<class String>
|
|||||||
void
|
void
|
||||||
basic_fields<Allocator>::reader::
|
basic_fields<Allocator>::reader::
|
||||||
prepare(String& s, basic_fields const& f,
|
prepare(String& s, basic_fields const& f,
|
||||||
int version, verb v)
|
unsigned version, verb v)
|
||||||
{
|
{
|
||||||
if(v == verb::unknown)
|
if(v == verb::unknown)
|
||||||
{
|
{
|
||||||
@ -214,7 +216,7 @@ template<class String>
|
|||||||
void
|
void
|
||||||
basic_fields<Allocator>::reader::
|
basic_fields<Allocator>::reader::
|
||||||
prepare(String& s,basic_fields const& f,
|
prepare(String& s,basic_fields const& f,
|
||||||
int version, int code)
|
unsigned version, int code)
|
||||||
{
|
{
|
||||||
if(version == 11)
|
if(version == 11)
|
||||||
{
|
{
|
||||||
@ -253,7 +255,8 @@ prepare(String& s,basic_fields const& f,
|
|||||||
|
|
||||||
template<class Allocator>
|
template<class Allocator>
|
||||||
basic_fields<Allocator>::reader::
|
basic_fields<Allocator>::reader::
|
||||||
reader(basic_fields const& f, int version, verb v)
|
reader(basic_fields const& f,
|
||||||
|
unsigned version, verb v)
|
||||||
: f_(f)
|
: f_(f)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -270,7 +273,8 @@ reader(basic_fields const& f, int version, verb v)
|
|||||||
|
|
||||||
template<class Allocator>
|
template<class Allocator>
|
||||||
basic_fields<Allocator>::reader::
|
basic_fields<Allocator>::reader::
|
||||||
reader(basic_fields const& f, int version, int code)
|
reader(basic_fields const& f,
|
||||||
|
unsigned version, int code)
|
||||||
: f_(f)
|
: f_(f)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -63,13 +63,13 @@ struct header<true, Fields> : Fields
|
|||||||
This holds both the major and minor version numbers,
|
This holds both the major and minor version numbers,
|
||||||
using these formulas:
|
using these formulas:
|
||||||
@code
|
@code
|
||||||
int major = version / 10;
|
unsigned major = version / 10;
|
||||||
int minor = version % 10;
|
unsigned minor = version % 10;
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
Newly constructed headers will use HTTP/1.1 by default.
|
Newly constructed headers will use HTTP/1.1 by default.
|
||||||
*/
|
*/
|
||||||
int version = 11;
|
unsigned version = 11;
|
||||||
|
|
||||||
/// Default constructor
|
/// Default constructor
|
||||||
header() = default;
|
header() = default;
|
||||||
@ -207,13 +207,13 @@ struct header<false, Fields> : Fields
|
|||||||
This holds both the major and minor version numbers,
|
This holds both the major and minor version numbers,
|
||||||
using these formulas:
|
using these formulas:
|
||||||
@code
|
@code
|
||||||
major = version / 10;
|
unsigned major = version / 10;
|
||||||
minor = version % 10;
|
unsigned minor = version % 10;
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
Newly constructed headers will use HTTP/1.1 by default.
|
Newly constructed headers will use HTTP/1.1 by default.
|
||||||
*/
|
*/
|
||||||
int version = 11;
|
unsigned version = 11;
|
||||||
|
|
||||||
/// Default constructor.
|
/// Default constructor.
|
||||||
header() = default;
|
header() = default;
|
||||||
|
Reference in New Issue
Block a user