mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-25 10:28:33 +03:00
OKHttp: rise maxRequestsPerHost to 64 (instead of default 5)
This commit is contained in:
parent
797dc9ccbb
commit
47bc597b99
1 changed files with 5 additions and 1 deletions
|
@ -21,6 +21,7 @@ import com.squareup.moshi.Moshi
|
|||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import okhttp3.ConnectionSpec
|
||||
import okhttp3.Dispatcher
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Protocol
|
||||
import okhttp3.logging.HttpLoggingInterceptor
|
||||
|
@ -70,7 +71,9 @@ internal object NetworkModule {
|
|||
curlLoggingInterceptor: CurlLoggingInterceptor,
|
||||
apiInterceptor: ApiInterceptor): OkHttpClient {
|
||||
val spec = ConnectionSpec.Builder(matrixConfiguration.connectionSpec).build()
|
||||
|
||||
val dispatcher = Dispatcher().apply {
|
||||
maxRequestsPerHost = 64
|
||||
}
|
||||
return OkHttpClient.Builder()
|
||||
// workaround for #4669
|
||||
.protocols(listOf(Protocol.HTTP_1_1))
|
||||
|
@ -94,6 +97,7 @@ internal object NetworkModule {
|
|||
proxy(it)
|
||||
}
|
||||
}
|
||||
.dispatcher(dispatcher)
|
||||
.connectionSpecs(Collections.singletonList(spec))
|
||||
.build()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue