Derive all OkHttp clients from one shared base client

The DoH transport keeps its own connection pool and no longer creates
the dispatcher's thread pool only to shut it down.
This commit is contained in:
2026-10-25 12:23:46 +02:00
parent 5f56c471ce
commit 5a1bf79e4b
4 changed files with 23 additions and 9 deletions
@@ -4,7 +4,6 @@ import android.content.Context
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
import okhttp3.OkHttpClient
import okhttp3.Request
import java.io.File
import java.io.IOException
@@ -74,8 +73,7 @@ object ServerList {
@Volatile private var loaded = false
private val client by lazy {
OkHttpClient.Builder()
.connectTimeout(15, TimeUnit.SECONDS)
Http.client.newBuilder()
.readTimeout(30, TimeUnit.SECONDS)
.build()
}