Boost C++ Libraries: Ticket #13584: boost beast flat buffer move ctor, move assign and swap all "cancel" a prepare() https://svn.boost.org/trac10/ticket/13584 <p> The boost beast flat_buffer "cancels" any outstanding prepare() when being moved from or swapped. </p> <p> This seems like a very sane thing to do. </p> <p> However, boost::asio::async_read_until depends on calling prepare() on it's <a class="missing wiki">DynamicBuffer</a> and then calling the corresponding commit() on a moved-to version. </p> <p> Flat buffer will (correctly) silently commit the minimum of the requested size and the size from the previous prepare(). When used with async_read_until, the commit is always zero, since the prepare was "cancelled" by the move. </p> <p> The flat_buffer code always sets last_ to out_ during a move or swap, which is what achieves what I am calling the "cancel" of the prepare(). </p> <p> I tested setting last_ to other.last_ in the move ctor, move assignment, and swap, and verified that asio::async_read_until now works with beast::flat_buffer On this report I set component=asio, because I couldn't find beast on the drop box. </p> <p> I'm working with 1.67 and g++ 7.30 on ubuntu 18.04 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13584 Trac 1.4.3 anonymous Thu, 31 May 2018 13:07:01 GMT <link>https://svn.boost.org/trac10/ticket/13584#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13584#comment:1</guid> <description> <p> <strong>Please consider this withdrawn.</strong> </p> <p> The beast flat_buffer matches the asio::is_dynamic_buffer check due to the alignment of method signatures, but isn't intended to actually be an <strong>asio</strong> dynamic buffer. </p> <p> "fixing" the move allowd the async_read_until to complete, but ( of course ) my buffer had been moved from, and my actual data was long gone. </p> </description> <category>Ticket</category> </item> </channel> </rss>