summaryrefslogtreecommitdiff
path: root/xmpp/encoder_decoder.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-07-01 20:57:15 +0200
committerxengineering <me@xengineering.eu>2023-07-01 20:57:15 +0200
commit6e973cfabe17421748af51856351f83e9856d137 (patch)
tree1321563b28a7fc0c8b5748210e802986e965e595 /xmpp/encoder_decoder.go
parent342364d134ad4bbf64b1d0f077fb74fd0d86b454 (diff)
downloadlimox-6e973cfabe17421748af51856351f83e9856d137.tar
limox-6e973cfabe17421748af51856351f83e9856d137.tar.zst
limox-6e973cfabe17421748af51856351f83e9856d137.zip
Drop xml.{ProcInst,Directive,Comment}
LimoX does not care about these XML tokens at least for now. The issued error messages on other levels. Dropping those tokens on the encoderDecoder level asserts that the rest of the xmpp code has only `clean` XML content to process.
Diffstat (limited to 'xmpp/encoder_decoder.go')
-rw-r--r--xmpp/encoder_decoder.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/xmpp/encoder_decoder.go b/xmpp/encoder_decoder.go
index d7951b3..b0ea77b 100644
--- a/xmpp/encoder_decoder.go
+++ b/xmpp/encoder_decoder.go
@@ -59,8 +59,14 @@ func (ed *encoderDecoder) run() {
default:
t, err := ed.rx.Token()
if t != nil && err == nil {
- c := xml.CopyToken(t)
- ed.session.rx <- c
+ switch t.(type) {
+ case xml.ProcInst:
+ case xml.Directive:
+ case xml.Comment:
+ default:
+ c := xml.CopyToken(t)
+ ed.session.rx <- c
+ }
}
if err != nil {
if errors.Is(err, io.EOF) {