Merge pull request #4952 from abaker/disable_http_2

Force HTTP/1.1
This commit is contained in:
Benoit Marty 2022-01-17 15:20:23 +01:00 committed by GitHub
commit 95b116b8a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

1
changelog.d/4669.bugfix Normal file
View file

@ -0,0 +1 @@
Fix sync timeout after returning from background

View file

@ -22,6 +22,7 @@ import dagger.Module
import dagger.Provides
import okhttp3.ConnectionSpec
import okhttp3.OkHttpClient
import okhttp3.Protocol
import okhttp3.logging.HttpLoggingInterceptor
import org.matrix.android.sdk.BuildConfig
import org.matrix.android.sdk.api.MatrixConfiguration
@ -71,6 +72,7 @@ internal object NetworkModule {
val spec = ConnectionSpec.Builder(matrixConfiguration.connectionSpec).build()
return OkHttpClient.Builder()
.protocols(listOf(Protocol.HTTP_1_1))
.connectTimeout(30, TimeUnit.SECONDS)
.readTimeout(60, TimeUnit.SECONDS)
.writeTimeout(60, TimeUnit.SECONDS)