Don't close the wrong end of a channel. But if we get an error, we can close the underlying socket.
authorChris Jones <christian.jones@sri.com>
Wed, 11 Sep 2013 17:17:50 -0600
changeset 140 f94b958f8df0
parent 139 12c48d1157dc
child 141 f0d0f3b941a6
Don't close the wrong end of a channel. But if we get an error, we can close the underlying socket.
xmpp/stream.go
--- a/xmpp/stream.go	Mon Sep 09 04:27:53 2013 +0100
+++ b/xmpp/stream.go	Wed Sep 11 17:17:50 2013 -0600
@@ -305,7 +305,7 @@
 
 func (cl *Client) handleStreamError(se *streamError) {
 	Info.Logf("Received stream error: %v", se)
-	close(cl.Send)
+	cl.socket.Close()
 }
 
 func (cl *Client) handleFeatures(fe *Features) {