Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8795: async_connect oncorrectly reports success on failure
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-07-16 17:59:47
#8795: async_connect oncorrectly reports success on failure
-------------------------------+----------------------------
Reporter: benpope81@⦠| Owner: chris_kohlhoff
Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
Version: Boost 1.54.0 | Severity: Regression
Resolution: | Keywords:
-------------------------------+----------------------------
Comment (by stephen.pope@â¦):
Upgrading my own code to use 1.54.0 instead of 1.53.0, I also encountered
this same problem. It appears to be due to the refactoring of the
socket_ops::non_blocking_connect() function, which now calls
socket_ops::connect() and then (unless getting back
boost::asio::error::already_started), calls socket_ops::getsockopt with
SO_ERROR. The problem is that the call to ::connect() within
socket_ops::connect() has already effectively cleared the error (and set
errno appropriately), and ec already contains the desired error code, so
the call to getsockopt ends up clearing the error information from ec,
making it appear to have succeeded.
Unfortunately I am not familiar enough with the intent of the changes to
propose the correct solution, although I suspect it would be to only call
socket_ops::getsockopt() if the call to socket_ops::connect() did not
itself return an error.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8795#comment:1> 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:13 UTC