diff options
author | fiaxh <git@lightrise.org> | 2020-07-21 15:48:42 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2020-07-21 15:48:42 +0200 |
commit | c887240fdcdbc8f76c6bdd37b1174b8154907c4c (patch) | |
tree | 889151d1947482a7da968c076b7bf8e09da91e8b /xmpp-vala/src/core/stanza_writer.vala | |
parent | 7309c6f3ac4e580f197b4835d05bb011fa90780b (diff) | |
download | dino-c887240fdcdbc8f76c6bdd37b1174b8154907c4c.tar.gz dino-c887240fdcdbc8f76c6bdd37b1174b8154907c4c.zip |
Improve stream management queue
Diffstat (limited to 'xmpp-vala/src/core/stanza_writer.vala')
-rw-r--r-- | xmpp-vala/src/core/stanza_writer.vala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xmpp-vala/src/core/stanza_writer.vala b/xmpp-vala/src/core/stanza_writer.vala index 51f0061f..62fe022a 100644 --- a/xmpp-vala/src/core/stanza_writer.vala +++ b/xmpp-vala/src/core/stanza_writer.vala @@ -1,6 +1,8 @@ namespace Xmpp { public class StanzaWriter { + public signal void cancel(); + private OutputStream output; private Queue<SourceFuncWrapper> queue = new Queue<SourceFuncWrapper>(); @@ -43,6 +45,7 @@ public class StanzaWriter { try { yield output.write_all_async(data, 0, null, null); } catch (GLib.Error e) { + cancel(); throw new XmlError.IO(@"IOError in GLib: $(e.message)"); } finally { SourceFuncWrapper? sfw = queue.pop_head(); |