Skip to content

Commit 1bef9ad

Browse files
committed
Fix RFC6587 parsing on UDP.
My earlier fixes to UDP packet parsing broke RFC6587 parsing. By eliminating use of the scanner (and thus the requirement that lines should end with a \n character) I also removed the more functional RFC6587 scanner which does not require a \n but does advance over the length field. This patch restores use of the scanner where it is explicitly specified (currently just RFC6587). Signed-off-by: Alex Bligh <[email protected]>
1 parent 85980de commit 1bef9ad

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

server.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,13 @@ func (s *Server) goParseDatagrams() {
299299
if !ok {
300300
return
301301
}
302-
s.parser(msg.message, msg.client)
302+
if sf := s.format.GetSplitFunc(); sf != nil {
303+
if _, token, err := sf(msg.message, true); err == nil {
304+
s.parser(token, msg.client)
305+
}
306+
} else {
307+
s.parser(msg.message, msg.client)
308+
}
303309
}
304310
}
305311
}()

0 commit comments

Comments
 (0)