diff options
author | xengineering <me@xengineering.eu> | 2023-07-03 14:03:19 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-07-03 14:03:19 +0200 |
commit | 58aecc9d860a18767aa51d0d94793057e1aa57e2 (patch) | |
tree | 53286da2739ae794ce7d420bb913a93139961880 /xmpp/stream_pair.go | |
parent | 938e92387ae1aa3f771ed219ee65b2dbc34b6738 (diff) | |
download | limox-58aecc9d860a18767aa51d0d94793057e1aa57e2.tar limox-58aecc9d860a18767aa51d0d94793057e1aa57e2.tar.zst limox-58aecc9d860a18767aa51d0d94793057e1aa57e2.zip |
Remove intended breakage
This removes the injected broken code which made the race condition
reproducible.
Diffstat (limited to 'xmpp/stream_pair.go')
-rw-r--r-- | xmpp/stream_pair.go | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/xmpp/stream_pair.go b/xmpp/stream_pair.go index 2feea6b..87df86a 100644 --- a/xmpp/stream_pair.go +++ b/xmpp/stream_pair.go @@ -13,13 +13,13 @@ func runStreamPair(s *session) { for { select { -// case data := <-s.in: -// switch data.(type) { -// case SessionShouldDisconnect: -// return -// default: -// log.Printf("Unknown data '%d'!\n", data) -// } + 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 { @@ -66,13 +66,13 @@ func openStream(s *session) xml.EndElement { func syncStreams(s *session) { for { select { -// case data := <-s.in: -// switch data.(type) { -// case SessionShouldDisconnect: -// return -// default: -// log.Printf("Unhandled data '%d' during stream sync!\n", data) -// } + case data := <-s.in: + switch data.(type) { + case SessionShouldDisconnect: + return + default: + log.Printf("Unhandled data '%d' during stream sync!\n", data) + } case t := <-s.rx: switch token := t.(type) { case xml.StartElement: |