diff options
author | xengineering <me@xengineering.eu> | 2023-05-11 20:38:41 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-05-11 20:38:41 +0200 |
commit | 03c43e5db20d4c4613ec56ee1ec4c4255398d630 (patch) | |
tree | a45c147801dd9e87686205a51b47e54d13a754a0 | |
parent | 0dd1fb9f2158dec48c8dc55a078b3d79d475c9d9 (diff) | |
download | limox-03c43e5db20d4c4613ec56ee1ec4c4255398d630.tar limox-03c43e5db20d4c4613ec56ee1ec4c4255398d630.tar.zst limox-03c43e5db20d4c4613ec56ee1ec4c4255398d630.zip |
Refactor rxRoutine
-rw-r--r-- | xmpp.go | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -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 - } } } |