Tidy up empty_body writer error

This commit is contained in:
Vinnie Falco
2017-06-04 15:05:23 -07:00
parent aa2c915c96
commit 4f91e632bc
3 changed files with 13 additions and 6 deletions

View File

@@ -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

View File

@@ -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.

View File

@@ -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);