aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-07-03 22:55:20 +0200
committeriNPUTmice <daniel@gultsch.de>2014-07-03 22:55:20 +0200
commit363682065d6874cf4549316cbc3ae46194e08be4 (patch)
treeac3ee6e0ca10d869c000496607f2a0458521dea3 /src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
parentf33d2497f85581b6b7e13fa1f3e088520227b346 (diff)
added timeout to jingle socket
Diffstat (limited to 'src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java')
-rw-r--r--src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java b/src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
index 508fe95c..1f287194 100644
--- a/src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
+++ b/src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
@@ -99,6 +99,7 @@ public class JingleConnection {
@Override
public void onFileTransferAborted() {
+ JingleConnection.this.sendCancel();
JingleConnection.this.cancel();
}
};
@@ -280,16 +281,26 @@ public class JingleConnection {
}
this.file = this.mXmppConnectionService.getFileBackend().getJingleFile(message,false);
if (message.getEncryption() == Message.ENCRYPTION_OTR) {
- this.file.setKey(conversation.getSymmetricKey());
+ byte[] key = conversation.getSymmetricKey();
+ if (key==null) {
+ this.sendCancel();
+ this.cancel();
+ return;
+ } else {
+ this.file.setKey(conversation.getSymmetricKey());
+ }
}
this.file.setExpectedSize(size);
} else {
+ this.sendCancel();
this.cancel();
}
} else {
+ this.sendCancel();
this.cancel();
}
} else {
+ this.sendCancel();
this.cancel();
}
}
@@ -410,6 +421,7 @@ public class JingleConnection {
connection.setActivated(true);
} else {
Log.d("xmppService","activated connection not found");
+ this.sendCancel();
this.cancel();
}
}
@@ -603,8 +615,7 @@ public class JingleConnection {
this.mJingleConnectionManager.finishConnection(this);
}
- void cancel() {
- this.sendCancel();
+ public void cancel() {
this.disconnect();
if (this.message!=null) {
if (this.responder.equals(account.getFullJid())) {