Commit 47a288c6 authored by Him188's avatar Him188

Fix #220

parent 6d57f44e
......@@ -140,7 +140,7 @@ internal object HighwayHelper {
val headLength = readInt()
discardExact(4)
val proto = readProtoBuf(CSDataHighwayHead.RspDataHighwayHead.serializer(), length = headLength)
check(proto.errorCode == 0) { "image upload failed: Transfer errno=${proto.errorCode}" }
check(proto.errorCode == 0) { "highway transfer failed, error ${proto.errorCode}" }
}
}
}
......
......@@ -94,7 +94,7 @@ internal fun UByteArray.toUHexString(separator: String = " ", offset: Int = 0, l
@Suppress("NOTHING_TO_INLINE")
internal inline fun ByteArray.encodeToString(offset: Int = 0, charset: Charset = Charsets.UTF_8): String =
String(this, charset = charset, offset = offset)
String(this, charset = charset, offset = offset, length = this.size - offset)
@PublishedApi
internal inline fun ByteArray.toReadPacket(offset: Int = 0, length: Int = this.size - offset) =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment