Re-use the existing OkHttpClient

Use the client we create earlier in the function
This commit is contained in:
Hampton Maxwell 2018-06-01 11:55:43 -07:00 committed by GitHub
parent 5ce228e9f7
commit 0776179834
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,7 +74,7 @@ public class DataSourceUtil {
CookieJarContainer container = (CookieJarContainer) client.cookieJar();
ForwardingCookieHandler handler = new ForwardingCookieHandler(context);
container.setCookieJar(new JavaNetCookieJar(handler));
return new OkHttpDataSourceFactory(OkHttpClientProvider.getOkHttpClient(), getUserAgent(context), bandwidthMeter);
return new OkHttpDataSourceFactory(client, getUserAgent(context), bandwidthMeter);
}
}