diff --git a/include/libtorrent/socks5_stream.hpp b/include/libtorrent/socks5_stream.hpp index 40bd08202..5be4ef06d 100644 --- a/include/libtorrent/socks5_stream.hpp +++ b/include/libtorrent/socks5_stream.hpp @@ -120,6 +120,9 @@ public: // to avoid unnecessary copying of the handler, // store it in a shaed_ptr error_code e; +#if defined TORRENT_ASIO_DEBUGGING + add_outstanding_async("socks5_stream::connect1"); +#endif connect1(e, boost::make_shared(handler)); } diff --git a/src/session.cpp b/src/session.cpp index 2278afd16..a0bac8e5f 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -389,7 +389,13 @@ namespace libtorrent int counter = 0; while (log_async()) { - sleep(1000); +#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN + Sleep(1000); +#elif defined TORRENT_BEOS + snooze_until(system_time() + 1000000, B_SYSTEM_TIMEBASE); +#else + usleep(1000000); +#endif ++counter; printf("\x1b[2J\x1b[0;0H\x1b[33m==== Waiting to shut down: %d ==== \x1b[0m\n\n" , counter);