aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-06-08 10:46:35 +0200
committerChristian Schneppe <christian@pix-art.de>2019-06-08 10:47:30 +0200
commit117513ce418b0c10af9fe4864761dec3895d2dc2 (patch)
tree56f26a97b52551b5b44ad62922d008af7f5c8a4a /src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
parentd5163d0a8b5f3ec2d350a69473846cef64590a10 (diff)
change minimum timeout for uploads/downloads
Diffstat (limited to 'src/main/java/de/pixart/messenger/http/HttpUploadConnection.java')
-rw-r--r--src/main/java/de/pixart/messenger/http/HttpUploadConnection.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
index 54d6fcb1a..609ad65d3 100644
--- a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
+++ b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
@@ -156,9 +156,9 @@ public class HttpUploadConnection implements Transferable {
try {
fileInputStream = new FileInputStream(file);
final int expectedFileSize = (int) file.getExpectedSize();
- final int readTimeout = (expectedFileSize / 2048) + Config.SOCKET_TIMEOUT; //assuming a minimum transfer speed of 16kbit/s
+ final int readTimeout = ((expectedFileSize / 2048) + Config.SOCKET_TIMEOUT) * 1000; //assuming a minimum transfer speed of 16kbit/s
wakeLock.acquire(readTimeout);
- Log.d(Config.LOGTAG, "uploading to " + slot.getPutUrl().toString() + " w/ read timeout of " + readTimeout + "s");
+ Log.d(Config.LOGTAG, "uploading to " + slot.getPutUrl().toString() + " w/ read timeout of " + readTimeout / 1000 + "s");
if (mUseTor || message.getConversation().getAccount().isOnion()) {
connection = (HttpURLConnection) slot.getPutUrl().openConnection(HttpConnectionManager.getProxy());
} else {
@@ -179,7 +179,7 @@ public class HttpUploadConnection implements Transferable {
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setConnectTimeout(Config.SOCKET_TIMEOUT * 1000);
- connection.setReadTimeout(readTimeout * 1000);
+ connection.setReadTimeout(readTimeout);
connection.connect();
final InputStream innerInputStream = AbstractConnectionManager.upgrade(file, fileInputStream, true);
os = connection.getOutputStream();