From dde404aeefacdbb3d62187544a409cf9cef71258 Mon Sep 17 00:00:00 2001 From: xengineering Date: Mon, 22 May 2023 21:25:19 +0200 Subject: Stop decoding on decoding errors This avoids an endless loop. --- xmpp/decoder.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/xmpp/decoder.go b/xmpp/decoder.go index 9a2e435..7139b5a 100644 --- a/xmpp/decoder.go +++ b/xmpp/decoder.go @@ -5,8 +5,6 @@ import ( "encoding/xml" "log" "os" - "io" - "errors" ) type decoder struct { @@ -48,11 +46,7 @@ func (r *decoder) run() { r.data <- xml.CopyToken(t) } if err != nil { - if errors.Is(err, io.EOF) { - return - } else { - log.Printf("Decoding error: %v", err) - } + return // FIXME disconnect on parsing error } } } -- cgit v1.2.3-70-g09d2