From f712a384cd6d5b25c41f4220875c56550b2f9d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garc=C3=ADa=20de=20Prada?= Date: Mon, 30 May 2022 13:41:41 +0200 Subject: [PATCH] Fix unexpected end of stream when connecting with server --- .../android/lib/common/http/methods/HttpBaseMethod.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/methods/HttpBaseMethod.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/methods/HttpBaseMethod.kt index b58feaea..f446675e 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/methods/HttpBaseMethod.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/methods/HttpBaseMethod.kt @@ -45,7 +45,7 @@ abstract class HttpBaseMethod constructor(url: URL) { var call: Call? = null var followRedirects: Boolean = true - var retryOnConnectionFailure: Boolean = false + var retryOnConnectionFailure: Boolean = true var connectionTimeoutVal: Long? = null var connectionTimeoutUnit: TimeUnit? = null var readTimeoutVal: Long? = null @@ -62,8 +62,8 @@ abstract class HttpBaseMethod constructor(url: URL) { @Throws(Exception::class) open fun execute(httpClient: HttpClient): Int { val okHttpClient = httpClient.okHttpClient.newBuilder().apply { - retryOnConnectionFailure.let { retryOnConnectionFailure(it) } - followRedirects.let { followRedirects(it) } + retryOnConnectionFailure(retryOnConnectionFailure) + followRedirects(followRedirects) readTimeoutUnit?.let { unit -> readTimeoutVal?.let { readTimeout(it, unit) } }