aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/xmpp/jingle/SocksConnection.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-14 20:35:11 +0200
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-14 20:35:11 +0200
commit18c3333271541a63d3ce626601661b7fc9bb7f53 (patch)
treedf02cb95576f8ce19e67c38795bb701a0a86b545 /src/eu/siacs/conversations/xmpp/jingle/SocksConnection.java
parent2014af0f7edec2433bc2dd2b65074db7af86a8ea (diff)
tried to fix some race conditions. not adding duplicate candidates. needs more checks though
Diffstat (limited to 'src/eu/siacs/conversations/xmpp/jingle/SocksConnection.java')
-rw-r--r--src/eu/siacs/conversations/xmpp/jingle/SocksConnection.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/xmpp/jingle/SocksConnection.java b/src/eu/siacs/conversations/xmpp/jingle/SocksConnection.java
index bf7c87ad..cfa24d50 100644
--- a/src/eu/siacs/conversations/xmpp/jingle/SocksConnection.java
+++ b/src/eu/siacs/conversations/xmpp/jingle/SocksConnection.java
@@ -160,9 +160,13 @@ public class SocksConnection {
count = (int) remainingSize;
}
count = inputStream.read(buffer, 0, count);
- fileOutputStream.write(buffer, 0, count);
- digest.update(buffer, 0, count);
- remainingSize-=count;
+ if (count==-1) {
+ Log.d("xmppService","end of stream");
+ } else {
+ fileOutputStream.write(buffer, 0, count);
+ digest.update(buffer, 0, count);
+ remainingSize-=count;
+ }
}
fileOutputStream.flush();
fileOutputStream.close();