mirror of
https://github.com/buger/goreplay.git
synced 2026-10-21 04:26:29 +00:00
Don't block socket reading
This commit is contained in:
@@ -104,8 +104,10 @@ func (t *RAWTCPListener) readTCPPackets() {
|
||||
new_buf := make([]byte, n)
|
||||
copy(new_buf, buf[:n])
|
||||
|
||||
packet := NewTCPPacket(new_buf)
|
||||
t.c_packets <- packet
|
||||
go func(buf []byte) {
|
||||
packet := NewTCPPacket(new_buf)
|
||||
t.c_packets <- packet
|
||||
}(new_buf)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user