diff options
Diffstat (limited to 'src/eu/siacs/conversations/xmpp/jingle/SocksConnection.java')
-rw-r--r-- | src/eu/siacs/conversations/xmpp/jingle/SocksConnection.java | 10 |
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(); |