Merge branch 'master' into pro-merge

This commit is contained in:
Urban Ishimwe
2020-06-16 22:43:08 +02:00
21 changed files with 308 additions and 140 deletions
+8 -2
View File
@@ -14,7 +14,7 @@ type RAWInput struct {
data chan *raw.TCPMessage
address string
expire time.Duration
quit chan bool
quit chan bool // Channel used only to indicate goroutine should shutdown
engine int
realIPHeader []byte
trackResponse bool
@@ -64,7 +64,13 @@ func NewRAWInput(address string, engine int, trackResponse bool, expire time.Dur
}
func (i *RAWInput) Read(data []byte) (int, error) {
msg := <-i.data
var msg *raw.TCPMessage
select {
case <-i.quit:
return 0, ErrorStopped
case msg = <-i.data:
}
buf := msg.Bytes()
var header []byte