Use OkHttp client than CIO

This commit is contained in:
Him188 2020-12-28 15:04:19 +08:00
parent fc72811e2a
commit dfad8572ee
3 changed files with 4 additions and 5 deletions

View File

@ -28,7 +28,7 @@ object Versions {
const val coroutines = "1.4.1"
const val atomicFU = "0.14.4"
const val serialization = "1.0.1"
const val ktor = "1.4.3"
const val ktor = "1.5.0"
const val binaryValidator = "0.2.3"
@ -67,9 +67,9 @@ val `ktor-serialization` = ktor("serialization", Versions.ktor)
val `ktor-client-core` = ktor("client-core", Versions.ktor)
val `ktor-client-cio` = ktor("client-cio", Versions.ktor)
val `ktor-client-okhttp` = ktor("client-okhttp", Versions.ktor)
val `ktor-client-android` = ktor("client-android", Versions.ktor)
val `ktor-network` = ktor("network", Versions.ktor)
val `ktor-client-okhttp` = ktor("client-okhttp", Versions.ktor)
val `ktor-client-serialization-jvm` = ktor("client-serialization-jvm", Versions.ktor)
const val slf4j = "org.slf4j:slf4j-api:" + Versions.slf4j

View File

@ -81,7 +81,7 @@ kotlin {
implementation1(`kotlinx-atomicfu`)
api1(`ktor-client-cio`)
api1(`ktor-client-okhttp`)
api1(`ktor-client-core`)
api1(`ktor-network`)

View File

@ -9,7 +9,7 @@
package net.mamoe.mirai.internal
import io.ktor.client.engine.cio.*
import io.ktor.client.*
import io.ktor.client.request.*
import io.ktor.client.request.forms.*
import kotlinx.coroutines.SupervisorJob
@ -48,7 +48,6 @@ internal open class MiraiImpl : IMirai, LowLevelApiAccessor {
companion object INSTANCE : MiraiImpl() {
@Suppress("ObjectPropertyName", "unused", "DEPRECATION_ERROR")
private val _init = Mirai.let {
CIO // init
Message.Serializer.registerSerializer(OfflineGroupImage::class, OfflineGroupImage.serializer())
Message.Serializer.registerSerializer(OfflineFriendImage::class, OfflineFriendImage.serializer())
Message.Serializer.registerSerializer(MarketFaceImpl::class, MarketFaceImpl.serializer())