From ed67b75cdb582e524fd6a2189b9e738a1f525c4b Mon Sep 17 00:00:00 2001 From: Oleg Yukhnevich Date: Fri, 6 Dec 2024 07:11:38 +0200 Subject: [PATCH] Update ktor to 3.0.2 (#285) --- gradle/libs.versions.toml | 2 +- .../io/rsocket/kotlin/transport/ktor/tcp/KtorTcpConnection.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6dbaa5d6..32d551fc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,7 +7,7 @@ kotlinx-coroutines = "1.9.0" kotlinx-benchmark = "0.4.8" kotlinx-bcv = "0.16.3" -ktor = "3.0.1" +ktor = "3.0.2" netty = "4.1.115.Final" netty-quic = "0.0.69.Final" diff --git a/rsocket-transports/ktor-tcp/src/commonMain/kotlin/io/rsocket/kotlin/transport/ktor/tcp/KtorTcpConnection.kt b/rsocket-transports/ktor-tcp/src/commonMain/kotlin/io/rsocket/kotlin/transport/ktor/tcp/KtorTcpConnection.kt index 3ad8ac7d..a07d44e3 100644 --- a/rsocket-transports/ktor-tcp/src/commonMain/kotlin/io/rsocket/kotlin/transport/ktor/tcp/KtorTcpConnection.kt +++ b/rsocket-transports/ktor-tcp/src/commonMain/kotlin/io/rsocket/kotlin/transport/ktor/tcp/KtorTcpConnection.kt @@ -91,13 +91,13 @@ private class KtorTcpConnection( } } -@OptIn(InternalAPI::class) // TODO? +@OptIn(InternalAPI::class) private fun ByteWriteChannel.writeFrame(frame: Buffer) { writeBuffer.writeInt24(frame.size.toInt()) writeBuffer.transferFrom(frame) } -@OptIn(InternalAPI::class) // TODO? +@OptIn(InternalAPI::class) private suspend fun ByteReadChannel.readFrame(): Buffer? { while (availableForRead < 3 && awaitContent(3)) yield() if (availableForRead == 0) return null