summaryrefslogtreecommitdiff
path: root/xmpp.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-05-11 20:38:41 +0200
committerxengineering <me@xengineering.eu>2023-05-11 20:38:41 +0200
commit03c43e5db20d4c4613ec56ee1ec4c4255398d630 (patch)
treea45c147801dd9e87686205a51b47e54d13a754a0 /xmpp.go
parent0dd1fb9f2158dec48c8dc55a078b3d79d475c9d9 (diff)
downloadlimox-03c43e5db20d4c4613ec56ee1ec4c4255398d630.tar
limox-03c43e5db20d4c4613ec56ee1ec4c4255398d630.tar.zst
limox-03c43e5db20d4c4613ec56ee1ec4c4255398d630.zip
Refactor rxRoutine
Diffstat (limited to 'xmpp.go')
-rw-r--r--xmpp.go8
1 files 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
- }
}
}