Correctly open new streams after StartTLS and auth

This commit is contained in:
Wichert Akkerman
2019-10-25 15:55:27 +02:00
committed by Mickaël Rémond
parent 33446ad0ba
commit 6da1962962
6 changed files with 52 additions and 43 deletions
+3 -2
View File
@@ -73,9 +73,10 @@ func (s *Session) init(o Config) {
}
func (s *Session) reset(o Config) {
if s.err != nil {
if s.StreamId, s.err = s.transport.StartStream(); s.err != nil {
return
}
s.Features = s.open(o.parsedJid.Domain)
}
@@ -108,7 +109,7 @@ func (s *Session) startTlsIfSupported(o Config) {
return
}
s.StreamId, s.err = s.transport.StartTLS()
s.err = s.transport.StartTLS()
if s.err == nil {
s.TlsEnabled = true