This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ type Config struct {
35
35
DisableIPv6 bool
36
36
NoDefaultPortForwarding bool
37
37
DisableUTP bool
38
- UseMmap bool
39
38
DownloadDirectory string
40
39
WatchDirectory string
41
40
EnableUpload bool
@@ -69,7 +68,6 @@ func InitConf(specPath string) (*Config, error) {
69
68
viper .SetDefault ("EnableSeeding" , true )
70
69
viper .SetDefault ("NoDefaultPortForwarding" , true )
71
70
viper .SetDefault ("DisableUTP" , false )
72
- viper .SetDefault ("UseMmap" , false )
73
71
viper .SetDefault ("AutoStart" , true )
74
72
viper .SetDefault ("DoneCmd" , "" )
75
73
viper .SetDefault ("SeedRatio" , 0 )
Original file line number Diff line number Diff line change 7
7
"net/http"
8
8
"net/url"
9
9
"path"
10
+ "strconv"
10
11
"sync"
11
12
"time"
12
13
@@ -86,7 +87,10 @@ func (e *Engine) Configure(c *Config) error {
86
87
tc .DisableUTP = c .DisableUTP
87
88
tc .ListenPort = c .IncomingPort
88
89
tc .DataDir = c .DownloadDirectory
89
- if c .UseMmap {
90
+
91
+ // enable MMap on 64bit machines
92
+ if strconv .IntSize == 64 {
93
+ log .Println ("[Configure] 64bit arch detected, using MMap for storage" )
90
94
tc .DefaultStorage = storage .NewMMap (tc .DataDir )
91
95
}
92
96
if c .MuteEngineLog {
You can’t perform that action at this time.
0 commit comments