From c176f4c7377f1b5625b6c96d02f97cbbf83a0be3 Mon Sep 17 00:00:00 2001 From: "M. Mert Yildiran" Date: Thu, 12 May 2022 13:24:50 +0300 Subject: [PATCH] Rename `buffer` field to `pastData` --- tap/tcp_reader.go | 6 +++--- tap/tcp_stream.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tap/tcp_reader.go b/tap/tcp_reader.go index 2b5627e21..6f46e7a0a 100644 --- a/tap/tcp_reader.go +++ b/tap/tcp_reader.go @@ -21,7 +21,7 @@ type tcpReader struct { isClient bool isOutgoing bool msgQueue chan api.TcpReaderDataMsg // Channel of captured reassembled tcp payload - buffer []byte + pastData []byte data []byte progress *api.ReadProgress captureTime time.Time @@ -83,7 +83,7 @@ func (reader *tcpReader) isProtocolIdentified() bool { } func (reader *tcpReader) rewind() { - reader.data = reader.buffer + reader.data = reader.pastData } func (reader *tcpReader) Read(p []byte) (int, error) { @@ -96,7 +96,7 @@ func (reader *tcpReader) Read(p []byte) (int, error) { reader.data = msg.GetBytes() reader.captureTime = msg.GetTimestamp() if !reader.isProtocolIdentified() { - reader.buffer = append(reader.buffer, reader.data...) + reader.pastData = append(reader.pastData, reader.data...) } } diff --git a/tap/tcp_stream.go b/tap/tcp_stream.go index 876f1f5b6..8a30441f7 100644 --- a/tap/tcp_stream.go +++ b/tap/tcp_stream.go @@ -69,8 +69,8 @@ func (t *tcpStream) addReqResMatcher(reqResMatcher api.RequestResponseMatcher) { func (t *tcpStream) SetProtocol(protocol *api.Protocol) { t.protocol = protocol - t.client.buffer = []byte{} - t.server.buffer = []byte{} + t.client.pastData = []byte{} + t.server.pastData = []byte{} } func (t *tcpStream) GetOrigin() api.Capture {