[Boost-bugs] [Boost C++ Libraries] #5115: iostreams non_blocking_adapter read bug

Subject: [Boost-bugs] [Boost C++ Libraries] #5115: iostreams non_blocking_adapter read bug
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-01-24 18:31:19


#5115: iostreams non_blocking_adapter read bug
------------------------------------------------+---------------------------
 Reporter: Mario Suvajac <msuvajac@…> | Owner: turkanis
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: iostreams
  Version: Boost Development Trunk | Severity: Showstopper
 Keywords: non_blocking_adapter, read |
------------------------------------------------+---------------------------
 When reading from device resulting amount of read bytes is ignored.

 line 31. of boost/iostreams/detail/adapter/non_blocking_adapter.hpp
 {{{
      explicit non_blocking_adapter(Device& dev) : device_(dev) { }
      std::streamsize read(char_type* s, std::streamsize n)
      {
          std::streamsize result = 0;
          while (result < n) {
 - std::streamsize amt = iostreams::read(device_, s, n);
 + std::streamsize amt = iostreams::read(device_, s, n -
 result);
              if (amt == -1)
                  break;
              result += amt;
          }
          return result != 0 ? result : -1;
      }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5115>
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:05 UTC