Fix file_body_win32

fix #1464
This commit is contained in:
Vinnie Falco
2019-02-20 09:39:10 -08:00
parent c3c3777661
commit b7f2792062
2 changed files with 8 additions and 10 deletions

View File

@@ -180,7 +180,7 @@ endif()
include_directories (.) include_directories (.)
# VFALCO FIXME Need this for recent asio changes # VFALCO FIXME Need this for recent asio changes
add_definitions (-DBOOST_BEAST_NO_FILE_BODY_WIN32=1) #add_definitions (-DBOOST_BEAST_NO_FILE_BODY_WIN32=1)
if (OPENSSL_FOUND) if (OPENSSL_FOUND)
include_directories (${OPENSSL_INCLUDE_DIR}) include_directories (${OPENSSL_INCLUDE_DIR})

View File

@@ -55,11 +55,12 @@ struct basic_file_body<file_win32>
template<class, class, class, bool, class> template<class, class, class, bool, class>
friend class detail::write_some_win32_op; friend class detail::write_some_win32_op;
template< template<
class Protocol, bool isRequest, class Fields> class Protocol, class Executor,
bool isRequest, class Fields>
friend friend
std::size_t std::size_t
write_some( write_some(
net::basic_stream_socket<Protocol>& sock, net::basic_stream_socket<Protocol, Executor>& sock,
serializer<isRequest, serializer<isRequest,
basic_file_body<file_win32>, Fields>& sr, basic_file_body<file_win32>, Fields>& sr,
error_code& ec); error_code& ec);
@@ -104,11 +105,12 @@ struct basic_file_body<file_win32>
template<class, class, class, bool, class> template<class, class, class, bool, class>
friend class detail::write_some_win32_op; friend class detail::write_some_win32_op;
template< template<
class Protocol, bool isRequest, class Fields> class Protocol, class Executor,
bool isRequest, class Fields>
friend friend
std::size_t std::size_t
write_some( write_some(
net::basic_stream_socket<Protocol>& sock, net::basic_stream_socket<Protocol, Executor>& sock,
serializer<isRequest, serializer<isRequest,
basic_file_body<file_win32>, Fields>& sr, basic_file_body<file_win32>, Fields>& sr,
error_code& ec); error_code& ec);
@@ -330,10 +332,6 @@ template<
class write_some_win32_op class write_some_win32_op
: public beast::async_op_base<Handler, Executor> : public beast::async_op_base<Handler, Executor>
{ {
static_assert(
std::is_same<Executor, net::io_context::executor_type>::value,
"Executor must be net::io_context::executor_type");
net::basic_stream_socket< net::basic_stream_socket<
Protocol, Executor>& sock_; Protocol, Executor>& sock_;
serializer<isRequest, serializer<isRequest,
@@ -380,7 +378,7 @@ public:
(std::min<std::uint64_t>)(w.body_.last_ - w.pos_, sr_.limit()), (std::min<std::uint64_t>)(w.body_.last_ - w.pos_, sr_.limit()),
(std::numeric_limits<boost::winapi::DWORD_>::max)())); (std::numeric_limits<boost::winapi::DWORD_>::max)()));
net::windows::overlapped_ptr overlapped{ net::windows::overlapped_ptr overlapped{
sock_.get_executor().context(), std::move(*this)}; sock_.get_executor(), std::move(*this)};
// Note that we have moved *this, so we cannot access // Note that we have moved *this, so we cannot access
// the handler since it is now moved-from. We can still // the handler since it is now moved-from. We can still
// access simple things like references and built-in types. // access simple things like references and built-in types.