From b8f58f149ecc631b8caf77daa76ab136d2a31f1f Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 14 Oct 2008 02:41:22 +0000 Subject: [PATCH] made UPnP not give up as soon. To give routers some time to send a NOTIFY message --- src/upnp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/upnp.cpp b/src/upnp.cpp index d98e95284..37066bf40 100644 --- a/src/upnp.cpp +++ b/src/upnp.cpp @@ -141,7 +141,7 @@ void upnp::discover_device_impl() } ++m_retry_count; - m_broadcast_timer.expires_from_now(milliseconds(250 * m_retry_count), ec); + m_broadcast_timer.expires_from_now(seconds(2 * m_retry_count), ec); m_broadcast_timer.async_wait(bind(&upnp::resend_request , self(), _1)); @@ -240,7 +240,7 @@ void upnp::resend_request(error_code const& e) mutex_t::scoped_lock l(m_mutex); - if (m_retry_count < 9 + if (m_retry_count < 12 && (m_devices.empty() || m_retry_count < 4)) { discover_device_impl(); @@ -251,7 +251,7 @@ void upnp::resend_request(error_code const& e) { #ifdef TORRENT_UPNP_LOGGING m_log << time_now_string() - << " *** Got no response in 9 retries. Giving up, " + << " *** Got no response in 12 retries. Giving up, " "disabling UPnP." << std::endl; #endif disable("no UPnP router found");