diff options
author | xengineering <me@xengineering.eu> | 2023-05-10 18:08:49 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-05-10 18:09:27 +0200 |
commit | f82aa566910de95288311076d15ebc9c4b0d279a (patch) | |
tree | d523be36b62fbff604da6f88bea317893379a414 /xmpp.go | |
parent | 73061a440f663bf8bb82f03861fddbaf15e48ae9 (diff) | |
download | limox-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.go | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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" |