Allow not to limit bandwidth in LAN (fixes #1336)

This commit is contained in:
Audrius Butkevicius
2015-03-08 18:36:59 +00:00
parent 03bbf273b3
commit 6fa97eeec7
7 changed files with 161 additions and 5 deletions

View File

@@ -115,6 +115,7 @@ var (
externalPort int
igd *upnp.IGD
cert tls.Certificate
lans []*net.IPNet
)
const (
@@ -494,6 +495,10 @@ func syncthingMain() {
readRateLimit = ratelimit.NewBucketWithRate(float64(1000*opts.MaxRecvKbps), int64(5*1000*opts.MaxRecvKbps))
}
if opts.MaxRecvKbps > 0 || opts.MaxSendKbps > 0 {
lans, _ = osutil.GetLans()
}
dbFile := filepath.Join(confDir, "index")
dbOpts := &opt.Options{OpenFilesCacheCapacity: 100}
ldb, err := leveldb.OpenFile(dbFile, dbOpts)