aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmpp-vala/src/module/xep/0166_jingle.vala12
-rw-r--r--xmpp-vala/src/module/xep/0234_jingle_file_transfer.vala1
2 files changed, 10 insertions, 3 deletions
diff --git a/xmpp-vala/src/module/xep/0166_jingle.vala b/xmpp-vala/src/module/xep/0166_jingle.vala
index f5d112aa..2e38b164 100644
--- a/xmpp-vala/src/module/xep/0166_jingle.vala
+++ b/xmpp-vala/src/module/xep/0166_jingle.vala
@@ -397,6 +397,8 @@ public class Session {
private Connection connection;
public IOStream conn { get { return connection; } }
+ public bool terminate_on_connection_close { get; set; }
+
// INITIATE_SENT | INITIATE_RECEIVED | CONNECTING
Set<string> tried_transport_methods = new HashSet<string>();
TransportParameters? transport = null;
@@ -417,6 +419,7 @@ public class Session {
this.transport = transport;
this.connection = new Connection(this);
this.session_terminate_handler = (owned)session_terminate_handler;
+ this.terminate_on_connection_close = true;
}
public Session.initiate_received(string sid, TransportType type, TransportParameters? transport, Jid local_full_jid, Jid peer_full_jid, string content_name, owned SessionTerminate session_terminate_handler) {
@@ -435,6 +438,7 @@ public class Session {
}
this.connection = new Connection(this);
this.session_terminate_handler = (owned)session_terminate_handler;
+ this.terminate_on_connection_close = true;
}
public void handle_iq_set(XmppStream stream, string action, StanzaNode jingle, Iq.Stanza iq) throws IqError {
@@ -719,9 +723,11 @@ public class Session {
terminate(reason, "transport error: $(error.message)");
}
public void on_connection_close() {
- StanzaNode reason = new StanzaNode.build("reason", NS_URI)
- .put_node(new StanzaNode.build("success", NS_URI));
- terminate(reason, "success");
+ if (terminate_on_connection_close) {
+ StanzaNode reason = new StanzaNode.build("reason", NS_URI)
+ .put_node(new StanzaNode.build("success", NS_URI));
+ terminate(reason, "success");
+ }
}
public void terminate(StanzaNode reason, string? local_reason) {
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 867a26e3..43c212f5 100644
--- a/xmpp-vala/src/module/xep/0234_jingle_file_transfer.vala
+++ b/xmpp-vala/src/module/xep/0234_jingle_file_transfer.vala
@@ -45,6 +45,7 @@ public class Module : Jingle.ContentType, XmppStreamModule {
Jingle.Session session = stream.get_module(Jingle.Module.IDENTITY)
.create_session(stream, Jingle.TransportType.STREAMING, receiver_full_jid, Jingle.Senders.INITIATOR, "a-file-offer", description); // TODO(hrxi): Why "a-file-offer"?
+ session.terminate_on_connection_close = false;
yield session.conn.input_stream.close_async();