Subject: Re: [boost] boost::asio 1.43 regression (canceling read operation doens't trigger operation_aborted)
From: Philippe Vaucher (philippe.vaucher_at_[hidden])
Date: 2010-06-11 05:06:55
> Now there's still a bug! When trying to call cancel() on a serial_port when
> BOOST_ASIO_ENABLE_CANCELIO is not defined, it should fail with
> asio::error::operation_not_supported as the doc says, but it doens't. It
> just silently tries to go on with reading from the serial port.
The problem is that when BOOST_ASIO_ENABLE_CANCELIO is not defined,
asio\detail\win_iocp_handle_service.hpp makes it so
impl.safe_cancellation_thread_id_ is equal to 0 and then when cancelling the
following code is executed:
else if (impl.safe_cancellation_thread_id_ == 0)
// No operations have been started, so there's nothing to cancel.
ec = boost::system::error_code();
Thus cancel() thinks there's nothing to cancel, and
asio::error::operation_not_supported isn't triggered.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk