From dfe5e122bc12b96f0034ca99799b05d7a1a7b062 Mon Sep 17 00:00:00 2001 From: Twig N Date: Fri, 28 Aug 2020 21:14:14 +1000 Subject: [PATCH] \#416 - added cookieStore to UtorrentAdapter --- .../daemon/adapters/uTorrent/UTorrentAdapter.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/org/transdroid/daemon/adapters/uTorrent/UTorrentAdapter.java b/app/src/main/java/org/transdroid/daemon/adapters/uTorrent/UTorrentAdapter.java index e6e58f93..2d9e203d 100644 --- a/app/src/main/java/org/transdroid/daemon/adapters/uTorrent/UTorrentAdapter.java +++ b/app/src/main/java/org/transdroid/daemon/adapters/uTorrent/UTorrentAdapter.java @@ -22,8 +22,10 @@ import com.android.internal.http.multipart.MultipartEntity; import com.android.internal.http.multipart.Part; import org.apache.http.HttpResponse; +import org.apache.http.client.CookieStore; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.BasicCookieStore; import org.apache.http.impl.client.DefaultHttpClient; import org.json.JSONArray; import org.json.JSONException; @@ -119,6 +121,7 @@ public class UTorrentAdapter implements IDaemonAdapter, RemoteRssSupplier { private static ArrayList remoteRssChannels = new ArrayList<>(); private DaemonSettings settings; private DefaultHttpClient httpclient; + private static CookieStore cookieStore; /** @@ -462,7 +465,12 @@ public class UTorrentAdapter implements IDaemonAdapter, RemoteRssSupplier { * @throws DaemonException On conflicting or missing settings */ private void initialise() throws DaemonException { + if (this.cookieStore == null) { + this.cookieStore = new BasicCookieStore(); + } + this.httpclient = HttpHelper.createStandardHttpClient(settings, true); + this.httpclient.setCookieStore(this.cookieStore); } /**