From b7f279206255120eca9f97bbe505c8c59e9adca7 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Wed, 20 Feb 2019 09:39:10 -0800 Subject: [PATCH] Fix file_body_win32 fix #1464 --- CMakeLists.txt | 2 +- .../boost/beast/http/impl/file_body_win32.ipp | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5780d3e6..32c7062c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -180,7 +180,7 @@ endif() include_directories (.) # 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) include_directories (${OPENSSL_INCLUDE_DIR}) diff --git a/include/boost/beast/http/impl/file_body_win32.ipp b/include/boost/beast/http/impl/file_body_win32.ipp index 0969cc9d..dff028d3 100644 --- a/include/boost/beast/http/impl/file_body_win32.ipp +++ b/include/boost/beast/http/impl/file_body_win32.ipp @@ -55,11 +55,12 @@ struct basic_file_body template friend class detail::write_some_win32_op; template< - class Protocol, bool isRequest, class Fields> + class Protocol, class Executor, + bool isRequest, class Fields> friend std::size_t write_some( - net::basic_stream_socket& sock, + net::basic_stream_socket& sock, serializer, Fields>& sr, error_code& ec); @@ -104,11 +105,12 @@ struct basic_file_body template friend class detail::write_some_win32_op; template< - class Protocol, bool isRequest, class Fields> + class Protocol, class Executor, + bool isRequest, class Fields> friend std::size_t write_some( - net::basic_stream_socket& sock, + net::basic_stream_socket& sock, serializer, Fields>& sr, error_code& ec); @@ -330,10 +332,6 @@ template< class write_some_win32_op : public beast::async_op_base { - static_assert( - std::is_same::value, - "Executor must be net::io_context::executor_type"); - net::basic_stream_socket< Protocol, Executor>& sock_; serializer)(w.body_.last_ - w.pos_, sr_.limit()), (std::numeric_limits::max)())); 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 // the handler since it is now moved-from. We can still // access simple things like references and built-in types.