This commit is contained in:
Simon Ser 2020-08-20 09:13:56 +02:00
parent a27e5ea92e
commit e523deb15c
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
2 changed files with 6 additions and 6 deletions

10
conn.go
View File

@ -107,8 +107,8 @@ func (wa websocketAddr) String() string {
} }
type rateLimiter struct { type rateLimiter struct {
C <-chan struct{} C <-chan struct{}
ticker *time.Ticker ticker *time.Ticker
stopped chan struct{} stopped chan struct{}
} }
@ -135,8 +135,8 @@ func newRateLimiter(delay time.Duration, burst int) *rateLimiter {
} }
}() }()
return &rateLimiter{ return &rateLimiter{
C: ch, C: ch,
ticker: ticker, ticker: ticker,
stopped: stopped, stopped: stopped,
} }
} }
@ -147,7 +147,7 @@ func (rl *rateLimiter) Stop() {
} }
type connOptions struct { type connOptions struct {
Logger Logger Logger Logger
RateLimitDelay time.Duration RateLimitDelay time.Duration
RateLimitBurst int RateLimitBurst int
} }

View File

@ -164,7 +164,7 @@ func connectToUpstream(network *network) (*upstreamConn, error) {
} }
options := connOptions{ options := connOptions{
Logger: logger, Logger: logger,
RateLimitDelay: upstreamMessageDelay, RateLimitDelay: upstreamMessageDelay,
RateLimitBurst: upstreamMessageBurst, RateLimitBurst: upstreamMessageBurst,
} }