summaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
authorEdoardo La Greca2025-08-06 20:06:55 +0200
committerEdoardo La Greca2025-08-06 20:06:55 +0200
commite8fdfbcea6f2028972d74b65c52d6e7d1aea214c (patch)
tree6dc9d965e164c4086c194127757df08998e0257a /src/main/kotlin
parent4030d1880474e2188a01a5fd6f20c8d068e5afeb (diff)
use count more wisely in write
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/Connection.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/kotlin/Connection.kt b/src/main/kotlin/Connection.kt
index 564e8a7..6444ade 100644
--- a/src/main/kotlin/Connection.kt
+++ b/src/main/kotlin/Connection.kt
@@ -153,6 +153,7 @@ class Connection(transLay: TransportLayer) : ProtocolTranslator {
}
override fun write(fid: UInt, offset: ULong, count: UInt, data: Iterable<UByte>): Pair<String?, UInt> {
+ val data = data.take(count.toInt()).toTypedArray()
val omsg = OutMessage(NinePMessageType.TWRITE, this.tagGen.generate(), listOf("offset", "count", "data"),
mapOf(
"offset" to BigInteger(offset.toString()),
@@ -160,7 +161,7 @@ class Connection(transLay: TransportLayer) : ProtocolTranslator {
),
emptyMap(),
mapOf(
- "data" to data.toList().toTypedArray()
+ "data" to data
),
this.maxSize
)