From 7b29491f10ee31d0c275fa69d96c3ac6af8fa7a7 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 20 May 2023 20:56:00 +0200 Subject: Copy received tokens The bytes the token refers to are just valid until a new token arrives. See the documentation of the encoding/xml package for details. --- xmpp/decoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmpp/decoder.go b/xmpp/decoder.go index 070f791..9a2e435 100644 --- a/xmpp/decoder.go +++ b/xmpp/decoder.go @@ -45,7 +45,7 @@ func (r *decoder) run() { if err != nil { log.Println("Could not flush debug output after receive!") } - r.data <- t + r.data <- xml.CopyToken(t) } if err != nil { if errors.Is(err, io.EOF) { -- cgit v1.2.3-70-g09d2