pull/2731/head
kunfei 2 years ago
parent 4dea547895
commit dc7486a8b1
  1. 1
      app/src/app/java/io/legado/app/lib/cronet/AbsCallBack.kt
  2. 1
      app/src/app/java/io/legado/app/lib/cronet/BodyUploadProvider.kt
  3. 1
      app/src/app/java/io/legado/app/lib/cronet/CronetCoroutineInterceptor.kt
  4. 1
      app/src/app/java/io/legado/app/lib/cronet/CronetInterceptor.kt
  5. 2
      app/src/app/java/io/legado/app/lib/cronet/NewCallBack.kt

@ -22,7 +22,6 @@ abstract class AbsCallBack(
val mCall: Call,
private val eventListener: EventListener? = null,
private val responseCallback: Callback? = null
) : UrlRequest.Callback(), AutoCloseable {
val buffer = Buffer()

@ -10,6 +10,7 @@ import java.nio.ByteBuffer
@Keep
class BodyUploadProvider(private val body: RequestBody) : UploadDataProvider(), AutoCloseable {
private val buffer = Buffer()
init {

@ -17,6 +17,7 @@ import kotlin.coroutines.resumeWithException
@Keep
@Suppress("unused")
class CronetCoroutineInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
if (chain.call().isCanceled()) {
throw IOException("Canceled")

@ -11,6 +11,7 @@ import java.io.IOException
@Keep
@Suppress("unused")
class CronetInterceptor : Interceptor {
@Throws(IOException::class)
override fun intercept(chain: Interceptor.Chain): Response {
if (chain.call().isCanceled()) {

@ -14,8 +14,8 @@ import java.util.concurrent.TimeUnit
@Keep
@RequiresApi(api = Build.VERSION_CODES.N)
class NewCallBack(originalRequest: Request, mCall: Call) : AbsCallBack(originalRequest, mCall) {
private val responseFuture = CompletableFuture<Response>()
private val responseFuture = CompletableFuture<Response>()
@Throws(IOException::class)
override fun waitForDone(urlRequest: UrlRequest): Response {

Loading…
Cancel
Save