update: OkHttp3ConnectionManager
@@ -7,11 +7,8 @@ import com.dtflys.forest.exceptions.ForestRuntimeException;
import com.dtflys.forest.handler.LifeCycleHandler;
import com.dtflys.forest.http.ForestCookie;
import com.dtflys.forest.http.ForestCookies;
-import com.dtflys.forest.http.ForestHeader;
-import com.dtflys.forest.http.ForestHeaderMap;
import com.dtflys.forest.http.ForestProxy;
import com.dtflys.forest.http.ForestRequest;
-import com.dtflys.forest.reflection.ForestMethod;
import com.dtflys.forest.ssl.ForestX509TrustManager;
import com.dtflys.forest.ssl.SSLKeyStore;
import com.dtflys.forest.ssl.SSLUtils;
@@ -19,9 +16,7 @@ import com.dtflys.forest.ssl.TrustAllHostnameVerifier;
import com.dtflys.forest.ssl.TrustAllManager;
import com.dtflys.forest.utils.StringUtils;
import okhttp3.Authenticator;
-import okhttp3.CipherSuite;
import okhttp3.ConnectionPool;
-import okhttp3.ConnectionSpec;
import okhttp3.Cookie;
import okhttp3.CookieJar;
import okhttp3.Credentials;
@@ -30,26 +25,18 @@ import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.Route;
-import okhttp3.TlsVersion;
-import okhttp3.internal.connection.RealConnection;
import javax.annotation.Nullable;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
-import java.io.IOException;
-import java.lang.reflect.Method;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.security.KeyStore;
import java.time.Duration;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.Date;
-import java.util.Iterator;
import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
/**
@@ -118,9 +105,6 @@ public class OkHttp3ConnectionManager implements ForestConnectionManager {
ForestCookies cookies = new ForestCookies();
lifeCycleHandler.handleLoadCookie(request, cookies);
List<ForestCookie> forestCookies = cookies.allCookies();
- if (forestCookies.isEmpty()) {
- return new ArrayList<>(0);
- }
List<Cookie> okCookies = new ArrayList<>(forestCookies.size());
for (ForestCookie cookie : forestCookies) {
Duration maxAge = cookie.getMaxAge();
@@ -202,7 +186,6 @@ public class OkHttp3ConnectionManager implements ForestConnectionManager {
@Override
public void init(ForestConfiguration configuration) {
- int maxConnections = configuration.getMaxConnections();
pool = new ConnectionPool();
}
}
