Software /
code /
verse
Changeset
329:2787e038bea2
verse.client: Use a different flag to indicate that our outgoing stream is closed
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 10 Feb 2013 04:52:17 +0100 |
parents | 328:55e3fd7b9731 |
children | 330:44d2bd1cee46 |
files | client.lua |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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