[Boost-bugs] [Boost C++ Libraries] #5999: boost::asio::async_read with completion_condition strange behavior when the given buffer is exausted before the completion function returned true

Subject: [Boost-bugs] [Boost C++ Libraries] #5999: boost::asio::async_read with completion_condition strange behavior when the given buffer is exausted before the completion function returned true
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-10-08 16:41:18


#5999: boost::asio::async_read with completion_condition strange behavior when the
given buffer is exausted before the completion function returned true
---------------------------------+------------------------------------------
 Reporter: bugspynet@… | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.47.0 | Severity: Problem
 Keywords: |
---------------------------------+------------------------------------------
 Consider


 {{{
 asio::async_read(tcpSocket, inBuf,completionFn, handlerFn);

 }}}
 '''Where inBuf was set to a max size N'''. [[BR]][[BR]]
 Now if the completionFn won't return true for the next N bytes received,
 asio strangely just calls handlerFn without the error_code set. There is
 no way for the code to know that something went wrong (the buffer exausted
 before completionFn returned true)[[BR]]

 '''Expected behavior:'''[[BR]]

 Call the completionFn or handlerFn with error_code set.

 '''Actual behavior:'''

 handlerFn is called without setting the error_code.

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