This commit is contained in:
@@ -73,7 +73,7 @@ index ae55a0f..9f4338b 100644
|
||||
+ val request = PageLoader.createPageRequest(pageUrl, page.source)
|
||||
+ .newBuilder()
|
||||
+ .header("Range", "bytes=$offset-$requestedEnd")
|
||||
+ .header("Connection", "close")
|
||||
+ .header("Connection", "keep-alive")
|
||||
+ .build()
|
||||
+
|
||||
+ niaddOkHttpClient.newCall(request).execute().use { response ->
|
||||
@@ -161,7 +161,7 @@ index ae55a0f..9f4338b 100644
|
||||
+ companion object {
|
||||
+ private const val NIADD_RANGE_CHUNK_SIZE = 16L * 1024L
|
||||
+ private val NIADD_CONTENT_RANGE_REGEX = Regex("""bytes (\d+)-(\d+)/(\d+)""")
|
||||
+ private val niaddSemaphore = Semaphore(1)
|
||||
+ private val niaddSemaphore = Semaphore(2)
|
||||
+ }
|
||||
+
|
||||
class Factory @Inject constructor(
|
||||
@@ -235,7 +235,7 @@ index 8227b2a..742341e 100644
|
||||
+ val request = PageLoader.createPageRequest(url, source)
|
||||
+ .newBuilder()
|
||||
+ .header("Range", "bytes=$offset-$requestedEnd")
|
||||
+ .header("Connection", "close")
|
||||
+ .header("Connection", "keep-alive")
|
||||
+ .build()
|
||||
+
|
||||
+ niaddOkHttp.newCall(request).execute().use { response ->
|
||||
@@ -328,7 +328,7 @@ index 8227b2a..742341e 100644
|
||||
const val MAX_PAGES_PARALLELISM = 4
|
||||
+ private const val NIADD_RANGE_CHUNK_SIZE = 16L * 1024L
|
||||
+ private val NIADD_CONTENT_RANGE_REGEX = Regex("""bytes (\d+)-(\d+)/(\d+)""")
|
||||
+ private val NIADD_DOWNLOAD_SEMAPHORE = Semaphore(1)
|
||||
+ private val NIADD_DOWNLOAD_SEMAPHORE = Semaphore(2)
|
||||
const val DOWNLOAD_ERROR_DELAY = 2_000L
|
||||
const val MAX_RETRY_DELAY = 7_200_000L // 2 hours
|
||||
const val TAG = "download"
|
||||
@@ -366,7 +366,7 @@ index 18d203d..02b1653 100644
|
||||
|
||||
private val tasks = LongSparseArray<ProgressDeferred<Uri, Float>>()
|
||||
private val semaphore = Semaphore(3)
|
||||
+ private val niaddSemaphore = Semaphore(1)
|
||||
+ private val niaddSemaphore = Semaphore(2)
|
||||
+ private val niaddOkHttp = okHttp.newBuilder()
|
||||
+ .followRedirects(false)
|
||||
+ .followSslRedirects(false)
|
||||
@@ -424,7 +424,7 @@ index 18d203d..02b1653 100644
|
||||
+ val request = createPageRequest(pageUrl, source)
|
||||
+ .newBuilder()
|
||||
+ .header("Range", "bytes=$offset-$requestedEnd")
|
||||
+ .header("Connection", "close")
|
||||
+ .header("Connection", "keep-alive")
|
||||
+ .build()
|
||||
+
|
||||
+ niaddOkHttp.newCall(request).execute().use { response ->
|
||||
|
||||
Reference in New Issue
Block a user