Ticket #3216: ec-rename.patch

File ec-rename.patch, 3.4 KB (added by Arne Juul <arnej@…>, 13 years ago)

patch

  • boost/asio/detail/reactive_socket_service.hpp

    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
    old new  
    14351435  // Accept a new connection.
    14361436  template <typename Socket>
    14371437  boost::system::error_code accept(implementation_type& impl,
    1438       Socket& peer, endpoint_type* peer_endpoint, boost::system::error_code& ec)
     1438      Socket& peer, endpoint_type* peer_endpoint, boost::system::error_code& the_error_code)
    14391439  {
    14401440    if (!is_open(impl))
    14411441    {
    1442       ec = boost::asio::error::bad_descriptor;
    1443       return ec;
     1442      the_error_code = boost::asio::error::bad_descriptor;
     1443      return the_error_code;
    14441444    }
    14451445
    14461446    // We cannot accept a socket that is already open.
    14471447    if (peer.is_open())
    14481448    {
    1449       ec = boost::asio::error::already_open;
    1450       return ec;
     1449      the_error_code = boost::asio::error::already_open;
     1450      return the_error_code;
    14511451    }
    14521452
    14531453    // Accept a socket.
    14541454    for (;;)
    14551455    {
    14561456      // Try to complete the operation without blocking.
    1457       boost::system::error_code ec;
     1457      boost::system::error_code tmp_ec;
    14581458      socket_holder new_socket;
    14591459      std::size_t addr_len = 0;
    14601460      if (peer_endpoint)
    14611461      {
    14621462        addr_len = peer_endpoint->capacity();
    14631463        new_socket.reset(socket_ops::accept(impl.socket_,
    1464               peer_endpoint->data(), &addr_len, ec));
     1464              peer_endpoint->data(), &addr_len, tmp_ec));
    14651465      }
    14661466      else
    14671467      {
    1468         new_socket.reset(socket_ops::accept(impl.socket_, 0, 0, ec));
     1468        new_socket.reset(socket_ops::accept(impl.socket_, 0, 0, tmp_ec));
    14691469      }
    14701470
    14711471      // Check if operation succeeded.
     
    14731473      {
    14741474        if (peer_endpoint)
    14751475          peer_endpoint->resize(addr_len);
    1476         peer.assign(impl.protocol_, new_socket.get(), ec);
    1477         if (!ec)
     1476        peer.assign(impl.protocol_, new_socket.get(), tmp_ec);
     1477        if (!tmp_ec)
    14781478          new_socket.release();
    1479         return ec;
     1479        return tmp_ec;
    14801480      }
    14811481
    14821482      // Operation failed.
    1483       if (ec == boost::asio::error::would_block
    1484           || ec == boost::asio::error::try_again)
     1483      if (tmp_ec == boost::asio::error::would_block
     1484          || tmp_ec == boost::asio::error::try_again)
    14851485      {
    14861486        if (impl.flags_ & implementation_type::user_set_non_blocking)
    1487           return ec;
     1487          return tmp_ec;
    14881488        // Fall through to retry operation.
    14891489      }
    1490       else if (ec == boost::asio::error::connection_aborted)
     1490      else if (tmp_ec == boost::asio::error::connection_aborted)
    14911491      {
    14921492        if (impl.flags_ & implementation_type::enable_connection_aborted)
    1493           return ec;
     1493          return tmp_ec;
    14941494        // Fall through to retry operation.
    14951495      }
    14961496#if defined(EPROTO)
    1497       else if (ec.value() == EPROTO)
     1497      else if (tmp_ec.value() == EPROTO)
    14981498      {
    14991499        if (impl.flags_ & implementation_type::enable_connection_aborted)
    1500           return ec;
     1500          return tmp_ec;
    15011501        // Fall through to retry operation.
    15021502      }
    15031503#endif // defined(EPROTO)
    15041504      else
    1505         return ec;
     1505        return tmp_ec;
    15061506
    15071507      // Wait for socket to become ready.
    1508       if (socket_ops::poll_read(impl.socket_, ec) < 0)
    1509         return ec;
     1508      if (socket_ops::poll_read(impl.socket_, tmp_ec) < 0)
     1509        return tmp_ec;
    15101510    }
    15111511  }
    15121512