forked from boostorg/beast
HTTP tidying
This commit is contained in:
@@ -19,6 +19,7 @@ Version 200
|
|||||||
* Tidy up multi_buffer
|
* Tidy up multi_buffer
|
||||||
* Refactor ostream
|
* Refactor ostream
|
||||||
* Refactor static_buffer
|
* Refactor static_buffer
|
||||||
|
* HTTP tidying
|
||||||
|
|
||||||
API Changes:
|
API Changes:
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@ struct chunk_crlf
|
|||||||
#if BOOST_BEAST_DOXYGEN
|
#if BOOST_BEAST_DOXYGEN
|
||||||
using value_type = __implementation_defined__;
|
using value_type = __implementation_defined__;
|
||||||
#else
|
#else
|
||||||
using value_type = detail::chunk_crlf_iter::value_type;
|
using value_type = net::const_buffer;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Required for @b ConstBufferSequence
|
/// Required for @b ConstBufferSequence
|
||||||
@@ -61,7 +61,8 @@ struct chunk_crlf
|
|||||||
const_iterator
|
const_iterator
|
||||||
begin() const
|
begin() const
|
||||||
{
|
{
|
||||||
return &detail::chunk_crlf_iter::value;
|
static net::const_buffer const cb{"\r\n", 2};
|
||||||
|
return &cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Required for @b ConstBufferSequence
|
/// Required for @b ConstBufferSequence
|
||||||
|
@@ -136,22 +136,25 @@ public:
|
|||||||
|
|
||||||
/// Returns a buffer sequence holding a CRLF for chunk encoding
|
/// Returns a buffer sequence holding a CRLF for chunk encoding
|
||||||
inline
|
inline
|
||||||
net::const_buffer
|
net::const_buffer const&
|
||||||
chunk_crlf()
|
chunk_crlf()
|
||||||
{
|
{
|
||||||
return {"\r\n", 2};
|
static net::const_buffer const cb{"\r\n", 2};
|
||||||
|
return cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a buffer sequence holding a final chunk header
|
/// Returns a buffer sequence holding a final chunk header
|
||||||
inline
|
inline
|
||||||
net::const_buffer
|
net::const_buffer const&
|
||||||
chunk_last()
|
chunk_last()
|
||||||
{
|
{
|
||||||
return {"0\r\n", 3};
|
static net::const_buffer const cb{"0\r\n", 3};
|
||||||
|
return cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if 0
|
||||||
template<class = void>
|
template<class = void>
|
||||||
struct chunk_crlf_iter_type
|
struct chunk_crlf_iter_type
|
||||||
{
|
{
|
||||||
@@ -176,44 +179,19 @@ typename chunk_crlf_iter_type<T>::value_type
|
|||||||
chunk_crlf_iter_type<T>::value;
|
chunk_crlf_iter_type<T>::value;
|
||||||
|
|
||||||
using chunk_crlf_iter = chunk_crlf_iter_type<void>;
|
using chunk_crlf_iter = chunk_crlf_iter_type<void>;
|
||||||
|
#endif
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
template<class = void>
|
|
||||||
struct chunk_size0_iter_type
|
|
||||||
{
|
|
||||||
class value_type
|
|
||||||
{
|
|
||||||
char const s[3] = {'0', '\r', '\n'};
|
|
||||||
|
|
||||||
public:
|
|
||||||
value_type() = default;
|
|
||||||
|
|
||||||
operator
|
|
||||||
net::const_buffer() const
|
|
||||||
{
|
|
||||||
return {s, sizeof(s)};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
static value_type value;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
typename chunk_size0_iter_type<T>::value_type
|
|
||||||
chunk_size0_iter_type<T>::value;
|
|
||||||
|
|
||||||
using chunk_size0_iter = chunk_size0_iter_type<void>;
|
|
||||||
|
|
||||||
struct chunk_size0
|
struct chunk_size0
|
||||||
{
|
{
|
||||||
using value_type = chunk_size0_iter::value_type;
|
using value_type = net::const_buffer;
|
||||||
|
|
||||||
using const_iterator = value_type const*;
|
using const_iterator = value_type const*;
|
||||||
|
|
||||||
const_iterator
|
const_iterator
|
||||||
begin() const
|
begin() const
|
||||||
{
|
{
|
||||||
return &chunk_size0_iter::value;
|
return &chunk_last();
|
||||||
}
|
}
|
||||||
|
|
||||||
const_iterator
|
const_iterator
|
||||||
|
Reference in New Issue
Block a user