mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-07-03 20:24:30 +02:00
ratelimit: Increase ratelimit to avoid failing handshakes
Regarding #171
This commit is contained in:
parent
c8661e6883
commit
15e14a0872
@ -44,8 +44,8 @@ type inputLimiter struct {
|
|||||||
func NewInputLimiter() rateio.Limiter {
|
func NewInputLimiter() rateio.Limiter {
|
||||||
grace := time.Second * 3
|
grace := time.Second * 3
|
||||||
return &inputLimiter{
|
return &inputLimiter{
|
||||||
Amount: 200 * 4 * 2, // Assume fairly high typing rate + margin for copypasta of links.
|
Amount: 200 * 4 * 5, // Assume fairly high typing rate + margin for copypasta of links + large key handshakes
|
||||||
Frequency: time.Minute * 2,
|
Frequency: time.Minute * 1,
|
||||||
readCap: 128, // Allow up to 128 bytes per read (anecdotally, 1 character = 52 bytes over ssh)
|
readCap: 128, // Allow up to 128 bytes per read (anecdotally, 1 character = 52 bytes over ssh)
|
||||||
numRead: -1024 * 1024, // Start with a 1mb grace
|
numRead: -1024 * 1024, // Start with a 1mb grace
|
||||||
timeRead: time.Now().Add(grace),
|
timeRead: time.Now().Add(grace),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user