file_win32 bodies respect http::serializer::split

fix #1786, close #1788
This commit is contained in:
Mika Fischer
2019-12-23 13:33:00 +01:00
committed by Vinnie Falco
parent 35eaa441b9
commit 0abb38a310
2 changed files with 3 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ Version 281:
* Travis builds docs
* Fix echo-op test
* file_win32 bodies respect http::serializer::split
--------------------------------------------------------------------------------

View File

@@ -339,7 +339,6 @@ class write_some_win32_op
Protocol, Executor>& sock_;
serializer<isRequest,
basic_file_body<file_win32>, Fields>& sr_;
std::size_t bytes_transferred_ = 0;
bool header_ = false;
public:
@@ -415,14 +414,8 @@ public:
error_code ec,
std::size_t bytes_transferred = 0)
{
bytes_transferred_ += bytes_transferred;
if(! ec)
if(! ec && ! header_)
{
if(header_)
{
header_ = false;
return (*this)();
}
auto& w = sr_.writer_impl();
w.pos_ += bytes_transferred;
BOOST_ASSERT(w.pos_ <= w.body_.last_);
@@ -433,7 +426,7 @@ public:
BOOST_ASSERT(sr_.is_done());
}
}
this->complete_now(ec, bytes_transferred_);
this->complete_now(ec, bytes_transferred);
}
};