Skip to content

Commit

Permalink
remote-capture: Fix returning correct error in LazyPcapReader.ReadPac…
Browse files Browse the repository at this point in the history
…ketData

Signed-off-by: Chance Zibolski <chance.zibolski@gmail.com>
  • Loading branch information
chancez committed Jul 20, 2024
1 parent 802a4d5 commit 70cf848
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/remote_capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ func (r *LazyPcapReader) init() {
}
}

func (r *LazyPcapReader) ReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) {
func (r *LazyPcapReader) ReadPacketData() ([]byte, gopacket.CaptureInfo, error) {
r.once.Do(r.init)
if r.err != nil {
return nil, gopacket.CaptureInfo{}, err
return nil, gopacket.CaptureInfo{}, r.err
}
return r.pcapReader.ReadPacketData()
}
Expand Down

0 comments on commit 70cf848

Please sign in to comment.