Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpClient refactor and clean up #1242

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class HttpClient internal constructor(
}

if (url != null) {
val retryCount = getNumRetriesSoFar(url)
val retryCount = getCurrentRetryCount(url)
val shouldRetry = ((retryCount + 1) < MAX_RETRY_ATTEMPTS)
if (shouldRetry) {
scheduleRequest(request, retryStrategy, callback)
Expand All @@ -85,10 +85,7 @@ class HttpClient internal constructor(
}
}

private fun getNumRetriesSoFar(url: URL): Int {
val retryCount = retryCountMap[url] ?: return 0
return retryCount
}
private fun getCurrentRetryCount(url: URL) = retryCountMap[url] ?: 0

private fun resetRetryCount(request: HttpRequest) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,6 @@ public class TLSSocketFactory extends SSLSocketFactory {

private final SSLSocketFactory internalSSLSocketFactory;

static TLSSocketFactory newInstance() throws SSLException {
return new TLSSocketFactory();
}

TLSSocketFactory() throws SSLException {
try {
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, null, null); // use system security providers
internalSSLSocketFactory = sslContext.getSocketFactory();
} catch (NoSuchAlgorithmException | KeyManagementException e) {
throw new SSLException(e.getMessage());
}
}

/**
* @see <a href="http://developer.android.com/training/articles/security-ssl.html#UnknownCa">Android Documentation</a>
*/
Expand Down

This file was deleted.

Loading
Loading