1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Merge pull request #490 from owncloud/fix/eos

Fix unexpected end of stream when connecting with server
This commit is contained in:
Jesús Recio 2022-05-31 11:48:55 +02:00 committed by GitHub
commit 2dc6f30a5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) }
}