client.lua

changeset 329
2787e038bea2
parent 323
5bf3b13edb80
child 336
658c62c9ecc4
--- a/client.lua	Sun Feb 10 04:29:20 2013 +0100
+++ b/client.lua	Sun Feb 10 04:52:17 2013 +0100
@@ -32,9 +32,10 @@
 end
 
 function stream_callbacks.streamclosed(stream)
-	if not stream.notopen then
+	stream.notopen = true;
+	if not stream.closed then
 		stream:send("</stream:stream>");
-		stream.notopen = true;
+		stream.closed = true;
 	end
 	stream:event("closed");
 	return stream:close("stream closed")
@@ -135,9 +136,9 @@
 	local _base_close = self.close;
 	function self:close(reason)
 		self.close = _base_close;
-		if not self.notopen then
+		if not self.closed then
 			self:send("</stream:stream>");
-			self.notopen = true;
+			self.closed = true;
 		else
 			return self:close(reason);
 		end

mercurial