aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-09-27 22:11:09 +0200
committerChristian Schneppe <christian@pix-art.de>2016-09-27 22:11:09 +0200
commit84a57e570683fde500a352495712df108c91a9da (patch)
tree0a307c6ea5c2abe6a0f6846003eee4f29d2c5630 /src/main/java/de
parentdb224342ec1c1bf9da989f8f3d083a6941867a3b (diff)
increase ReadTimeouts for HTTP connections
and remove the automatic upload retry
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java4
-rw-r--r--src/main/java/de/pixart/messenger/http/HttpUploadConnection.java10
2 files changed, 5 insertions, 9 deletions
diff --git a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
index 9a6676154..376ddb0cb 100644
--- a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
+++ b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
@@ -221,7 +221,7 @@ public class HttpDownloadConnection implements Transferable {
mHttpConnectionManager.setupTrustManager((HttpsURLConnection) connection, interactive);
}
connection.setConnectTimeout(Config.SOCKET_TIMEOUT * 1000);
- connection.setReadTimeout(Config.SOCKET_TIMEOUT * 1000);
+ connection.setReadTimeout(Config.CONNECT_TIMEOUT * 1000);
connection.connect();
String contentLength = connection.getHeaderField("Content-Length");
connection.disconnect();
@@ -291,7 +291,7 @@ public class HttpDownloadConnection implements Transferable {
connection.setRequestProperty("Range", "bytes="+size+"-");
}
connection.setConnectTimeout(Config.SOCKET_TIMEOUT * 1000);
- connection.setReadTimeout(Config.SOCKET_TIMEOUT * 1000);
+ connection.setReadTimeout(Config.CONNECT_TIMEOUT * 1000);
connection.connect();
is = new BufferedInputStream(connection.getInputStream());
boolean serverResumed = "bytes".equals(connection.getHeaderField("Accept-Ranges"));
diff --git a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
index 0d1448509..d12dde80e 100644
--- a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
+++ b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
@@ -89,12 +89,8 @@ public class HttpUploadConnection implements Transferable {
private void fail() {
mHttpConnectionManager.finishUploadConnection(this);
message.setTransferable(null);
- if (!canceled && file.getExpectedSize()<=Config.FILE_MAX_SIZE){
- mXmppConnectionService.resendMessage(message, delayed);
- } else {
- mXmppConnectionService.markMessage(message, Message.STATUS_SEND_FAILED);
- FileBackend.close(mFileInputStream);
- }
+ mXmppConnectionService.markMessage(message, Message.STATUS_SEND_FAILED);
+ FileBackend.close(mFileInputStream);
}
public void init(Message message, boolean delay) {
@@ -178,7 +174,7 @@ public class HttpUploadConnection implements Transferable {
connection.setRequestProperty("User-Agent",mXmppConnectionService.getIqGenerator().getIdentityName());
connection.setDoOutput(true);
connection.setConnectTimeout(Config.SOCKET_TIMEOUT * 1000);
- connection.setReadTimeout(Config.SOCKET_TIMEOUT * 1000);
+ connection.setReadTimeout(Config.CONNECT_TIMEOUT * 1000);
connection.connect();
os = connection.getOutputStream();
transmitted = 0;