diff options
author | Marcos Pinto <markybob@dipconsultants.com> | 2007-10-15 19:34:24 +0000 |
---|---|---|
committer | Marcos Pinto <markybob@dipconsultants.com> | 2007-10-15 19:34:24 +0000 |
commit | 8f030fb1120ece5d81a7c0a7dd24b4ca5b017039 (patch) | |
tree | 8342fb18925fcd103e82002492f018fbd1e88075 | |
parent | 1690fd846b601a3ffae4f368ba9ecd728ed0a3c8 (diff) | |
download | deluge-8f030fb1120ece5d81a7c0a7dd24b4ca5b017039.tar.gz deluge-8f030fb1120ece5d81a7c0a7dd24b4ca5b017039.tar.bz2 deluge-8f030fb1120ece5d81a7c0a7dd24b4ca5b017039.zip |
fixed issue with failing async_accept on windows
-rwxr-xr-x | libtorrent/src/session_impl.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libtorrent/src/session_impl.cpp b/libtorrent/src/session_impl.cpp index 63c039010..a602c6fa4 100755 --- a/libtorrent/src/session_impl.cpp +++ b/libtorrent/src/session_impl.cpp @@ -90,6 +90,10 @@ namespace } #endif +#ifdef _WIN32 +// for ERROR_SEM_TIMEOUT +#include <winerror.h> +#endif using boost::shared_ptr; using boost::weak_ptr; @@ -925,6 +929,15 @@ namespace detail + boost::lexical_cast<std::string>(ep) + "' " + e.message(); (*m_logger) << msg << "\n"; #endif +#ifdef _WIN32 + // Windows sometimes generates this error. It seems to be + // non-fatal and we have to do another async_accept. + if (e.value() == ERROR_SEM_TIMEOUT) + { + async_accept(listener); + return; + } +#endif if (m_alerts.should_post(alert::fatal)) { std::string msg = "error accepting connection on '" |