diff options
author | xengineering <me@xengineering.eu> | 2023-07-04 12:58:13 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-07-04 12:58:13 +0200 |
commit | ea98ee187477051444bbf548757af6336d333862 (patch) | |
tree | 6901908aed0bfcded1c73b230d170e51fd931b9f /xmpp/xml.go | |
parent | 8e84ca8a4d340956bd0aaead59d5c79dcaede6a5 (diff) | |
download | limox-ea98ee187477051444bbf548757af6336d333862.tar limox-ea98ee187477051444bbf548757af6336d333862.tar.zst limox-ea98ee187477051444bbf548757af6336d333862.zip |
Re-implement stream open and close
This is more suitable for the new RX concept.
Diffstat (limited to 'xmpp/xml.go')
-rw-r--r-- | xmpp/xml.go | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/xmpp/xml.go b/xmpp/xml.go index 14c6637..36d7eb1 100644 --- a/xmpp/xml.go +++ b/xmpp/xml.go @@ -22,13 +22,18 @@ func runRx(ctx context.Context, chn chan xml.Token, conn *tls.Conn) { default: t, err := d.Token() if t != nil && err == nil { - switch t.(type) { - case xml.ProcInst: - case xml.Directive: - case xml.Comment: - default: - c := xml.CopyToken(t) - chn <- c + switch e := t.(type) { + case xml.StartElement: + if e.Name.Local == "stream" { + // new server-side stream TODO what to do with this info? + } else { +// route(&e, &d, chn, getRoutingTable()) + } + case xml.EndElement: + if e.Name.Local == "stream" { + // TODO end complete session + return + } } } if err != nil { |