mirror of
https://github.com/kalarina-bit/Sparkledns.git
synced 2026-11-22 07:36:09 +00:00
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:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user