From f67baab9837f1757e032e46f0f357fc52c8adbb5 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 17 Jun 2017 19:53:11 +0200 Subject: [PATCH] revised strategy for http upload read timeout --- .../java/eu/siacs/conversations/http/HttpUploadConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java index 3f8e20e70..32700e5a2 100644 --- a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java +++ b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java @@ -161,7 +161,7 @@ public class HttpUploadConnection implements Transferable { try { wakeLock.acquire(); final int expectedFileSize = (int) file.getExpectedSize(); - final int readTimeout = Math.max(Config.SOCKET_TIMEOUT,expectedFileSize / 2048); //assuming a minimum transfer speed of 16kbit/s + final int readTimeout = (expectedFileSize / 2048) + Config.SOCKET_TIMEOUT; //assuming a minimum transfer speed of 16kbit/s Log.d(Config.LOGTAG, "uploading to " + mPutUrl.toString()+ " w/ read timeout of "+readTimeout+"s"); if (mUseTor) { connection = (HttpURLConnection) mPutUrl.openConnection(mHttpConnectionManager.getProxy());