From cc7cdb383cd18edf998507b65e6e44274321a442 Mon Sep 17 00:00:00 2001 From: m2049r Date: Sat, 7 Jan 2023 10:22:21 +0100 Subject: [PATCH] tweak http timeouts so sideshift does not timeout (#881) --- .../com/m2049r/xmrwallet/util/NetCipherHelper.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/m2049r/xmrwallet/util/NetCipherHelper.java b/app/src/main/java/com/m2049r/xmrwallet/util/NetCipherHelper.java index 418e97f9..8dc481f2 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/util/NetCipherHelper.java +++ b/app/src/main/java/com/m2049r/xmrwallet/util/NetCipherHelper.java @@ -56,7 +56,9 @@ import timber.log.Timber; @RequiredArgsConstructor public class NetCipherHelper implements StatusCallback { public static final String USER_AGENT = "Monerujo/1.0"; - public static final int HTTP_TIMEOUT = 1000; //ms + public static final int HTTP_TIMEOUT_CONNECT = 1000; //ms + public static final int HTTP_TIMEOUT_READ = 2000; //ms + public static final int HTTP_TIMEOUT_WRITE = 1000; //ms public static final int TOR_TIMEOUT_CONNECT = 5000; //ms public static final int TOR_TIMEOUT = 2000; //ms @@ -117,9 +119,9 @@ public class NetCipherHelper implements StatusCallback { private void createClearnetClient() { try { client = new OkHttpClient.Builder() - .connectTimeout(HTTP_TIMEOUT, TimeUnit.MILLISECONDS) - .writeTimeout(HTTP_TIMEOUT, TimeUnit.MILLISECONDS) - .readTimeout(HTTP_TIMEOUT, TimeUnit.MILLISECONDS) + .connectTimeout(HTTP_TIMEOUT_CONNECT, TimeUnit.MILLISECONDS) + .writeTimeout(HTTP_TIMEOUT_WRITE, TimeUnit.MILLISECONDS) + .readTimeout(HTTP_TIMEOUT_READ, TimeUnit.MILLISECONDS) .build(); Helper.ALLOW_SHIFT = true; } catch (Exception ex) {