diff options
author | fiaxh <git@lightrise.org> | 2021-08-19 15:39:58 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2021-08-19 15:42:18 +0200 |
commit | 863d66b16eb60c4b28b52af52d944bfd1dc1b21a (patch) | |
tree | 7ad904d6d00ac5c60dbba0d93b3a5ff8cd1909e2 /xmpp-vala/src | |
parent | c77d80d7b59cd28a9e730f9d1309bc6096d35fed (diff) | |
download | dino-863d66b16eb60c4b28b52af52d944bfd1dc1b21a.tar.gz dino-863d66b16eb60c4b28b52af52d944bfd1dc1b21a.zip |
Improve logging on jingle file transfer failure
Diffstat (limited to 'xmpp-vala/src')
-rw-r--r-- | xmpp-vala/src/module/xep/0166_jingle/session.vala | 1 | ||||
-rw-r--r-- | xmpp-vala/src/module/xep/0234_jingle_file_transfer.vala | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/xmpp-vala/src/module/xep/0166_jingle/session.vala b/xmpp-vala/src/module/xep/0166_jingle/session.vala index 0b377d0f..a45fc6db 100644 --- a/xmpp-vala/src/module/xep/0166_jingle/session.vala +++ b/xmpp-vala/src/module/xep/0166_jingle/session.vala @@ -407,6 +407,7 @@ public class Xmpp.Xep.Jingle.Session : Object { public void terminate(string? reason_name, string? reason_text, string? local_reason) { if (state == State.ENDED) return; + debug("Jingle session %s terminated: %s; %s; %s", this.sid, reason_name ?? "-", reason_text ?? "-", local_reason ?? "-"); if (state == State.ACTIVE) { string reason_str; diff --git a/xmpp-vala/src/module/xep/0234_jingle_file_transfer.vala b/xmpp-vala/src/module/xep/0234_jingle_file_transfer.vala index 4581019f..7b213ca5 100644 --- a/xmpp-vala/src/module/xep/0234_jingle_file_transfer.vala +++ b/xmpp-vala/src/module/xep/0234_jingle_file_transfer.vala @@ -105,9 +105,11 @@ public class Module : Jingle.ContentType, XmppStreamModule { yield io_stream.input_stream.close_async(); yield io_stream.output_stream.splice_async(input_stream, OutputStreamSpliceFlags.CLOSE_SOURCE|OutputStreamSpliceFlags.CLOSE_TARGET); yield connection.terminate(true); - } catch (Jingle.Error e) { - session.terminate(Jingle.ReasonElement.FAILED_TRANSPORT, e.message, e.message); - throw new Jingle.Error.GENERAL(@"couldn't create Jingle session: $(e.message)"); + } catch (Error e) { + if (session != null) { + session.terminate(Jingle.ReasonElement.FAILED_TRANSPORT, e.message, e.message); + } + throw new Jingle.Error.GENERAL("Couldn't send file via Jingle: %s", e.message); } } |