Add flag for connection rate limit and slow zero-progress operations

This commit is contained in:
Geoff Bourne
2019-07-09 07:22:20 -05:00
parent 7c7f0e1b3c
commit 433dd2233b
3 changed files with 38 additions and 17 deletions
+10
View File
@@ -7,6 +7,7 @@ import (
"io"
"net"
"strings"
"time"
)
func ReadPacket(reader io.Reader, addr net.Addr) (*Packet, error) {
@@ -70,6 +71,15 @@ func ReadFrame(reader io.Reader, addr net.Addr) (*Frame, error) {
WithField("total", total).
WithField("length", frame.Length).
Debug("Reading frame content")
if n == 0 {
logrus.
WithField("client", addr).
WithField("frame", frame).
Debug("No progress on frame reading")
time.Sleep(100 * time.Millisecond)
}
}
logrus.