Improve logging on jingle file transfer failure

This commit is contained in:
fiaxh 2021-08-19 15:39:58 +02:00
parent c77d80d7b5
commit 863d66b16e
2 changed files with 6 additions and 3 deletions

View file

@ -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;

View file

@ -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) {
} catch (Error e) {
if (session != null) {
session.terminate(Jingle.ReasonElement.FAILED_TRANSPORT, e.message, e.message);
throw new Jingle.Error.GENERAL(@"couldn't create Jingle session: $(e.message)");
}
throw new Jingle.Error.GENERAL("Couldn't send file via Jingle: %s", e.message);
}
}