summaryrefslogtreecommitdiff
path: root/xmpp.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-05-10 18:08:49 +0200
committerxengineering <me@xengineering.eu>2023-05-10 18:09:27 +0200
commitf82aa566910de95288311076d15ebc9c4b0d279a (patch)
treed523be36b62fbff604da6f88bea317893379a414 /xmpp.go
parent73061a440f663bf8bb82f03861fddbaf15e48ae9 (diff)
downloadlimox-f82aa566910de95288311076d15ebc9c4b0d279a.tar
limox-f82aa566910de95288311076d15ebc9c4b0d279a.tar.zst
limox-f82aa566910de95288311076d15ebc9c4b0d279a.zip
Use io.TeeReader to output received XML stream
This should be used for debugging.
Diffstat (limited to 'xmpp.go')
-rw-r--r--xmpp.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/xmpp.go b/xmpp.go
index c40dee0..c9ae054 100644
--- a/xmpp.go
+++ b/xmpp.go
@@ -1,6 +1,8 @@
package main
import (
+ "io"
+ "os"
"crypto/tls"
"crypto/x509"
"encoding/xml"
@@ -39,7 +41,8 @@ func (l *Limox) xmpp(jid string, pwd string) {
termination := make(chan bool)
go func() {
quit := false
- dec := xml.NewDecoder(conn)
+ tee := io.TeeReader(conn, os.Stdout)
+ dec := xml.NewDecoder(tee)
for {
select {
case <-termination:
@@ -71,8 +74,8 @@ func (l *Limox) xmpp(jid string, pwd string) {
default:
//log.Fatalf("Unknown GuiEvent '%d'!\n", ev)
}
- case rx := <-receiver:
- logToken(rx, false)
+ case <-receiver:
+ // ignoring incoming XML tokens for now ...
}
if closing {
@@ -86,6 +89,7 @@ func (l *Limox) xmpp(jid string, pwd string) {
}
func logToken(t xml.Token, isTx bool) {
+ return
var prefix string
if isTx {
prefix = "C"