diff --git a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlCallbacks.kt b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlCallbacks.kt index 6b41b7a163a..b2f31182ed4 100644 --- a/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlCallbacks.kt +++ b/ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/internal/CurlCallbacks.kt @@ -55,7 +55,7 @@ internal fun onBodyChunkReceived( return -1 } if (written > 0) { - wrapper.bytesWritten += written + wrapper.bytesWritten.addAndGet(written) } if (wrapper.bytesWritten.value == chunkSize) { wrapper.bytesWritten.value = 0