From 1769afe3009b5b3cfa3beb3dcf051e41487be113 Mon Sep 17 00:00:00 2001 From: xengineering Date: Mon, 15 May 2023 20:26:26 +0200 Subject: 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(). --- xmpp.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 } } } -- cgit v1.2.3-70-g09d2