mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-29 09:39:54 +00:00
Rename buffer
field to pastData
This commit is contained in:
parent
8c8eb20ad6
commit
c176f4c737
@ -21,7 +21,7 @@ type tcpReader struct {
|
|||||||
isClient bool
|
isClient bool
|
||||||
isOutgoing bool
|
isOutgoing bool
|
||||||
msgQueue chan api.TcpReaderDataMsg // Channel of captured reassembled tcp payload
|
msgQueue chan api.TcpReaderDataMsg // Channel of captured reassembled tcp payload
|
||||||
buffer []byte
|
pastData []byte
|
||||||
data []byte
|
data []byte
|
||||||
progress *api.ReadProgress
|
progress *api.ReadProgress
|
||||||
captureTime time.Time
|
captureTime time.Time
|
||||||
@ -83,7 +83,7 @@ func (reader *tcpReader) isProtocolIdentified() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (reader *tcpReader) rewind() {
|
func (reader *tcpReader) rewind() {
|
||||||
reader.data = reader.buffer
|
reader.data = reader.pastData
|
||||||
}
|
}
|
||||||
|
|
||||||
func (reader *tcpReader) Read(p []byte) (int, error) {
|
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.data = msg.GetBytes()
|
||||||
reader.captureTime = msg.GetTimestamp()
|
reader.captureTime = msg.GetTimestamp()
|
||||||
if !reader.isProtocolIdentified() {
|
if !reader.isProtocolIdentified() {
|
||||||
reader.buffer = append(reader.buffer, reader.data...)
|
reader.pastData = append(reader.pastData, reader.data...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,8 +69,8 @@ func (t *tcpStream) addReqResMatcher(reqResMatcher api.RequestResponseMatcher) {
|
|||||||
|
|
||||||
func (t *tcpStream) SetProtocol(protocol *api.Protocol) {
|
func (t *tcpStream) SetProtocol(protocol *api.Protocol) {
|
||||||
t.protocol = protocol
|
t.protocol = protocol
|
||||||
t.client.buffer = []byte{}
|
t.client.pastData = []byte{}
|
||||||
t.server.buffer = []byte{}
|
t.server.pastData = []byte{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *tcpStream) GetOrigin() api.Capture {
|
func (t *tcpStream) GetOrigin() api.Capture {
|
||||||
|
Loading…
Reference in New Issue
Block a user