Modify

Opened 6 years ago

Closed 6 years ago

#5999 closed Bugs (fixed)

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 (0)

Change History (2)

comment:1 Changed 6 years ago by chris_kohlhoff

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

comment:2 Changed 6 years ago by chris_kohlhoff

Resolution: fixed
Status: newclosed

(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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain chris_kohlhoff.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.