From a98bd06085e6917df73ab643bd4a56196d8f8e11 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Sun, 30 Oct 2022 16:11:14 -0400 Subject: [PATCH] Fix breakage from ksrpcuri removal --- .../client/src/commonMain/kotlin/HttpSerializedChannel.kt | 5 +++-- ksrpc-ktor/server/src/commonMain/kotlin/HttpStream.kt | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ksrpc-ktor/client/src/commonMain/kotlin/HttpSerializedChannel.kt b/ksrpc-ktor/client/src/commonMain/kotlin/HttpSerializedChannel.kt index ebdcd624..0ec585da 100644 --- a/ksrpc-ktor/client/src/commonMain/kotlin/HttpSerializedChannel.kt +++ b/ksrpc-ktor/client/src/commonMain/kotlin/HttpSerializedChannel.kt @@ -16,8 +16,6 @@ package com.monkopedia.ksrpc.ktor.internal import com.monkopedia.ksrpc.ERROR_PREFIX -import com.monkopedia.ksrpc.KSRPC_BINARY -import com.monkopedia.ksrpc.KSRPC_CHANNEL import com.monkopedia.ksrpc.KsrpcEnvironment import com.monkopedia.ksrpc.RpcEndpointException import com.monkopedia.ksrpc.RpcFailure @@ -41,6 +39,9 @@ import io.ktor.utils.io.ByteReadChannel import kotlin.coroutines.CoroutineContext import kotlinx.serialization.json.Json +private const val KSRPC_BINARY = "binary" +private const val KSRPC_CHANNEL = "channel" + internal class HttpSerializedChannel( private val httpClient: HttpClient, private val baseStripped: String, diff --git a/ksrpc-ktor/server/src/commonMain/kotlin/HttpStream.kt b/ksrpc-ktor/server/src/commonMain/kotlin/HttpStream.kt index ba8a0f72..d84aa610 100644 --- a/ksrpc-ktor/server/src/commonMain/kotlin/HttpStream.kt +++ b/ksrpc-ktor/server/src/commonMain/kotlin/HttpStream.kt @@ -16,8 +16,6 @@ package com.monkopedia.ksrpc.ktor import com.monkopedia.ksrpc.ERROR_PREFIX -import com.monkopedia.ksrpc.KSRPC_BINARY -import com.monkopedia.ksrpc.KSRPC_CHANNEL import com.monkopedia.ksrpc.KsrpcEnvironment import com.monkopedia.ksrpc.RpcFailure import com.monkopedia.ksrpc.RpcService @@ -44,6 +42,9 @@ import io.ktor.utils.io.copyTo import kotlinx.coroutines.launch import kotlinx.serialization.json.Json +private const val KSRPC_BINARY = "binary" +private const val KSRPC_CHANNEL = "channel" + inline fun Routing.serve( basePath: String, service: T,