From 88c5b35826f192496e234a6727454ab5b969f80f Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 20 Jan 2012 04:41:54 +0000 Subject: [PATCH] add asio debugging to the async shutdown of ssl sockets --- src/peer_connection.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index c6a9fbdaf..0d7cab01f 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -3441,8 +3441,11 @@ namespace libtorrent return; } - void close_socket(boost::shared_ptr const& s) + void on_close_socket(boost::shared_ptr const& s) { +#if defined TORRENT_ASIO_DEBUGGING + complete_async("on_close_socket"); +#endif error_code ec; s->close(ec); } @@ -3614,8 +3617,14 @@ namespace libtorrent #ifdef TORRENT_USE_OPENSSL // for SSL connections, first do an async_shutdown, before closing the socket +#if defined TORRENT_ASIO_DEBUGGING +#define MAYBE_ASIO_DEBUGGING add_outstanding_async("on_close_socket"); +#else +#define MAYBE_ASIO_DEBUGGING +#endif #define CASE(t) case socket_type_int_impl >::value: \ - m_socket->get >()->async_shutdown(boost::bind(&close_socket, m_socket)); \ + MAYBE_ASIO_DEBUGGING \ + m_socket->get >()->async_shutdown(boost::bind(&on_close_socket, m_socket)); \ break; switch(m_socket->type()) {