mirror of
https://github.com/jlengrand/ktor.git
synced 2026-03-10 08:31:20 +00:00
Migrate to built-in IO
This commit is contained in:
@@ -110,7 +110,7 @@ allprojects {
|
||||
check(version, atomicfu_version, "atomicfu")
|
||||
check(version, coroutines_version, "coroutines")
|
||||
check(version, serialization_version, "serialization")
|
||||
check(version, kotlinx_io_version, "kotlinx-io")
|
||||
// check(version, kotlinx_io_version, "kotlinx-io")
|
||||
}
|
||||
kotlin_version = rootProject.properties['kotlin_snapshot_version']
|
||||
repositories {
|
||||
|
||||
@@ -3,7 +3,7 @@ kotlin.sourceSets {
|
||||
api 'org.jetbrains.kotlin:kotlin-stdlib-common'
|
||||
api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-common', version: kotlin_version
|
||||
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core-common', version: coroutines_version
|
||||
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-io', version: kotlinx_io_version
|
||||
// api group: 'org.jetbrains.kotlinx', name: 'kotlinx-io', version: kotlinx_io_version
|
||||
api group: 'org.jetbrains.kotlinx', name: 'atomicfu', version: atomicfu_version
|
||||
|
||||
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-io', version: kotlinx_io_version
|
||||
|
||||
@@ -17,7 +17,7 @@ kotlin {
|
||||
sourceSets {
|
||||
darwinMain.dependencies {
|
||||
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core-native', version: coroutines_version
|
||||
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-io-native', version: kotlinx_io_version
|
||||
// implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-io-native', version: kotlinx_io_version
|
||||
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-io-native', version: kotlinx_io_version
|
||||
|
||||
implementation "org.jetbrains.kotlinx:atomicfu:$atomicfu_version"
|
||||
|
||||
@@ -44,7 +44,7 @@ kotlin {
|
||||
api "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
|
||||
|
||||
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core-js', version: coroutines_version
|
||||
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-io-js', version: kotlinx_io_version
|
||||
// api group: 'org.jetbrains.kotlinx', name: 'kotlinx-io-js', version: kotlinx_io_version
|
||||
api group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-io-js', version: kotlinx_io_version
|
||||
api group: 'org.jetbrains.kotlinx', name: 'atomicfu-js', version: atomicfu_version
|
||||
|
||||
|
||||
@@ -85,9 +85,9 @@ dependencies {
|
||||
exclude(module: 'kotlin-stdlib-jvm')
|
||||
}
|
||||
|
||||
jvmMainApi(group: 'org.jetbrains.kotlinx', name: 'kotlinx-io-jvm', version: kotlinx_io_version) {
|
||||
exclude(module: 'kotlin-stdlib-jvm')
|
||||
}
|
||||
// jvmMainApi(group: 'org.jetbrains.kotlinx', name: 'kotlinx-io-jvm', version: kotlinx_io_version) {
|
||||
// exclude(module: 'kotlin-stdlib-jvm')
|
||||
// }
|
||||
|
||||
jvmMainApi(group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-io-jvm', version: kotlinx_io_version) {
|
||||
exclude(module: 'kotlin-stdlib-jvm')
|
||||
|
||||
@@ -81,7 +81,7 @@ kotlin {
|
||||
sourceSets {
|
||||
posixMain.dependencies {
|
||||
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core-native', version: coroutines_version
|
||||
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-io-native', version: kotlinx_io_version
|
||||
// implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-io-native', version: kotlinx_io_version
|
||||
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-io-native', version: kotlinx_io_version
|
||||
|
||||
implementation "org.jetbrains.kotlinx:atomicfu:$atomicfu_version"
|
||||
|
||||
@@ -12,8 +12,8 @@ import io.ktor.http.content.*
|
||||
import io.ktor.util.cio.*
|
||||
import io.ktor.util.date.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.coroutines.io.jvm.javaio.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.jvm.javaio.*
|
||||
import java.io.*
|
||||
import java.net.*
|
||||
import javax.net.ssl.*
|
||||
|
||||
@@ -13,7 +13,7 @@ import io.ktor.http.content.*
|
||||
import kotlinx.atomicfu.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.channels.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import org.apache.http.*
|
||||
import org.apache.http.HttpHeaders
|
||||
import org.apache.http.HttpRequest
|
||||
|
||||
@@ -6,7 +6,7 @@ package io.ktor.client.engine.apache
|
||||
|
||||
import kotlinx.atomicfu.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import org.apache.http.*
|
||||
import org.apache.http.nio.*
|
||||
import org.apache.http.nio.protocol.*
|
||||
|
||||
@@ -15,10 +15,10 @@ import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.channels.*
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.coroutines.sync.*
|
||||
import kotlinx.io.core.*
|
||||
import kotlinx.io.pool.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.sync.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import io.ktor.utils.io.pool.*
|
||||
import java.nio.channels.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ import io.ktor.http.cio.websocket.*
|
||||
import io.ktor.http.content.*
|
||||
import io.ktor.util.date.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.errors.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.errors.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
internal suspend fun HttpRequestData.write(
|
||||
|
||||
@@ -12,7 +12,7 @@ import io.ktor.client.response.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.atomicfu.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +10,8 @@ import io.ktor.client.response.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.atomicfu.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.reflect.*
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ import io.ktor.http.*
|
||||
import io.ktor.util.*
|
||||
import io.ktor.util.date.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
|
||||
|
||||
@Suppress("KDocMissingDocumentation")
|
||||
|
||||
@@ -10,7 +10,7 @@ import io.ktor.client.request.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
/**
|
||||
* Base interface use to define engines for [HttpClient].
|
||||
|
||||
@@ -8,7 +8,7 @@ import io.ktor.client.*
|
||||
import io.ktor.client.call.*
|
||||
import io.ktor.client.response.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlin.jvm.*
|
||||
|
||||
private val ValidateMark = AttributeKey<Unit>("ValidateMark")
|
||||
|
||||
@@ -9,8 +9,8 @@ import io.ktor.client.request.*
|
||||
import io.ktor.client.response.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
/**
|
||||
* Install default transformers.
|
||||
|
||||
@@ -11,9 +11,9 @@ import io.ktor.client.response.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.charsets.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlin.math.*
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,7 +14,7 @@ import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import io.ktor.util.*
|
||||
import io.ktor.util.pipeline.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
internal object CacheControl {
|
||||
internal val NO_STORE = HeaderValue("no-store")
|
||||
|
||||
@@ -9,8 +9,8 @@ import io.ktor.client.response.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.util.*
|
||||
import io.ktor.util.date.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
internal suspend fun HttpCacheEntry(response: HttpResponse): HttpCacheEntry = response.use {
|
||||
val body = it.content.readRemaining().readBytes()
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
package io.ktor.client.features.cookies
|
||||
|
||||
import io.ktor.http.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
/**
|
||||
* Storage for [Cookie].
|
||||
|
||||
@@ -10,7 +10,7 @@ import io.ktor.client.request.*
|
||||
import io.ktor.client.response.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
/**
|
||||
* [HttpClient] feature that handles sent `Cookie`, and received `Set-Cookie` headers,
|
||||
|
||||
@@ -12,7 +12,7 @@ import io.ktor.http.*
|
||||
import io.ktor.util.*
|
||||
import io.ktor.util.date.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ package io.ktor.client.request
|
||||
import io.ktor.http.content.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
|
||||
@Suppress("KDocMissingDocumentation")
|
||||
@InternalAPI
|
||||
|
||||
@@ -6,9 +6,9 @@ package io.ktor.client.request.forms
|
||||
|
||||
import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.charsets.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlin.random.*
|
||||
|
||||
private val RN_BYTES = "\r\n".toByteArray()
|
||||
|
||||
@@ -7,7 +7,7 @@ package io.ktor.client.request.forms
|
||||
import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlin.contracts.*
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,7 @@ import io.ktor.client.request.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.util.*
|
||||
import io.ktor.util.date.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,9 +11,9 @@ import io.ktor.http.*
|
||||
import io.ktor.util.date.*
|
||||
import kotlinx.atomicfu.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.charsets.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
/**
|
||||
* A response for [HttpClient], second part of [HttpClientCall].
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
package io.ktor.client.response
|
||||
|
||||
import kotlinx.io.charsets.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
|
||||
open class HttpResponseConfig {
|
||||
/**
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
package io.ktor.client.response
|
||||
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
/**
|
||||
* Exactly reads [count] bytes of the [HttpResponse.content].
|
||||
|
||||
@@ -7,7 +7,7 @@ package io.ktor.client.utils
|
||||
import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,8 +8,8 @@ import io.ktor.client.engine.*
|
||||
import io.ktor.client.request.*
|
||||
import io.ktor.http.content.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.fetch.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
@@ -8,7 +8,7 @@ import io.ktor.client.engine.js.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.channels.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.fetch.*
|
||||
import kotlin.browser.*
|
||||
|
||||
@@ -8,7 +8,7 @@ import io.ktor.http.cio.websocket.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.channels.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.dom.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
@@ -7,8 +7,8 @@ package io.ktor.client.features
|
||||
import io.ktor.client.*
|
||||
import io.ktor.client.response.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.coroutines.io.jvm.javaio.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.jvm.javaio.*
|
||||
import java.io.*
|
||||
|
||||
internal actual fun HttpClient.platformDefaultTransformers() {
|
||||
|
||||
@@ -6,7 +6,7 @@ package io.ktor.client.utils
|
||||
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.io.pool.*
|
||||
import io.ktor.utils.io.pool.*
|
||||
import java.nio.*
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@ import io.ktor.http.*
|
||||
import io.ktor.http.cio.*
|
||||
import io.ktor.util.date.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
internal class CurlClientEngine(override val config: CurlClientEngineConfig) : HttpClientEngine {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
package io.ktor.client.engine.curl.internal
|
||||
|
||||
import kotlinx.cinterop.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import platform.posix.*
|
||||
|
||||
internal fun onHeadersReceived(
|
||||
|
||||
@@ -6,7 +6,7 @@ package io.ktor.client.engine.curl.internal
|
||||
|
||||
import io.ktor.client.engine.curl.*
|
||||
import kotlinx.cinterop.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import libcurl.*
|
||||
|
||||
private class RequestHolders(
|
||||
|
||||
@@ -11,8 +11,8 @@ import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import kotlinx.cinterop.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import libcurl.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import io.ktor.client.request.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.http.auth.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.io.charsets.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
/**
|
||||
* Add [BasicAuthProvider] to client [Auth] providers.
|
||||
|
||||
@@ -10,8 +10,8 @@ import io.ktor.http.*
|
||||
import io.ktor.http.auth.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.atomicfu.*
|
||||
import kotlinx.io.charsets.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
/**
|
||||
* Install client [DigestAuthProvider].
|
||||
|
||||
@@ -11,7 +11,7 @@ import io.ktor.client.response.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
|
||||
/**
|
||||
* Content-Encoding header support.
|
||||
|
||||
@@ -11,7 +11,7 @@ import io.ktor.client.response.*
|
||||
import io.ktor.client.utils.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ package io.ktor.client.features.json
|
||||
import io.ktor.client.call.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
/**
|
||||
* Client json serializer.
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.google.gson.*
|
||||
import io.ktor.client.call.*
|
||||
import io.ktor.http.content.*
|
||||
import io.ktor.http.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
/**
|
||||
* [JsonSerializer] using [Gson] as backend.
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.fasterxml.jackson.module.kotlin.*
|
||||
import io.ktor.client.call.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
class JacksonSerializer(block: ObjectMapper.() -> Unit = {}) : JsonSerializer {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import io.ktor.client.call.*
|
||||
import io.ktor.client.features.json.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.internal.*
|
||||
import kotlinx.serialization.json.*
|
||||
|
||||
@@ -14,9 +14,9 @@ import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.charsets.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
/**
|
||||
* [HttpClient] logging feature.
|
||||
|
||||
@@ -7,7 +7,7 @@ package io.ktor.client.features.logging
|
||||
import io.ktor.client.request.*
|
||||
import io.ktor.client.response.*
|
||||
import io.ktor.client.tests.utils.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlin.test.*
|
||||
|
||||
class RemoteTests : ClientLoader() {
|
||||
|
||||
@@ -7,7 +7,7 @@ package io.ktor.client.features.logging
|
||||
import io.ktor.client.engine.mock.*
|
||||
import io.ktor.client.request.forms.*
|
||||
import io.ktor.client.tests.utils.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlin.test.*
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import io.ktor.client.response.*
|
||||
import io.ktor.client.tests.utils.*
|
||||
import io.ktor.http.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import kotlin.test.*
|
||||
|
||||
class NetworkLoggingTest : ClientLoader() {
|
||||
|
||||
@@ -8,7 +8,7 @@ import io.ktor.client.features.websocket.*
|
||||
import io.ktor.client.tests.utils.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.http.cio.websocket.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlin.test.*
|
||||
|
||||
class WebSocketRemoteTest : ClientLoader() {
|
||||
|
||||
@@ -13,8 +13,8 @@ import io.ktor.http.content.*
|
||||
import io.ktor.util.date.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.channels.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import platform.CFNetwork.*
|
||||
import platform.Foundation.*
|
||||
import platform.darwin.*
|
||||
|
||||
@@ -13,8 +13,8 @@ import io.ktor.http.content.*
|
||||
import io.ktor.util.cio.*
|
||||
import io.ktor.util.date.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.pool.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.pool.*
|
||||
import org.eclipse.jetty.http.*
|
||||
import org.eclipse.jetty.http2.api.*
|
||||
import org.eclipse.jetty.http2.client.*
|
||||
|
||||
@@ -8,7 +8,7 @@ import io.ktor.http.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.channels.*
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import org.eclipse.jetty.http.*
|
||||
import org.eclipse.jetty.http2.*
|
||||
import org.eclipse.jetty.http2.api.*
|
||||
|
||||
@@ -10,9 +10,9 @@ import io.ktor.http.content.*
|
||||
import io.ktor.util.*
|
||||
import io.ktor.util.date.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.charsets.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
@Suppress("KDocMissingDocumentation")
|
||||
|
||||
@@ -12,7 +12,7 @@ import io.ktor.http.content.*
|
||||
import io.ktor.util.*
|
||||
import io.ktor.util.date.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import kotlinx.io.core.*
|
||||
import okhttp3.*
|
||||
import okhttp3.internal.http.HttpMethod
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
package io.ktor.client.engine.okhttp
|
||||
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.coroutines.io.jvm.javaio.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.jvm.javaio.*
|
||||
import okhttp3.*
|
||||
import okio.*
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import io.ktor.client.engine.*
|
||||
import io.ktor.client.tests.utils.dispatcher.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
/**
|
||||
* Local test server url.
|
||||
|
||||
@@ -7,8 +7,8 @@ package io.ktor.client.tests.utils
|
||||
import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.io.charsets.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
|
||||
@InternalAPI
|
||||
|
||||
@@ -11,7 +11,7 @@ import io.ktor.client.tests.utils.*
|
||||
import io.ktor.client.utils.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import kotlinx.io.charsets.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
import kotlin.test.*
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import io.ktor.client.call.*
|
||||
import io.ktor.client.response.*
|
||||
import io.ktor.client.tests.utils.*
|
||||
import io.ktor.http.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlin.test.*
|
||||
|
||||
class ConnectionTest : ClientLoader() {
|
||||
|
||||
@@ -16,9 +16,9 @@ import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.io.core.*
|
||||
import kotlinx.io.core.toByteArray
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import io.ktor.utils.io.core.toByteArray
|
||||
import kotlin.test.*
|
||||
|
||||
class ContentTest : ClientLoader() {
|
||||
|
||||
@@ -6,7 +6,7 @@ package io.ktor.client.tests
|
||||
|
||||
import io.ktor.client.request.*
|
||||
import io.ktor.client.tests.utils.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import kotlin.test.*
|
||||
|
||||
class DownloadTest : ClientLoader() {
|
||||
|
||||
@@ -11,7 +11,7 @@ import io.ktor.client.tests.utils.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlin.test.*
|
||||
|
||||
class FullFormTest : ClientLoader() {
|
||||
|
||||
@@ -10,7 +10,7 @@ import io.ktor.client.features.json.serializer.*
|
||||
import io.ktor.client.request.*
|
||||
import io.ktor.client.response.*
|
||||
import io.ktor.client.tests.utils.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.json.*
|
||||
import kotlin.test.*
|
||||
|
||||
@@ -10,7 +10,7 @@ import io.ktor.client.request.*
|
||||
import io.ktor.client.response.*
|
||||
import io.ktor.client.tests.utils.*
|
||||
import io.ktor.http.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlin.test.*
|
||||
|
||||
class HttpRedirectTest : ClientLoader() {
|
||||
|
||||
@@ -9,7 +9,7 @@ import io.ktor.client.request.*
|
||||
import io.ktor.client.tests.utils.*
|
||||
import io.ktor.http.content.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import kotlin.test.*
|
||||
|
||||
class PostTest : ClientLoader() {
|
||||
|
||||
@@ -12,7 +12,7 @@ import io.ktor.request.*
|
||||
import io.ktor.response.*
|
||||
import io.ktor.routing.*
|
||||
import io.ktor.websocket.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
|
||||
internal fun Application.benchmarks() {
|
||||
routing {
|
||||
|
||||
@@ -12,7 +12,8 @@ import io.ktor.request.*
|
||||
import io.ktor.response.*
|
||||
import io.ktor.routing.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlin.test.*
|
||||
|
||||
internal fun Application.contentTestServer() {
|
||||
|
||||
@@ -11,7 +11,7 @@ import io.ktor.http.content.*
|
||||
import io.ktor.response.*
|
||||
import io.ktor.util.*
|
||||
import io.ktor.util.cio.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
|
||||
/**
|
||||
* Represents a content handled by [FreeMarker] feature.
|
||||
|
||||
@@ -12,8 +12,8 @@ import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import io.ktor.util.pipeline.*
|
||||
import io.ktor.request.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.coroutines.io.jvm.javaio.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.jvm.javaio.*
|
||||
import kotlin.reflect.*
|
||||
import kotlin.reflect.jvm.*
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import io.ktor.http.*
|
||||
import io.ktor.http.content.*
|
||||
import io.ktor.response.*
|
||||
import io.ktor.util.cio.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import kotlinx.html.*
|
||||
import kotlinx.html.stream.*
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ import io.ktor.features.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.util.pipeline.*
|
||||
import io.ktor.request.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.coroutines.io.jvm.javaio.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.jvm.javaio.*
|
||||
|
||||
/**
|
||||
* install(ContentNegotiation) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import io.ktor.http.content.*
|
||||
import io.ktor.response.*
|
||||
import io.ktor.util.*
|
||||
import io.ktor.util.cio.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
|
||||
/**
|
||||
* Response content which could be used to respond [ApplicationCalls] like `call.respond(MustacheContent(...))
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
package io.ktor.sessions
|
||||
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.coroutines.io.jvm.javaio.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.jvm.javaio.*
|
||||
|
||||
@Suppress("KDocMissingDocumentation")
|
||||
@InternalAPI
|
||||
|
||||
@@ -7,7 +7,7 @@ package io.ktor.sessions
|
||||
import io.ktor.util.*
|
||||
import io.ktor.util.cio.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import java.io.*
|
||||
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ package io.ktor.tests.sessions
|
||||
|
||||
import io.ktor.sessions.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.coroutines.io.jvm.javaio.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.jvm.javaio.*
|
||||
import org.junit.*
|
||||
import org.junit.Test
|
||||
import java.io.*
|
||||
|
||||
@@ -15,7 +15,7 @@ import io.ktor.http.withCharset
|
||||
import io.ktor.response.ApplicationSendPipeline
|
||||
import io.ktor.util.AttributeKey
|
||||
import io.ktor.util.cio.bufferedWriter
|
||||
import kotlinx.coroutines.io.ByteWriteChannel
|
||||
import io.ktor.utils.io.ByteWriteChannel
|
||||
import org.thymeleaf.TemplateEngine
|
||||
import org.thymeleaf.context.Context
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import io.ktor.http.content.*
|
||||
import io.ktor.response.*
|
||||
import io.ktor.util.*
|
||||
import io.ktor.util.cio.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import org.apache.velocity.*
|
||||
import org.apache.velocity.app.*
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ import io.ktor.response.*
|
||||
import io.ktor.util.*
|
||||
import io.ktor.util.cio.*
|
||||
import io.ktor.util.pipeline.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.coroutines.io.jvm.javaio.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.jvm.javaio.*
|
||||
import org.webjars.*
|
||||
import java.io.*
|
||||
import java.nio.file.*
|
||||
|
||||
@@ -8,7 +8,7 @@ import io.ktor.util.cio.*
|
||||
import io.ktor.websocket.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.channels.*
|
||||
import kotlinx.io.pool.*
|
||||
import io.ktor.utils.io.pool.*
|
||||
import java.nio.*
|
||||
import java.time.*
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import io.ktor.http.cio.websocket.*
|
||||
import io.ktor.http.websocket.*
|
||||
import io.ktor.request.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,7 +15,7 @@ import io.ktor.websocket.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.channels.*
|
||||
import kotlinx.coroutines.debug.junit4.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import org.junit.*
|
||||
import org.junit.Test
|
||||
import java.nio.*
|
||||
|
||||
@@ -7,7 +7,7 @@ package io.ktor.tests.websocket
|
||||
import io.ktor.util.cio.*
|
||||
import io.ktor.http.cio.websocket.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import org.junit.Test
|
||||
import java.nio.ByteBuffer
|
||||
import kotlin.test.*
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
package io.ktor.http
|
||||
|
||||
import io.ktor.util.*
|
||||
import kotlinx.io.charsets.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
private val URL_ALPHABET = (('a'..'z') + ('A'..'Z') + ('0'..'9')).map { it.toByte() }
|
||||
private val URL_ALPHABET_CHARS = (('a'..'z') + ('A'..'Z') + ('0'..'9'))
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
package io.ktor.http
|
||||
|
||||
import kotlinx.io.charsets.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
|
||||
/**
|
||||
* Represents a value for a `Content-Type` header.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
package io.ktor.http
|
||||
|
||||
import io.ktor.util.*
|
||||
import kotlinx.io.charsets.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
|
||||
/**
|
||||
* Default [ContentType] for [extension]
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
package io.ktor.http
|
||||
|
||||
import kotlinx.io.charsets.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
|
||||
/**
|
||||
* Set `Content-Type` header.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
package io.ktor.http
|
||||
|
||||
import io.ktor.util.*
|
||||
import kotlinx.io.charsets.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
|
||||
/**
|
||||
* Parse URL query parameters. Shouldn't be used for urlencoded forms because of `+` character.
|
||||
|
||||
@@ -6,7 +6,7 @@ package io.ktor.http.auth
|
||||
|
||||
import io.ktor.http.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.io.charsets.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
|
||||
private const val valuePatternPart = """("((\\.)|[^\\"])*")|[^\s,]*"""
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
package io.ktor.http.content
|
||||
|
||||
import io.ktor.http.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
/**
|
||||
* Represents a multipart/form-data entry. Could be a [FormItem] or [FileItem]
|
||||
|
||||
@@ -7,7 +7,7 @@ package io.ktor.http.content
|
||||
import io.ktor.http.*
|
||||
import io.ktor.util.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
package io.ktor.http.content
|
||||
|
||||
import io.ktor.http.*
|
||||
import kotlinx.io.charsets.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
/**
|
||||
* Represents a text content that could be sent
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
package io.ktor.http.websocket
|
||||
|
||||
import io.ktor.util.*
|
||||
import kotlinx.io.charsets.*
|
||||
import kotlinx.io.core.*
|
||||
import io.ktor.utils.io.charsets.*
|
||||
import io.ktor.utils.io.core.*
|
||||
|
||||
|
||||
private const val WEBSOCKET_SERVER_ACCEPT_TAIL = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
package io.ktor.http.content
|
||||
|
||||
import io.ktor.http.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import kotlinx.coroutines.io.jvm.javaio.*
|
||||
import io.ktor.utils.io.*
|
||||
import io.ktor.utils.io.jvm.javaio.*
|
||||
import java.io.*
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ package io.ktor.http.content
|
||||
import io.ktor.http.*
|
||||
import io.ktor.util.*
|
||||
import io.ktor.util.cio.*
|
||||
import kotlinx.coroutines.io.jvm.javaio.*
|
||||
import io.ktor.utils.io.jvm.javaio.*
|
||||
import java.net.*
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,7 @@ package io.ktor.http.content
|
||||
|
||||
import io.ktor.http.*
|
||||
import io.ktor.util.cio.*
|
||||
import kotlinx.coroutines.io.*
|
||||
import io.ktor.utils.io.*
|
||||
import java.io.*
|
||||
|
||||
/**
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user