stream.go
changeset 32 4e68d8f89dc3
parent 31 1dc47df5c99f
child 33 571713f49494
--- a/stream.go	Thu Dec 29 11:17:52 2011 -0700
+++ b/stream.go	Thu Dec 29 11:25:26 2011 -0700
@@ -253,6 +253,7 @@
 }
 
 func (cl *Client) handleFeatures(fe *Features) {
+	cl.Features = fe
 	if fe.Starttls != nil {
 		start := &starttls{XMLName: xml.Name{Space: nsTLS,
 			Local: "starttls"}}
@@ -297,6 +298,7 @@
 	tcp.SetReadTimeout(0)
 
 	log.Println("TLS negotiation succeeded.")
+	cl.Features = nil
 
 	// Now re-send the initial handshake message to start the new
 	// session.
@@ -357,6 +359,7 @@
 		log.Println("SASL authentication failed")
 	case "success":
 		log.Println("SASL authentication succeeded")
+		cl.Features = nil
 		ss := &stream{To: cl.Jid.Domain, Version: Version}
 		cl.xmlOut <- ss
 	}