forked from boostorg/beast
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:
@@ -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);
|
||||
}
|
||||
|
||||
//]
|
||||
|
||||
Reference in New Issue
Block a user