Opened 11 years ago

Closed 10 years ago

#6660 closed Bugs (invalid)

async_read_until() does not complete immediately when the delimeter is already in the streambuf.

Reported by: sammy@… Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost Development Trunk Severity: Regression
Keywords: Cc:

Description

From the async_read_some() documentation: (http://www.boost.org/doc/libs/1_46_1/doc/html/boost_asio/reference/async_read_until/over\ load2.html) "If the streambuf's get area already contains the delimiter, this asynchronous operation completes immediately." This condition appears to be met under boost 1.42.0, and not under boost 1.46.1, boost 1.49.0, or boost trunk from subversion.

A test program will be attached to this bug which contains more information.

Attachments (1)

boost_async_read_test.cc (3.6 KB ) - added by Sam Creasey <sammy@…> 11 years ago.
Test program demonstrating async_read_until() behavior

Download all attachments as: .zip

Change History (3)

by Sam Creasey <sammy@…>, 11 years ago

Attachment: boost_async_read_test.cc added

Test program demonstrating async_read_until() behavior

comment:1 by Sam Creasey <sammy@…>, 11 years ago

Summary: async_read_some does not complete immediately when the delimeter is already in the streambuf.async_read_until() does not complete immediately when the delimeter is already in the streambuf.

comment:2 by chris_kohlhoff, 10 years ago

Resolution: invalid
Status: newclosed

Your stream implementation does not strictly adhere to the AsyncReadStream requirements:

If the total size of all buffers in the sequence mb is 0, the asynchronous read operation shall complete immediately and pass 0 as the argument to the handler that specifies the number of bytes read.

The async_read_until implementation relies on this behaviour to deliver the completion handler when the streambuf already contains the delimiter.

Note: See TracTickets for help on using tickets.