g_settings.set("ravines_amount", "1.0");\r
g_settings.set("objectdata_interval", "0.2");\r
g_settings.set("active_object_range", "2");\r
- g_settings.set("max_simultaneous_block_sends_per_client", "2");\r
+ g_settings.set("max_simultaneous_block_sends_per_client", "1");\r
g_settings.set("max_simultaneous_block_sends_server_total", "4");\r
}\r
\r
*/
JMutexAutoLock * waitCaches()
{
- dstream<<"waitCaches() begin"<<std::endl;
+ //dstream<<"waitCaches() begin"<<std::endl;
JMutexAutoLock waitcachelock(m_waitcache_mutex);
JMutexAutoLock *lock = new JMutexAutoLock(m_cache_mutex);
- dstream<<"waitCaches() end"<<std::endl;
+ //dstream<<"waitCaches() end"<<std::endl;
return lock;
}
d_start = m_nearest_unsent_d;
}
- u16 maximum_simultaneous_block_sends = g_settings.getU16
+ u16 maximum_simultaneous_block_sends_setting = g_settings.getU16
("max_simultaneous_block_sends_per_client");
+ u16 maximum_simultaneous_block_sends =
+ maximum_simultaneous_block_sends_setting;
/*
Check the time from last addNode/removeNode.
Also, don't send blocks that are already flying.
*/
- if(d > BLOCK_SEND_DISABLE_LIMITS_MAX_D)
+
+ u16 maximum_simultaneous_block_sends_now =
+ maximum_simultaneous_block_sends;
+
+ if(d <= BLOCK_SEND_DISABLE_LIMITS_MAX_D)
+ maximum_simultaneous_block_sends_now =
+ maximum_simultaneous_block_sends_setting;
+
{
JMutexAutoLock lock(m_blocks_sending_mutex);
// Limit is dynamically lowered when building
if(m_blocks_sending.size()
- >= maximum_simultaneous_block_sends)
+ >= maximum_simultaneous_block_sends_now)
{
/*dstream<<"Not sending more blocks. Queue full. "
<<m_blocks_sending.size()