Skip to content

Commit

Permalink
Rename HttpClient.getNumRetriesSoFar to getCurrentRetryCount, convert…
Browse files Browse the repository at this point in the history
… HttpClientUnitTest to Kotlin, and remove unused function and test class (#1242)
  • Loading branch information
tdchow authored Dec 17, 2024
1 parent 8c181f1 commit a74fe2b
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 227 deletions.

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

0 comments on commit a74fe2b

Please sign in to comment.