mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-31 13:16:16 +00:00
Remove unnecessary okhttp close when canceling.
Canceling should handle closing stuff now. And if we close from a different thread than the calling thread, okhttp will crash.
This commit is contained in:
@@ -13,6 +13,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.SocketException;
|
||||
|
||||
public class EncryptedCacheEncoder extends EncryptedCoder implements Encoder<InputStream> {
|
||||
|
||||
@@ -42,12 +43,14 @@ public class EncryptedCacheEncoder extends EncryptedCoder implements Encoder<Inp
|
||||
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, e);
|
||||
if (e instanceof SocketException) {
|
||||
Log.d(TAG, "Socket exception. Likely a cancellation.");
|
||||
} else {
|
||||
Log.w(TAG, e);
|
||||
}
|
||||
return false;
|
||||
} finally {
|
||||
byteArrayPool.put(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user