lib/connections, lib/config: Bandwidth throttling per remote device (fixes #4516) (#4603)

This commit is contained in:
qepasa
2018-03-26 12:01:59 +02:00
committed by Jakob Borg
parent 3c920c61e9
commit 2621c6fd2f
6 changed files with 360 additions and 39 deletions

View File

@@ -266,8 +266,7 @@ next:
// keep up with config changes to the rate and whether or not LAN
// connections are limited.
isLAN := s.isLAN(c.RemoteAddr())
wr := s.limiter.newWriteLimiter(c, isLAN)
rd := s.limiter.newReadLimiter(c, isLAN)
rd, wr := s.limiter.getLimiters(remoteID, c, isLAN)
protoConn := protocol.NewConnection(remoteID, rd, wr, s.model, c.String(), deviceCfg.Compression)
modelConn := completeConn{c, protoConn}