summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
- }
}
}