fixed typo in earlier check-in and wrapped try-catch block in BOOST_NO_EXCEPTIONS

This commit is contained in:
Arvid Norberg 2008-12-25 23:51:16 +00:00
parent d2e8ae03d3
commit c8988d79b9
1 changed files with 5 additions and 1 deletions

View File

@ -1012,7 +1012,7 @@ namespace aux {
return; return;
} }
ptimr now = time_now(); ptime now = time_now();
float tick_interval = total_microseconds(now - m_last_tick) / 1000000.f; float tick_interval = total_microseconds(now - m_last_tick) / 1000000.f;
m_last_tick = now; m_last_tick = now;
@ -1236,14 +1236,17 @@ namespace aux {
connect_points /= num_seeds + 1; connect_points /= num_seeds + 1;
if (connect_points <= 0) connect_points = 1; if (connect_points <= 0) connect_points = 1;
t.give_connect_points(connect_points); t.give_connect_points(connect_points);
#ifndef BOOST_NO_EXCEPTIONS
try try
{ {
#endif
if (t.try_connect_peer()) if (t.try_connect_peer())
{ {
--max_connections; --max_connections;
--free_slots; --free_slots;
steps_since_last_connect = 0; steps_since_last_connect = 0;
} }
#ifndef BOOST_NO_EXCEPTIONS
} }
catch (std::bad_alloc&) catch (std::bad_alloc&)
{ {
@ -1253,6 +1256,7 @@ namespace aux {
m_max_connections = num_connections(); m_max_connections = num_connections();
if (m_max_connections < 2) m_max_connections = 2; if (m_max_connections < 2) m_max_connections = 2;
} }
#endif
} }
++m_next_connect_torrent; ++m_next_connect_torrent;
++steps_since_last_connect; ++steps_since_last_connect;