Browse Source

rpc: pass errors from async_accept

According to the [boost::asio documentation](http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/reference/basic_socket_acceptor/async_accept/overload2.html),
the function signature of the handler must be:

    void handler(
      const boost::system::error_code& error // Result of operation.
    );

We were binding *all* the arguments, instead of all but the error,
resulting in nullary function that never got the error. Fix this
by adding an input argument substitution.
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
0a0cd34552
  1. 4
      src/rpcserver.cpp

4
src/rpcserver.cpp

@ -466,7 +466,7 @@ static void RPCListen(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketA @@ -466,7 +466,7 @@ static void RPCListen(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketA
boost::ref(context),
fUseSSL,
conn,
boost::asio::placeholders::error));
_1));
}
@ -490,6 +490,8 @@ static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol, @@ -490,6 +490,8 @@ static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol,
if (error)
{
delete conn;
// TODO: Actually handle errors
LogPrintf("%s: Error: %s\n", __func__, error.message());
}
// Restrict callers by IP. It is important to

Loading…
Cancel
Save