Subject: [Boost-bugs] [Boost C++ Libraries] #8598: asio::streambuf: commit(n) appears to add n+1
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-05-20 22:45:34
#8598: asio::streambuf: commit(n) appears to add n+1
--------------------------------------------------------------------------+-
Reporter: Mike Cowperthwaite <michael.cowperthwaite@â¦> | Owner: chris_kohlhoff
Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
Version: Boost 1.53.0 | Severity: Problem
Keywords: |
--------------------------------------------------------------------------+-
Working on an emulator for testing code based on boost::asio. The
emulated producer adds data to an `asio::streambuf` using `sputn()` and
`commit()`. The emulated consumer retrieves the data using `data()` and
`consume()`. The output data do not match the inputs. In particular,
there appear to be NUL characters that are placed into the buffer (with
`commit()`), causing creeping off-by-one errors on read.
Attached is a simple Google Test case to show the problem. The operating
code is trivial and the tests should be easily transformable into whatever
test platform is preferred.
Note that if the argument to the `consume()` calls are changed from 1 to
2, the test passes.
Environment is MSVC 9.0 for 64-bit Windows 7. Discovered problem with
Boost 1.49, have upgraded to 1.53 and problem persists.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8598> 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 : 2017-02-16 18:50:13 UTC