File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,7 @@ func (s *Server) goReadConnection(connection net.Conn) {
251251}
252252
253253func (s * Server ) read (readCloser * ReadCloser , client string , tlsPeer string ) {
254+ i := 0
254255loop:
255256 for {
256257 select {
@@ -261,10 +262,10 @@ loop:
261262 if s .readTimeoutMilliseconds > 0 {
262263 readCloser .closer .SetReadDeadline (time .Now ().Add (time .Duration (s .readTimeoutMilliseconds ) * time .Millisecond ))
263264 }
264- // Read up to and including first '<'
265+ // Read up to and including '<' delimiter
265266 token , err := readCloser .ReadString ('<' )
266- if token != "" {
267- // Re-add delimiter to start; remove from end
267+ if token != "" && i > 0 { // Skip traffic that doesnt start with '<'
268+ // Re-add '<' to start; remove from end
268269 token = "<" + token [:len (token )- 1 ]
269270 // Parse as syslog
270271 s .parser ([]byte (token ), client , tlsPeer )
@@ -278,6 +279,7 @@ loop:
278279 }
279280 break loop
280281 }
282+ i ++
281283 }
282284 // Close connection
283285 if conn , ok := readCloser .closer .(net.Conn ); ok {
You can’t perform that action at this time.
0 commit comments