Fix the linter error

This commit is contained in:
M. Mert Yildiran 2022-05-01 19:09:27 +03:00
parent 41527c1be5
commit 966c9dbf55
No known key found for this signature in database
GPG Key ID: D42ADB236521BF7A
2 changed files with 3 additions and 3 deletions

View File

@ -82,7 +82,7 @@ func (d dissecting) Dissect(b *bufio.Reader, reader api.TcpReader, options *api.
frame, err := r.ReadFrame()
if err == io.EOF {
// We must read until we see an EOF... very important!
return nil
return err
}
switch f := frame.(type) {

View File

@ -54,8 +54,8 @@ func (reader *tcpReader) run(options *api.TrafficFilteringOptions, wg *sync.Wait
reader.reqResMatcher = reader.parent.reqResMatchers[i]
reader.counterPair = reader.parent.counterPairs[i]
b := bufio.NewReader(reader)
extension.Dissector.Dissect(b, reader, options)
if reader.parent.protocol != nil {
err := extension.Dissector.Dissect(b, reader, options)
if err == nil || reader.parent.protocol != nil {
break
}
reader.exhaustBuffer = true