Rename buffer field to pastData

This commit is contained in:
M. Mert Yildiran 2022-05-12 13:24:50 +03:00
parent 8c8eb20ad6
commit c176f4c737
No known key found for this signature in database
GPG Key ID: D42ADB236521BF7A
2 changed files with 5 additions and 5 deletions

View File

@ -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...)
}
}

View File

@ -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 {