[Boost-bugs] [Boost C++ Libraries] #13584: boost beast flat buffer move ctor, move assign and swap all "cancel" a prepare()

Subject: [Boost-bugs] [Boost C++ Libraries] #13584: boost beast flat buffer move ctor, move assign and swap all "cancel" a prepare()
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-05-31 03:34:48


#13584: boost beast flat buffer move ctor, move assign and swap all "cancel" a
prepare()
------------------------------+----------------------------
 Reporter: paul.d.rose@… | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.67.0 | Severity: Problem
 Keywords: beast |
------------------------------+----------------------------
 The boost beast flat_buffer "cancels" any outstanding prepare() when being
 moved from or swapped.

 This seems like a very sane thing to do.

 However, boost::asio::async_read_until depends on calling prepare() on
 it's DynamicBuffer and then calling the corresponding commit() on a moved-
 to version.

 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.

 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().

 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.

 I'm working with 1.67 and g++ 7.30 on ubuntu 18.04

-- 
Ticket URL: <https://svn.boost.org/trac10/ticket/13584>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2018-05-31 03:40:15 UTC