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:
commit
2dc6f30a5e
@ -45,7 +45,7 @@ abstract class HttpBaseMethod constructor(url: URL) {
|
|||||||
var call: Call? = null
|
var call: Call? = null
|
||||||
|
|
||||||
var followRedirects: Boolean = true
|
var followRedirects: Boolean = true
|
||||||
var retryOnConnectionFailure: Boolean = false
|
var retryOnConnectionFailure: Boolean = true
|
||||||
var connectionTimeoutVal: Long? = null
|
var connectionTimeoutVal: Long? = null
|
||||||
var connectionTimeoutUnit: TimeUnit? = null
|
var connectionTimeoutUnit: TimeUnit? = null
|
||||||
var readTimeoutVal: Long? = null
|
var readTimeoutVal: Long? = null
|
||||||
@ -62,8 +62,8 @@ abstract class HttpBaseMethod constructor(url: URL) {
|
|||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
open fun execute(httpClient: HttpClient): Int {
|
open fun execute(httpClient: HttpClient): Int {
|
||||||
val okHttpClient = httpClient.okHttpClient.newBuilder().apply {
|
val okHttpClient = httpClient.okHttpClient.newBuilder().apply {
|
||||||
retryOnConnectionFailure.let { retryOnConnectionFailure(it) }
|
retryOnConnectionFailure(retryOnConnectionFailure)
|
||||||
followRedirects.let { followRedirects(it) }
|
followRedirects(followRedirects)
|
||||||
readTimeoutUnit?.let { unit ->
|
readTimeoutUnit?.let { unit ->
|
||||||
readTimeoutVal?.let { readTimeout(it, unit) }
|
readTimeoutVal?.let { readTimeout(it, unit) }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user