mirror of
https://github.com/boostorg/beast.git
synced 2025-08-01 05:44:38 +02:00
Tidy up empty_body writer error
This commit is contained in:
@@ -16,11 +16,15 @@
|
||||
namespace beast {
|
||||
namespace http {
|
||||
|
||||
/** An empty message body
|
||||
/** An empty message body.
|
||||
|
||||
Meets the requirements of @b Body.
|
||||
This body is used to represent messages which do not have a
|
||||
message body. If this body is used with a parser, and the
|
||||
parser encounters octets corresponding to a message body,
|
||||
the parser will fail with the error @ref http::unexpected_body.
|
||||
|
||||
@note This body type may only be written, not read.
|
||||
Meets the requirements of @b Body. The Content-Length of this
|
||||
body is always 0.
|
||||
*/
|
||||
struct empty_body
|
||||
{
|
||||
@@ -91,7 +95,7 @@ struct empty_body
|
||||
put(ConstBufferSequence const&,
|
||||
error_code& ec)
|
||||
{
|
||||
ec = error::missing_body;
|
||||
ec = error::unexpected_body;
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -47,7 +47,7 @@ enum class error
|
||||
*/
|
||||
need_more,
|
||||
|
||||
/** The message container has no body.
|
||||
/** An unexpected body was encountered during parsing.
|
||||
|
||||
This error is returned when attempting to parse body
|
||||
octets into a message container which has the
|
||||
@@ -55,7 +55,7 @@ enum class error
|
||||
|
||||
@see @ref empty_body
|
||||
*/
|
||||
missing_body,
|
||||
unexpected_body,
|
||||
|
||||
/** Additional buffers are required.
|
||||
|
||||
|
@@ -39,7 +39,10 @@ public:
|
||||
check("http", error::end_of_stream);
|
||||
check("http", error::partial_message);
|
||||
check("http", error::need_more);
|
||||
check("http", error::unexpected_body);
|
||||
check("http", error::need_buffer);
|
||||
check("http", error::buffer_overflow);
|
||||
|
||||
check("http", error::bad_line_ending);
|
||||
check("http", error::bad_method);
|
||||
check("http", error::bad_path);
|
||||
|
Reference in New Issue
Block a user