From 7e4e8339e6ac231fbb16cfad01cfd4ec2b44a20f Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Thu, 13 Jan 2022 10:56:19 -0600 Subject: [PATCH] Force HTTP/1.1 Signed-off-by: Alex Baker --- changelog.d/4669.bugfix | 1 + .../java/org/matrix/android/sdk/internal/di/NetworkModule.kt | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 changelog.d/4669.bugfix diff --git a/changelog.d/4669.bugfix b/changelog.d/4669.bugfix new file mode 100644 index 0000000000..8e38becdd9 --- /dev/null +++ b/changelog.d/4669.bugfix @@ -0,0 +1 @@ +Fix sync timeout after returning from background diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/di/NetworkModule.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/di/NetworkModule.kt index ad34a4d8a6..44b00c0ace 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/di/NetworkModule.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/di/NetworkModule.kt @@ -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)