Re: [Boost-bugs] [Boost C++ Libraries] #8598: asio::streambuf: commit(n) appears to add n+1

Subject: Re: [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-22 21:38:42


#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
Resolution: | Keywords:
---------------------------------------------------------------------------+

Comment (by Mike Cowperthwaite <michael.cowperthwaite@…>):

 I tried using three-character test strings and '3' instead of '1' as
 arguments to `sputn()`, `commit()`, and `consume()`. The erroneous cases
 resulted in three-byte errors instead of one-. This made me think that
 the `commit()` calls were superfluous.

 So I tried commenting out the `commit()` calls, and with that
 modification, the test passes.

 It appears that the `sputn()` ("writes characters ... into the controlled
 output sequence") somehow performs the equivalent of the `commit()`
 ("Appends n characters from the start of the output sequence to the input
 sequence"). How this happens is entirely unclear.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8598#comment:1>
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