Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Commit

Permalink
Be tolerant to a few errors from ipfix parser
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh committed Aug 9, 2013
1 parent 5a3c3ec commit dbacaa0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,20 @@ type myInterpretedField struct {
func messagesGenerator(s *ipfix.Session) <-chan []InterpretedRecord {
c := make(chan []InterpretedRecord)

errors := 0
go func() {
for {
msg, err := s.ReadMessage()
if err != nil {
panic(err)
errors++
if errors > 3 {
panic(err)
} else {
log.Println(err)
}
continue
} else {
errors = 0
}

irecs := make([]InterpretedRecord, len(msg.DataRecords))
Expand Down

0 comments on commit dbacaa0

Please sign in to comment.