diff -ru boost_1_39_0/boost/asio/detail/reactive_socket_service.hpp boost_1_39_0.patched/boost/asio/detail/reactive_socket_service.hpp --- boost_1_39_0/boost/asio/detail/reactive_socket_service.hpp 2009-04-11 01:44:53.000000000 +0200 +++ boost_1_39_0.patched/boost/asio/detail/reactive_socket_service.hpp 2009-06-24 16:10:36.000000000 +0200 @@ -1435,37 +1435,37 @@ // Accept a new connection. template boost::system::error_code accept(implementation_type& impl, - Socket& peer, endpoint_type* peer_endpoint, boost::system::error_code& ec) + Socket& peer, endpoint_type* peer_endpoint, boost::system::error_code& the_error_code) { if (!is_open(impl)) { - ec = boost::asio::error::bad_descriptor; - return ec; + the_error_code = boost::asio::error::bad_descriptor; + return the_error_code; } // We cannot accept a socket that is already open. if (peer.is_open()) { - ec = boost::asio::error::already_open; - return ec; + the_error_code = boost::asio::error::already_open; + return the_error_code; } // Accept a socket. for (;;) { // Try to complete the operation without blocking. - boost::system::error_code ec; + boost::system::error_code tmp_ec; socket_holder new_socket; std::size_t addr_len = 0; if (peer_endpoint) { addr_len = peer_endpoint->capacity(); new_socket.reset(socket_ops::accept(impl.socket_, - peer_endpoint->data(), &addr_len, ec)); + peer_endpoint->data(), &addr_len, tmp_ec)); } else { - new_socket.reset(socket_ops::accept(impl.socket_, 0, 0, ec)); + new_socket.reset(socket_ops::accept(impl.socket_, 0, 0, tmp_ec)); } // Check if operation succeeded. @@ -1473,40 +1473,40 @@ { if (peer_endpoint) peer_endpoint->resize(addr_len); - peer.assign(impl.protocol_, new_socket.get(), ec); - if (!ec) + peer.assign(impl.protocol_, new_socket.get(), tmp_ec); + if (!tmp_ec) new_socket.release(); - return ec; + return tmp_ec; } // Operation failed. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) + if (tmp_ec == boost::asio::error::would_block + || tmp_ec == boost::asio::error::try_again) { if (impl.flags_ & implementation_type::user_set_non_blocking) - return ec; + return tmp_ec; // Fall through to retry operation. } - else if (ec == boost::asio::error::connection_aborted) + else if (tmp_ec == boost::asio::error::connection_aborted) { if (impl.flags_ & implementation_type::enable_connection_aborted) - return ec; + return tmp_ec; // Fall through to retry operation. } #if defined(EPROTO) - else if (ec.value() == EPROTO) + else if (tmp_ec.value() == EPROTO) { if (impl.flags_ & implementation_type::enable_connection_aborted) - return ec; + return tmp_ec; // Fall through to retry operation. } #endif // defined(EPROTO) else - return ec; + return tmp_ec; // Wait for socket to become ready. - if (socket_ops::poll_read(impl.socket_, ec) < 0) - return ec; + if (socket_ops::poll_read(impl.socket_, tmp_ec) < 0) + return tmp_ec; } }