summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-05-22 21:25:19 +0200
committerxengineering <me@xengineering.eu>2023-05-22 21:25:19 +0200
commitdde404aeefacdbb3d62187544a409cf9cef71258 (patch)
tree7fd729d8571bdfbbfd6e6b33a6af647a9af538c6
parentc39b4f6bf147aca788dc02832a985700b6e4eba9 (diff)
downloadlimox-dde404aeefacdbb3d62187544a409cf9cef71258.tar
limox-dde404aeefacdbb3d62187544a409cf9cef71258.tar.zst
limox-dde404aeefacdbb3d62187544a409cf9cef71258.zip
Stop decoding on decoding errors
This avoids an endless loop.
-rw-r--r--xmpp/decoder.go8
1 files changed, 1 insertions, 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
}
}
}