OKHttp: rise maxRequestsPerHost to 64 (instead of default 5)
This commit is contained in:
parent
797dc9ccbb
commit
47bc597b99
|
@ -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 New Issue