summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-05-15 20:26:26 +0200
committerxengineering <me@xengineering.eu>2023-05-15 20:26:26 +0200
commit1769afe3009b5b3cfa3beb3dcf051e41487be113 (patch)
treeb6de0097999a54d5314be2227adc68731d82fdba
parent757a8b7856bb7f72db6d95c208ba8cf66c0d54e7 (diff)
downloadlimox-1769afe3009b5b3cfa3beb3dcf051e41487be113.tar
limox-1769afe3009b5b3cfa3beb3dcf051e41487be113.tar.zst
limox-1769afe3009b5b3cfa3beb3dcf051e41487be113.zip
Copy received XML tokens
According to the documentation of the encoding/xml package tokens received from a decoder are only valid until the next call of decoder.Token().
-rw-r--r--xmpp.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/xmpp.go b/xmpp.go
index 015b9e1..a0aaba7 100644
--- a/xmpp.go
+++ b/xmpp.go
@@ -80,7 +80,8 @@ func (r *xmppReceiver) run() {
log.Print(err)
}
if t != nil {
- r.data <- t
+ c := xml.CopyToken(t)
+ r.data <- c
}
}
}