Improves comments

This commit is contained in:
Mickael Remond 2019-06-29 17:48:38 +02:00
parent 7c71d93026
commit 604d2c6c1e
No known key found for this signature in database
GPG key ID: E6F6045D79965AA3
2 changed files with 2 additions and 0 deletions

View file

@ -179,6 +179,7 @@ func (s *Session) rfc3921Session(o Config) {
}
var iq stanza.IQ
// We only negotiate session binding if it is mandatory, we skip it when optional.
if !s.Features.Session.IsOptional() {
fmt.Fprintf(s.streamLogger, "<iq type='set' id='%s'><session xmlns='%s'/></iq>", s.PacketId(), stanza.NSSession)
if s.err = s.decoder.Decode(&iq); s.err != nil {

View file

@ -99,6 +99,7 @@ func (s *StreamSession) IsOptional() bool {
if s.XMLName.Local == "session" {
return s.Optional
}
// If session element is missing, then we should not use session
return true
}