From f69ce1ec9cac6fa0f7594d0ef440bee8252b66c0 Mon Sep 17 00:00:00 2001 From: Anton Malinskiy Date: Mon, 6 May 2024 02:37:26 +1000 Subject: [PATCH] fix(adam): prevent uncloseable readFully --- .../kotlin/com/malinskiy/adam/transport/vertx/VertxSocket.kt | 1 + buildSrc/src/main/kotlin/Versions.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/adam/src/main/kotlin/com/malinskiy/adam/transport/vertx/VertxSocket.kt b/adam/src/main/kotlin/com/malinskiy/adam/transport/vertx/VertxSocket.kt index f44468539..f5a0909e9 100644 --- a/adam/src/main/kotlin/com/malinskiy/adam/transport/vertx/VertxSocket.kt +++ b/adam/src/main/kotlin/com/malinskiy/adam/transport/vertx/VertxSocket.kt @@ -130,6 +130,7 @@ class VertxSocket(private val socketAddress: SocketAddress, private val options: val read = readAvailable(buffer.array(), offset + total, limit - total) if (read == -1) { assert(!buffer.hasRemaining()) { "Expected $limit bytes, received $total" } + break } else { total += read } diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 7248b61fc..e47774f25 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -1,5 +1,5 @@ object Versions { - val adam = System.getenv("GIT_TAG_NAME") ?: "0.5.5" + val adam = System.getenv("GIT_TAG_NAME") ?: "0.5.7" val kotlin = "1.9.10" val coroutines = "1.7.3" val coroutinesDebug = coroutines