From 282edb5861bd1cea2241818b86c16995df2a6c99 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 15 Oct 2007 01:15:58 +0000 Subject: [PATCH] windows vista detection to set the default half-open connection limit even lower --- src/session_impl.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 182f935bb..63c039010 100755 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -569,8 +569,19 @@ namespace detail , m_checker_impl(*this) { #ifdef WIN32 - // windows XP has a limit of 10 simultaneous connections - m_half_open.limit(8); + // windows XP has a limit on the number of + // simultaneous half-open TCP connections + DWORD windows_version = ::GetVersion(); + if ((windows_version & 0xff) >= 6) + { + // on vista the limit is 5 (in home edition) + m_half_open.limit(4); + } + else + { + // on XP SP2 it's 10 + m_half_open.limit(8); + } #endif m_bandwidth_manager[peer_connection::download_channel] = &m_download_channel;