From bd4d1cbe914b9f1a754433c0944bbd9924c1f1b0 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Wed, 21 Jun 2017 11:50:50 -0700 Subject: [PATCH] async_write requires a non-const message: This is necessary to meet the requirements for asynchronous operations: http://www.boost.org/doc/libs/1_64_0/doc/html/boost_asio/reference/asynchronous_operations.html Specifically, that the caller must ensure the validity of the message argument until the handler is invoked. object --- CHANGELOG.md | 2 ++ include/beast/http/impl/write.ipp | 4 ++-- include/beast/http/write.hpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60a17d78..59dde451 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ Version 64: * Simplify websocket write_op * Exemplars are compiled code * Better User-Agent in examples +* async_write requires a non-const message +* Doc tidying -------------------------------------------------------------------------------- diff --git a/include/beast/http/impl/write.ipp b/include/beast/http/impl/write.ipp index 287f6b31..34f0217b 100644 --- a/include/beast/http/impl/write.ipp +++ b/include/beast/http/impl/write.ipp @@ -359,7 +359,7 @@ class write_msg_op Body, Fields, no_chunk_decorator> sr; data(Handler& h, Stream& s_, message< - isRequest, Body, Fields> const& m_) + isRequest, Body, Fields>& m_) : s(s_) , sr(m_, no_chunk_decorator{}) { @@ -766,7 +766,7 @@ template async_write(AsyncWriteStream& stream, - message const& msg, + message& msg, WriteHandler&& handler) { static_assert( diff --git a/include/beast/http/write.hpp b/include/beast/http/write.hpp index 296b2b04..3b1a3ec6 100644 --- a/include/beast/http/write.hpp +++ b/include/beast/http/write.hpp @@ -488,7 +488,7 @@ template async_write(AsyncWriteStream& stream, - message const& msg, + message& msg, WriteHandler&& handler); //------------------------------------------------------------------------------