https://kotlinlang.org logo
#ktor
Title
# ktor
a

Anders Oedlund

07/29/2021, 10:55 PM
I’ve noticed that sometimes (reasonably often) while using Ktor client with the Logging plugin installed on iOS in a KMM project some kind of deadlock occurs after
log("BODY START")
in the below function.
Copy code
private suspend fun logResponseBody(contentType: ContentType?, content: ByteReadChannel): Unit = with(logger) {
     log("BODY Content-Type: $contentType")
     log("BODY START")
     val message = content.tryReadText(contentType?.charset() ?: Charsets.UTF_8) ?: "[response body omitted]"
     log(message)
     log("BODY END")
}
Does anyone else have a similar experience, or any pointer how to avoid this (other than not installing the Logging plugin)?
a

Aleksei Tirman [JB]

07/30/2021, 11:00 AM
Could you please file an issue with a complete sample code attached?
a

Anders Oedlund

07/30/2021, 6:28 PM
6 Views