@ -329,7 +329,8 @@ Session::Session(QObject *parent)
, m_IPFilterFile ( BITTORRENT_SESSION_KEY ( " IPFilter " ) )
, m_IPFilterFile ( BITTORRENT_SESSION_KEY ( " IPFilter " ) )
, m_announceToAllTrackers ( BITTORRENT_SESSION_KEY ( " AnnounceToAllTrackers " ) , false )
, m_announceToAllTrackers ( BITTORRENT_SESSION_KEY ( " AnnounceToAllTrackers " ) , false )
, m_announceToAllTiers ( BITTORRENT_SESSION_KEY ( " AnnounceToAllTiers " ) , true )
, m_announceToAllTiers ( BITTORRENT_SESSION_KEY ( " AnnounceToAllTiers " ) , true )
, m_asyncIOThreads ( BITTORRENT_SESSION_KEY ( " AsyncIOThreadsCount " ) , 4 )
, m_asyncIOThreads ( BITTORRENT_SESSION_KEY ( " AsyncIOThreadsCount " ) , 10 )
, m_hashingThreads ( BITTORRENT_SESSION_KEY ( " HashingThreadsCount " ) , 2 )
, m_filePoolSize ( BITTORRENT_SESSION_KEY ( " FilePoolSize " ) , 40 )
, m_filePoolSize ( BITTORRENT_SESSION_KEY ( " FilePoolSize " ) , 40 )
, m_checkingMemUsage ( BITTORRENT_SESSION_KEY ( " CheckingMemUsageSize " ) , 32 )
, m_checkingMemUsage ( BITTORRENT_SESSION_KEY ( " CheckingMemUsageSize " ) , 32 )
# if (LIBTORRENT_VERSION_NUM >= 10206)
# if (LIBTORRENT_VERSION_NUM >= 10206)
@ -1269,6 +1270,9 @@ void Session::loadLTSettings(lt::settings_pack &settingsPack)
settingsPack . set_int ( lt : : settings_pack : : peer_turnover_interval , peerTurnoverInterval ( ) ) ;
settingsPack . set_int ( lt : : settings_pack : : peer_turnover_interval , peerTurnoverInterval ( ) ) ;
settingsPack . set_int ( lt : : settings_pack : : aio_threads , asyncIOThreads ( ) ) ;
settingsPack . set_int ( lt : : settings_pack : : aio_threads , asyncIOThreads ( ) ) ;
# if (LIBTORRENT_VERSION_NUM >= 20000)
settingsPack . set_int ( lt : : settings_pack : : hashing_threads , hashingThreads ( ) ) ;
# endif
settingsPack . set_int ( lt : : settings_pack : : file_pool_size , filePoolSize ( ) ) ;
settingsPack . set_int ( lt : : settings_pack : : file_pool_size , filePoolSize ( ) ) ;
const int checkingMemUsageSize = checkingMemUsage ( ) * 64 ;
const int checkingMemUsageSize = checkingMemUsage ( ) * 64 ;
@ -3030,6 +3034,20 @@ void Session::setAsyncIOThreads(const int num)
configureDeferred ( ) ;
configureDeferred ( ) ;
}
}
int Session : : hashingThreads ( ) const
{
return qBound ( 1 , m_hashingThreads . value ( ) , 1024 ) ;
}
void Session : : setHashingThreads ( const int num )
{
if ( num = = m_hashingThreads )
return ;
m_hashingThreads = num ;
configureDeferred ( ) ;
}
int Session : : filePoolSize ( ) const
int Session : : filePoolSize ( ) const
{
{
return m_filePoolSize ;
return m_filePoolSize ;