Skip to content

Commit

Permalink
Well that was somehow just a terrible build that got through...
Browse files Browse the repository at this point in the history
  • Loading branch information
Monkopedia committed Dec 5, 2024
1 parent 143d5dd commit b7e7c9d
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 17 deletions.
7 changes: 6 additions & 1 deletion ksrpc-jsonrpc/src/commonMain/kotlin/JsonRpcTransformer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ import com.monkopedia.ksrpc.packets.internal.CONTENT_LENGTH
import com.monkopedia.ksrpc.packets.internal.CONTENT_TYPE
import com.monkopedia.ksrpc.sockets.internal.appendLine
import com.monkopedia.ksrpc.sockets.internal.readFields
import io.ktor.utils.io.*
import io.ktor.utils.io.ByteReadChannel
import io.ktor.utils.io.ByteWriteChannel
import io.ktor.utils.io.close
import io.ktor.utils.io.readFully
import io.ktor.utils.io.readUTF8Line
import io.ktor.utils.io.writeFully
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlinx.serialization.json.Json
Expand Down
13 changes: 11 additions & 2 deletions ksrpc-ktor/server/src/commonMain/kotlin/HttpStream.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@
*/
package com.monkopedia.ksrpc.ktor

import com.monkopedia.ksrpc.*
import com.monkopedia.ksrpc.channels.*
import com.monkopedia.ksrpc.ERROR_PREFIX
import com.monkopedia.ksrpc.KsrpcEnvironment
import com.monkopedia.ksrpc.RpcFailure
import com.monkopedia.ksrpc.RpcService
import com.monkopedia.ksrpc.asString
import com.monkopedia.ksrpc.channels.CallData
import com.monkopedia.ksrpc.channels.ChannelClient
import com.monkopedia.ksrpc.channels.ChannelId
import com.monkopedia.ksrpc.channels.SerializedChannel
import com.monkopedia.ksrpc.channels.SerializedService
import com.monkopedia.ksrpc.internal.HostSerializedChannelImpl
import com.monkopedia.ksrpc.serialized
import io.ktor.http.HttpStatusCode
import io.ktor.http.decodeURLPart
import io.ktor.server.request.receive
Expand Down
2 changes: 1 addition & 1 deletion ksrpc-server/src/commonMain/kotlin/BaseServiceApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import com.monkopedia.ksrpc.ktor.serve
import com.monkopedia.ksrpc.sockets.withStdInOut
import io.ktor.server.application.Application
import io.ktor.server.application.install
import io.ktor.server.engine.*
import io.ktor.server.engine.EmbeddedServer
import io.ktor.server.plugins.cors.routing.CORS
import io.ktor.server.routing.Routing
import io.ktor.server.routing.routing
Expand Down
2 changes: 0 additions & 2 deletions ksrpc-server/src/jvmMain/kotlin/ServiceApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ import com.github.ajalt.clikt.parameters.types.int
import com.monkopedia.ksrpc.ktor.websocket.serveWebsocket
import com.monkopedia.ksrpc.sockets.asConnection
import io.ktor.server.application.Application
import io.ktor.server.engine.BaseApplicationEngine
import io.ktor.server.engine.EmbeddedServer
import io.ktor.server.engine.embeddedServer
import io.ktor.server.netty.Netty
import io.ktor.server.netty.NettyApplicationEngine
import io.ktor.server.routing.Routing
import java.net.ServerSocket
import kotlin.concurrent.thread
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package com.monkopedia.ksrpc.server

import io.ktor.server.application.Application
import io.ktor.server.cio.CIO
import io.ktor.server.engine.BaseApplicationEngine
import io.ktor.server.engine.EmbeddedServer
import io.ktor.server.engine.embeddedServer
import platform.posix.exit

