Add message::need_eof

This commit is contained in:
Vinnie Falco committed 2017-10-25 18:41:04 -07:00
1 parent 5c14ab9f7c
commit 1754d5427d
4 files changed
+163

No files matched your search

+16
View File
@@ -343,6 +343,22 @@ payload_size() const
return payload_size(detail::is_body_sized<Body>{});
}
template<bool isRequest, class Body, class Fields>
bool
message<isRequest, Body, Fields>::
need_eof(std::false_type) const
{
// VFALCO Do we need a way to let the caller say "the body is intentionally skipped"?
if( this->result() == status::no_content ||
this->result() == status::not_modified ||
to_status_class(this->result()) ==
status_class::informational ||
has_content_length() ||
chunked())
return ! keep_alive();
return true;
}
template<bool isRequest, class Body, class Fields>
void
message<isRequest, Body, Fields>::