Skip to content

Commit

Permalink
Merge pull request #904 from nextcloud/backport/897/stable-2.10
Browse files Browse the repository at this point in the history
[stable-2.10] Bump okhttp to 5.0.0-alpha7 for Happy Eyeballs support
  • Loading branch information
tobiasKaminsky authored Jun 3, 2022
2 parents 5c1b995 + 41add5d commit 4821c17
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 125 deletions.
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ configurations {

dependencies {
implementation 'org.apache.jackrabbit:jackrabbit-webdav:2.13.5'
api 'com.squareup.okhttp3:okhttp:4.9.3'
api 'com.squareup.okhttp3:okhttp:5.0.0-alpha.7'
implementation 'com.gitlab.bitfireAT:dav4jvm:2.1.3' // in transition phase, we use old and new libs
implementation group: 'com.google.code.gson', name: 'gson', version: '2.9.0'
implementation 'androidx.annotation:annotation:1.3.0'
Expand Down
38 changes: 0 additions & 38 deletions library/src/main/java/com/nextcloud/common/IPV6PreferringDNS.kt

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import com.owncloud.android.lib.common.network.RedirectionPath
import com.owncloud.android.lib.common.operations.RemoteOperation
import com.owncloud.android.lib.common.operations.RemoteOperationResult
import com.owncloud.android.lib.common.utils.Log_OC
import okhttp3.ConnectionPool
import okhttp3.CookieJar
import okhttp3.OkHttpClient
import okhttp3.Request
Expand Down Expand Up @@ -82,17 +81,14 @@ class NextcloudClient private constructor(
sslContext.init(null, arrayOf<TrustManager>(trustManager), null)
val sslSocketFactory = sslContext.socketFactory

val connectionPool = ConnectionPool()
return OkHttpClient.Builder()
.connectionPool(connectionPool)
.cookieJar(CookieJar.NO_COOKIES)
.connectTimeout(DEFAULT_CONNECTION_TIMEOUT_LONG, TimeUnit.MILLISECONDS)
.readTimeout(DEFAULT_DATA_TIMEOUT_LONG, TimeUnit.MILLISECONDS)
.callTimeout(DEFAULT_CONNECTION_TIMEOUT_LONG + DEFAULT_DATA_TIMEOUT_LONG, TimeUnit.MILLISECONDS)
.sslSocketFactory(sslSocketFactory, trustManager)
.hostnameVerifier { _: String?, _: SSLSession? -> true }
.addNetworkInterceptor(IPv4FallbackInterceptor(connectionPool))
.dns(IPV6PreferringDNS)
.fastFallback(true)
.build()
}
}
Expand Down
6 changes: 1 addition & 5 deletions library/src/main/java/com/nextcloud/common/PlainClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import android.content.Context
import com.owncloud.android.lib.common.OwnCloudClientFactory.DEFAULT_DATA_TIMEOUT_LONG
import com.owncloud.android.lib.common.network.AdvancedX509TrustManager
import com.owncloud.android.lib.common.network.NetworkUtils
import okhttp3.ConnectionPool
import okhttp3.CookieJar
import okhttp3.OkHttpClient
import okhttp3.Request
Expand All @@ -57,15 +56,12 @@ class PlainClient(context: Context) {
sslContext.init(null, arrayOf<TrustManager>(trustManager), null)
val sslSocketFactory = sslContext.socketFactory

val connectionPool = ConnectionPool()
return OkHttpClient.Builder()
.connectionPool(connectionPool)
.cookieJar(CookieJar.NO_COOKIES)
.callTimeout(DEFAULT_DATA_TIMEOUT_LONG, TimeUnit.MILLISECONDS)
.sslSocketFactory(sslSocketFactory, trustManager)
.hostnameVerifier { _: String?, _: SSLSession? -> true }
.addNetworkInterceptor(IPv4FallbackInterceptor(connectionPool))
.dns(IPV6PreferringDNS)
.fastFallback(true)
.build()
}
}
Expand Down

0 comments on commit 4821c17

Please sign in to comment.