aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmpp-vala/src/module/xep/0166_jingle/session.vala1
-rw-r--r--xmpp-vala/src/module/xep/0234_jingle_file_transfer.vala8
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);
}
}