diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-05-07 09:09:13 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-05-12 09:30:46 +0200 |
commit | 0a0cd345520382bd726fef50c62864715b03f164 (patch) | |
tree | aeb8a42d8fa0adae4e336d8f7488fa0aff65b568 /src | |
parent | 2e2f6855df83a8b1b3d155e8bf2c1d55e4fee4a6 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/rpcserver.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index ac40ea7cf1..44f329dd15 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -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, if (error) { delete conn; + // TODO: Actually handle errors + LogPrintf("%s: Error: %s\n", __func__, error.message()); } // Restrict callers by IP. It is important to |