Skip to content

Commit d8a17cd

Browse files
Merge pull request #12 from FireTail-io/delete-conns
return each tcpassembly.Stream from New exactly once
2 parents 293887e + e072e46 commit d8a17cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bidirectional_stream.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func (f *bidirectionalStreamFactory) New(netFlow, tcpFlow gopacket.Flow) tcpasse
2424
key := netFlow.FastHash() ^ tcpFlow.FastHash()
2525

2626
// The second time we see the same connection, it will be from the server to the client
27-
if conn, ok := f.conns.Load(fmt.Sprint(key)); ok {
27+
if conn, ok := f.conns.LoadAndDelete(fmt.Sprint(key)); ok {
2828
return &conn.(*bidirectionalStream).serverToClient
2929
}
3030

0 commit comments

Comments
 (0)