aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/http
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-05-17 21:09:46 +0200
committerChristian Schneppe <christian@pix-art.de>2018-05-17 21:09:46 +0200
commita68be2f67ea5472dd17611e4cd4a4acf6acdef5f (patch)
tree41ddd02462ca536c2a5aa8e241f46c03364c7851 /src/main/java/de/pixart/messenger/http
parente4128f1227832580702a53f8ce3909b1f378ef79 (diff)
some tor modifications
possibly fixes #199
Diffstat (limited to 'src/main/java/de/pixart/messenger/http')
-rw-r--r--src/main/java/de/pixart/messenger/http/HttpConnectionManager.java2
-rw-r--r--src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java8
-rw-r--r--src/main/java/de/pixart/messenger/http/HttpUploadConnection.java2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/http/HttpConnectionManager.java b/src/main/java/de/pixart/messenger/http/HttpConnectionManager.java
index 340bc6d7a..383fe72a5 100644
--- a/src/main/java/de/pixart/messenger/http/HttpConnectionManager.java
+++ b/src/main/java/de/pixart/messenger/http/HttpConnectionManager.java
@@ -72,7 +72,7 @@ public class HttpConnectionManager extends AbstractConnectionManager {
}
}
- public Proxy getProxy() throws IOException {
+ public static Proxy getProxy() throws IOException {
return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(InetAddress.getByAddress(new byte[]{127, 0, 0, 1}), 8118));
}
}
diff --git a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
index fd2c054c3..2120ab309 100644
--- a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
+++ b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
@@ -226,12 +226,12 @@ public class HttpDownloadConnection implements Transferable {
private long retrieveFileSize() throws IOException {
PowerManager.WakeLock wakeLock = mHttpConnectionManager.createWakeLock("http_download_filesize" + message.getUuid());
try {
- WakeLockHelper.acquire(wakeLock);
+ wakeLock.acquire();
Log.d(Config.LOGTAG, "retrieve file size. interactive:" + String.valueOf(interactive));
changeStatus(STATUS_CHECKING);
HttpURLConnection connection;
if (mUseTor) {
- connection = (HttpURLConnection) mUrl.openConnection(mHttpConnectionManager.getProxy());
+ connection = (HttpURLConnection) mUrl.openConnection(HttpConnectionManager.getProxy());
} else {
connection = (HttpURLConnection) mUrl.openConnection();
}
@@ -299,9 +299,9 @@ public class HttpDownloadConnection implements Transferable {
HttpURLConnection connection = null;
PowerManager.WakeLock wakeLock = mHttpConnectionManager.createWakeLock("http_download_" + message.getUuid());
try {
- WakeLockHelper.acquire(wakeLock);
+ wakeLock.acquire();
if (mUseTor) {
- connection = (HttpURLConnection) mUrl.openConnection(mHttpConnectionManager.getProxy());
+ connection = (HttpURLConnection) mUrl.openConnection(HttpConnectionManager.getProxy());
} else {
connection = (HttpURLConnection) mUrl.openConnection();
}
diff --git a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
index fb2d1d49e..e598db080 100644
--- a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
+++ b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
@@ -188,7 +188,7 @@ public class HttpUploadConnection implements Transferable {
wakeLock.acquire(readTimeout);
Log.d(Config.LOGTAG, "uploading to " + mPutUrl.toString() + " w/ read timeout of " + readTimeout + "s");
if (mUseTor) {
- connection = (HttpURLConnection) mPutUrl.openConnection(mHttpConnectionManager.getProxy());
+ connection = (HttpURLConnection) mPutUrl.openConnection(HttpConnectionManager.getProxy());
} else {
connection = (HttpURLConnection) mPutUrl.openConnection();
}