From bb1e1a8b243e82923587887837f67d6466b3ed66 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 9 Mar 2022 23:00:47 -0500 Subject: [PATCH] Close socks5 connection when done sending data Sometimes even in Conversations-to-Conversations I see symptoms like receiver says 99% done, sender says 100% done, hangs like that and then file transfer fails. I was having this issue fairly reliably between my emulator and my test device. Adding this close caused the transfer to succeed 100% of the time. I'm not sure why the receiver didn't read all the data properly without the close, but this fixes it. --- .../conversations/xmpp/jingle/JingleFileTransferConnection.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleFileTransferConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleFileTransferConnection.java index c86d4280b..2411170c6 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleFileTransferConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleFileTransferConnection.java @@ -151,6 +151,7 @@ public class JingleFileTransferConnection extends AbstractJingleConnection imple if (message.getEncryption() == Message.ENCRYPTION_PGP || message.getEncryption() == Message.ENCRYPTION_DECRYPTED) { file.delete(); } + disconnectSocks5Connections(); } Log.d(Config.LOGTAG, "successfully transmitted file:" + file.getAbsolutePath() + " (" + CryptoHelper.bytesToHex(file.getSha1Sum()) + ")"); if (message.getEncryption() != Message.ENCRYPTION_PGP) {