London Escorts sunderland escorts 1v1.lol unblocked yohoho 76 https://www.symbaloo.com/mix/yohoho?lang=EN yohoho https://www.symbaloo.com/mix/agariounblockedpvp https://yohoho-io.app/ https://www.symbaloo.com/mix/agariounblockedschool1?lang=EN
6.1 C
New York
Saturday, February 1, 2025

android – Ktor Darwin engine not supporting chunked information studying


I’ve an issue with chunked switch encoding in iOS. That is the KMM code:

non-public const val DEFAULT_BUFFER_SIZE: Int = 8 * 1024

inside val shopper = HttpClient()
    
enjoyable readChunkedData(url: String, onChunk: (String) -> Unit): Job {
    val scope = MainScope()
    return scope.launch {
        shopper.preparePost(url).execute {
            val channel: ByteReadChannel = it.physique()
            whereas (!channel.isClosedForRead) {
                val buffer = ByteArray(DEFAULT_BUFFER_SIZE)
                channel.readAvailable(buffer)
                val trimmed = buffer
                    .dropLastWhile { b -> b == 0.toByte() }
                    .toByteArray()
                    .map { c -> Char(c.toInt()) }
                    .toCharArray()

                onChunk(trimmed.concatToString())
            }
        }
    }
}

iOS use Darwin engine and Android Okhttp for Ktor

In Android this code works positive:

enter image description here

However in iOS isn’t working as anticipated (as a substitute of studying chunks is awaiting the entire response):

enter image description here

Is any answer to repair it? I used to be attempting to make use of CIO engine however getting one other subject in iOS: TLS periods will not be supported on Native platform.

Related Articles

Social Media Auto Publish Powered By : XYZScripts.com