Change Body::size signature (API Change):

fix #497

This changes the function signature to accept the `value_type`
instead of the entire message.

Actions Required:

* For any user-defined models of Body, change the function signature
  to accept `value_type const&` and modify the function definition
  accordingly.
This commit is contained in:
Vinnie Falco
2017-07-20 08:15:26 -07:00
parent b5be1e0d0d
commit 611e610c0c
11 changed files with 41 additions and 31 deletions
+3 -5
View File
@@ -48,10 +48,9 @@ struct file_body
@return The size of the file in bytes.
*/
template<bool isRequest, class Fields>
static
std::uint64_t
size(message<isRequest, file_body, Fields> const& m);
size(value_type const& v);
/** Algorithm for retrieving buffers when serializing.
@@ -72,12 +71,11 @@ struct file_body
//[example_http_file_body_2
template<bool isRequest, class Fields>
std::uint64_t
file_body::
size(message<isRequest, file_body, Fields> const& m)
size(value_type const& v)
{
return boost::filesystem::file_size(m.body);
return boost::filesystem::file_size(v);
}
//]