diff --git a/include/boost/beast/http/impl/file_body_win32.hpp b/include/boost/beast/http/impl/file_body_win32.hpp index cba7a0ed..e798a7b6 100644 --- a/include/boost/beast/http/impl/file_body_win32.hpp +++ b/include/boost/beast/http/impl/file_body_win32.hpp @@ -434,7 +434,7 @@ public: static_cast( (std::min)( (std::min)(w.body_.last_ - w.pos_, sr_.limit()), - (std::numeric_limits::max)())); + (std::numeric_limits::max)() - 1)); net::windows::overlapped_ptr overlapped{ sock_.get_executor(), std::move(*this)}; // Note that we have moved *this, so we cannot access @@ -562,7 +562,7 @@ write_some( static_cast( (std::min)( (std::min)(w.body_.last_ - w.pos_, sr.limit()), - (std::numeric_limits::max)())); + (std::numeric_limits::max)() - 1)); auto const bSuccess = ::TransmitFile( sock.native_handle(), w.body_.file_.native_handle(),