Modify

Ticket #5999 (closed Bugs: fixed)

Opened 3 years ago

Last modified 3 years ago

boost::asio::async_read with completion_condition strange behavior when the given buffer is exausted before the completion function returned true

Reported by: bugspynet@… Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

Consider

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

Where inBuf was set to a max size N.

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)

Expected behavior:

Call the completionFn or handlerFn with error_code set.

Actual behavior:

handlerFn is called without setting the error_code.

Attachments

Change History

comment:1 Changed 3 years ago by chris_kohlhoff

(In [74952]) Clarify that the read operation ends when the buffer is full. Refs #5999

comment:2 Changed 3 years ago by chris_kohlhoff

  • Status changed from new to closed
  • Resolution set to fixed

(In [75009]) Merge from trunk:

  • Make number of strand implementations configurable by defining BOOST_ASIO_STRAND_IMPLEMENTATIONS to the number.
  • Programs can now define BOOST_ASIO_ENABLE_SEQUENTIAL_STRAND_ALLOCATION to switch the allocation of strand implementations to use a round-robin approach rather than hashing.
  • Fix potential strand starvation issue that can occur when strand.post() is used.
  • Update descriptor state allocation in kqueue_reactor to match approach used in epoll_reactor.
  • Construct epoll_reactor's interrupter member first to fix exception safety issue. Fixes #6006
  • Clarify that the read operation ends when the buffer is full. Fixes #5999
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.