From 538da9494f149fbd8880720dba36f84739799a36 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Sat, 15 Jun 2013 01:41:18 -0700 Subject: [PATCH] In AutoSocket::async_shutdown, pass the error code to the handler, don't throw it. --- src/cpp/ripple/AutoSocket.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cpp/ripple/AutoSocket.h b/src/cpp/ripple/AutoSocket.h index 9dd737ba3b..d472eb982e 100644 --- a/src/cpp/ripple/AutoSocket.h +++ b/src/cpp/ripple/AutoSocket.h @@ -129,8 +129,16 @@ public: mSocket->async_shutdown (handler); else { - lowest_layer ().shutdown (plain_socket::shutdown_both); - mSocket->get_io_service ().post (boost::bind (handler, error_code ())); + error_code ec; + try + { + lowest_layer ().shutdown (plain_socket::shutdown_both); + } + catch (boost::system::system_error& e) + { + ec = e.code(); + } + mSocket->get_io_service ().post (boost::bind (handler, ec)); } }