Expand All @@ -39,7 +39,7 @@ actual abstract class ServiceApp actual constructor(appName: String) : BaseServi
actual override fun embeddedServer(
port: Int,
function: Application.() -> Unit
): BaseApplicationEngine {
): EmbeddedServer<*, *> {
return embeddedServer(CIO, port) {
function()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ import com.monkopedia.ksrpc.channels.CallData
import com.monkopedia.ksrpc.packets.internal.CONTENT_LENGTH
import com.monkopedia.ksrpc.packets.internal.Packet
import com.monkopedia.ksrpc.packets.internal.PacketChannelBase
import io.ktor.utils.io.*
import io.ktor.utils.io.ByteReadChannel
import io.ktor.utils.io.ByteWriteChannel
import io.ktor.utils.io.close
import io.ktor.utils.io.readFully
import io.ktor.utils.io.writeFully
import kotlinx.coroutines.CoroutineScope
import kotlinx.serialization.builtins.serializer

Expand Down
15 changes: 13 additions & 2 deletions ksrpc-sockets/src/nativeMain/kotlin/PosixFileReadChannel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,19 @@ package com.monkopedia.ksrpc.sockets
import com.monkopedia.ksrpc.KsrpcEnvironment
import com.monkopedia.ksrpc.channels.Connection
import com.monkopedia.ksrpc.sockets.internal.swallow
import io.ktor.utils.io.*
import kotlinx.cinterop.*
import io.ktor.utils.io.ByteChannel
import io.ktor.utils.io.ByteReadChannel
import io.ktor.utils.io.ByteWriteChannel
import io.ktor.utils.io.close
import io.ktor.utils.io.read
import io.ktor.utils.io.reader
import io.ktor.utils.io.writeFully
import io.ktor.utils.io.writer
import kotlinx.cinterop.ByteVar
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.allocArray
import kotlinx.cinterop.memScoped
import kotlinx.cinterop.toCValues
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.GlobalScope
Expand Down
3 changes: 0 additions & 3 deletions ksrpc-test/src/commonTest/kotlin/JsonRpcTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,13 @@ import io.ktor.utils.io.ByteChannel
import io.ktor.utils.io.close
import io.ktor.utils.io.readFully
import io.ktor.utils.io.readUTF8Line
import kotlin.coroutines.coroutineContext
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
import kotlinx.coroutines.plus
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonPrimitive
Expand Down
12 changes: 11 additions & 1 deletion ksrpc-test/src/jvmTest/kotlin/JniTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@ package com.monkopedia.ksrpc

import ComplexClass
import OtherClass
import com.monkopedia.ksrpc.jni.*
import com.monkopedia.ksrpc.jni.JavaJniContinuation
import com.monkopedia.ksrpc.jni.JniConnection
import com.monkopedia.ksrpc.jni.JniSer
import com.monkopedia.ksrpc.jni.JniSerialization
import com.monkopedia.ksrpc.jni.JniSerialized
import com.monkopedia.ksrpc.jni.NativeUtils
import com.monkopedia.ksrpc.jni.asContinuation
import com.monkopedia.ksrpc.jni.decodeFromJni
import com.monkopedia.ksrpc.jni.encodeToJni
import com.monkopedia.ksrpc.jni.newTypeConverter
import com.monkopedia.ksrpc.jni.withConverter
import io.ktor.utils.io.ByteReadChannel
import io.ktor.utils.io.readRemaining
import io.ktor.utils.io.readText
Expand Down
1 change: 0 additions & 1 deletion ksrpc-test/src/jvmTest/kotlin/TestUtilsJvm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import com.monkopedia.ksrpc.ktor.serve as jvmServe
import com.monkopedia.ksrpc.ktor.websocket.serveWebsocket
import io.ktor.serialization.kotlinx.KotlinxWebsocketSerializationConverter
import io.ktor.server.application.install
import io.ktor.server.engine.ApplicationEngine
import io.ktor.server.engine.EmbeddedServer
import io.ktor.server.engine.embeddedServer
import io.ktor.server.netty.Netty
Expand Down
1 change: 0 additions & 1 deletion ksrpc-test/src/nativeTest/kotlin/NativeTestUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import com.monkopedia.ksrpc.ktor.serve as nativeServe
import com.monkopedia.ksrpc.sockets.posixFileReadChannel
import com.monkopedia.ksrpc.sockets.posixFileWriteChannel
import io.ktor.server.cio.CIO
import io.ktor.server.engine.ApplicationEngine
import io.ktor.server.engine.EmbeddedServer
import io.ktor.server.engine.embeddedServer
import io.ktor.server.routing.routing
Expand Down

0 comments on commit b7e7c9d

Please sign in to comment.