Browse Source

Merge pull request #565 from twig/TD-416-fix-utorrent-upload

#416 fix file upload not working for utorrent
pull/585/head
Eric Kok 4 years ago committed by GitHub
parent
commit
ff790abdae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      app/src/main/java/org/transdroid/daemon/adapters/uTorrent/UTorrentAdapter.java

8
app/src/main/java/org/transdroid/daemon/adapters/uTorrent/UTorrentAdapter.java

@ -22,8 +22,10 @@ import com.android.internal.http.multipart.MultipartEntity; @@ -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 { @@ -119,6 +121,7 @@ public class UTorrentAdapter implements IDaemonAdapter, RemoteRssSupplier {
private static ArrayList<RemoteRssChannel> remoteRssChannels = new ArrayList<>();
private DaemonSettings settings;
private DefaultHttpClient httpclient;
private static CookieStore cookieStore;
/**
@ -462,7 +465,12 @@ public class UTorrentAdapter implements IDaemonAdapter, RemoteRssSupplier { @@ -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);
}
/**

Loading…
Cancel
Save