From 9f87ef34c589825d65824a8c9210fed5bf92f94d Mon Sep 17 00:00:00 2001 From: xengineering Date: Tue, 4 Jul 2023 12:33:12 +0200 Subject: Remove runStreamPair() This will not be used in the new RX concept. --- xmpp/sasl.go | 1 - xmpp/session.go | 2 -- xmpp/streams.go | 29 ----------------------------- 3 files changed, 32 deletions(-) diff --git a/xmpp/sasl.go b/xmpp/sasl.go index 0c13f36..a20ae56 100644 --- a/xmpp/sasl.go +++ b/xmpp/sasl.go @@ -60,7 +60,6 @@ func hasSaslPlain(e []xml.Token) bool { } func saslSuccessHandler(s *session, e []xml.Token) { - runStreamPair(s) } func saslFailureHandler(s *session, e []xml.Token) { diff --git a/xmpp/session.go b/xmpp/session.go index 6a5e646..f18fd2a 100644 --- a/xmpp/session.go +++ b/xmpp/session.go @@ -57,8 +57,6 @@ func (s *session) run() { s.tx = xml.NewEncoder(w) s.out <- SessionConnect{} - - runStreamPair(s) } func (s *session) startTransport() error { diff --git a/xmpp/streams.go b/xmpp/streams.go index 5ba4c1d..388be4d 100644 --- a/xmpp/streams.go +++ b/xmpp/streams.go @@ -5,35 +5,6 @@ import ( "log" ) -func runStreamPair(s *session) { - end := openStream(s) - defer closeStream(s, end) - - buf := newElementBuffer() - - for { - select { - case data := <-s.in: - switch data.(type) { - case SessionShouldDisconnect: - return - default: - log.Printf("Unknown data '%d'!\n", data) - } - case t := <-s.rx: - err := buf.add(t) - if err != nil { - log.Printf("Could not add XML token to buffer: %v\n", err) - return - } - if buf.isComplete() { - element := buf.reset() - route(s, element, getRoutingTable()) - } - } - } -} - func openStream(s *session) xml.EndElement { start := xml.StartElement{ xml.Name{"jabber:client", "stream:stream"}, -- cgit v1.2.3-70-g09d2