Commit 6c88015 1 parent 71e3bee commit 6c88015 Copy full SHA for 6c88015
File tree 5 files changed +10
-2
lines changed
5 files changed +10
-2
lines changed Original file line number Diff line number Diff line change
1
+ * fix bug in auto disk cache size logic
1
2
* fix issue with outgoing_interfaces setting, where bind() would be called twice
2
3
* add build option to disable share-mode
3
4
* support validation of HTTPS trackers
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ namespace aux {
78
78
, aux::session_settings_single_thread& sett
79
79
, std::vector<void (aux::session_impl::*)()>* callbacks = nullptr);
80
80
TORRENT_EXTRA_EXPORT void run_all_updates (aux::session_impl& ses);
81
+ TORRENT_EXTRA_EXPORT int default_int_value (int const name);
81
82
82
83
// converts a setting integer (from the enums string_types, int_types or
83
84
// bool_types) to a string, and vice versa.
Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ namespace libtorrent {
292
292
if (cache_size < 0 )
293
293
{
294
294
std::int64_t phys_ram = total_physical_ram ();
295
- if (phys_ram == 0 ) m_max_use = 1024 ;
295
+ if (phys_ram == 0 ) m_max_use = default_int_value (settings_pack::cache_size) ;
296
296
else
297
297
{
298
298
// this is the logic to calculate the automatic disk cache size
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ namespace libtorrent {
112
112
MEMORYSTATUSEX ms;
113
113
ms.dwLength = sizeof (MEMORYSTATUSEX);
114
114
if (GlobalMemoryStatusEx (&ms))
115
- ret = int ( ms.ullTotalPhys ) ;
115
+ ret = ms.ullTotalPhys ;
116
116
else
117
117
ret = 0 ;
118
118
#elif defined TORRENT_LINUX
Original file line number Diff line number Diff line change @@ -531,6 +531,12 @@ constexpr int CLOSE_FILE_INTERVAL = 0;
531
531
return ret;
532
532
}
533
533
534
+ int default_int_value (int const name)
535
+ {
536
+ TORRENT_ASSERT ((name & settings_pack::type_mask) == settings_pack::int_type_base);
537
+ return int_settings[name - settings_pack::int_type_base].default_value ;
538
+ }
539
+
534
540
void apply_pack (settings_pack const * pack, aux::session_settings& sett
535
541
, aux::session_impl* ses)
536
542
{
You can’t perform that action at this time.
0 commit comments