Changeset 77033


Ignore:
Timestamp:
Feb 15, 2012, 10:16:53 PM (6 years ago)
Author:
chris_kohlhoff
Message:

Fixed a bug where the second buffer in an array of two buffers may be ignored
if the first buffer is empty.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/boost/asio/detail/buffer_sequence_adapter.hpp

    r76420 r77033  
    292292  static Buffer first(const boost::array<Elem, 2>& buffer_sequence)
    293293  {
    294     return Buffer(buffer_sequence[0]);
     294    return Buffer(boost::asio::buffer_size(buffer_sequence[0]) != 0
     295        ? buffer_sequence[0] : buffer_sequence[1]);
    295296  }
    296297
     
    345346  static Buffer first(const std::array<Elem, 2>& buffer_sequence)
    346347  {
    347     return Buffer(buffer_sequence[0]);
     348    return Buffer(boost::asio::buffer_size(buffer_sequence[0]) != 0
     349        ? buffer_sequence[0] : buffer_sequence[1]);
    348350  }
    349351
  • trunk/libs/asio/doc/history.qbk

    r76990 r77033  
    3333  without holding the lock, as it introduced a race condition in some
    3434  multithreaded scenarios.
     35* Fixed a bug where the second buffer in an array of two buffers may be ignored
     36  if the first buffer is empty.
    3537
    3638[heading Asio 1.6.1 / Boost 1.48]
Note: See TracChangeset for help on using the changeset viewer.