aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/http
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-06-24 09:05:08 +0200
committerChristian Schneppe <christian@pix-art.de>2017-06-24 09:05:08 +0200
commit2d90918664e194b9cdcabb03fd15ea0fedc1e083 (patch)
tree6866d33de84b66131ba1496cb50eb59ffd1606b1 /src/main/java/de/pixart/messenger/http
parent1711c6d52a878dd74d24dda0c6b5fbedbbad75da (diff)
revised strategy for http upload read timeout
Diffstat (limited to 'src/main/java/de/pixart/messenger/http')
-rw-r--r--src/main/java/de/pixart/messenger/http/HttpUploadConnection.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
index 984e4dbcd..48485eaf7 100644
--- a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
+++ b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
@@ -163,7 +163,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());