From 03c43e5db20d4c4613ec56ee1ec4c4255398d630 Mon Sep 17 00:00:00 2001 From: xengineering Date: Thu, 11 May 2023 20:38:41 +0200 Subject: Refactor rxRoutine --- xmpp.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/xmpp.go b/xmpp.go index 90a0355..89be5a9 100644 --- a/xmpp.go +++ b/xmpp.go @@ -67,21 +67,17 @@ func setupConn(jid string) (*tls.Conn, error) { } func rxRoutine(conn *tls.Conn, tokens chan xml.Token, terminator chan bool) { - quit := false dec := xml.NewDecoder(conn) for { select { case <-terminator: - quit = true + return default: - t, _ := dec.Token() + t, _ := dec.Token() // TODO error handling if t != nil { tokens <- t } } - if quit { - break - } } } -- cgit v1.2.3-70-g09d2