From a60d503ed59774ead4d52c9f595e1ecf29874275 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Thu, 1 Aug 2024 17:17:04 -0400 Subject: [PATCH] Relocate `stream.close()` to `onResponseComplete` --- .../kotlin/runtime/http/engine/crt/SdkStreamResponseHandler.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvm/src/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandler.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvm/src/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandler.kt index 63e5bea56..5bd69e6f6 100644 --- a/runtime/protocol/http-client-engines/http-client-engine-crt/jvm/src/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandler.kt +++ b/runtime/protocol/http-client-engines/http-client-engine-crt/jvm/src/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandler.kt @@ -166,7 +166,7 @@ internal class SdkStreamResponseHandler( // stream is only valid until the end of this callback, ensure any further data being read downstream // doesn't call incrementWindow on a resource that has been free'd lock.withLock { - crtStream?.close() ?: throw IllegalStateException("onResponseComplete expected CRT HttpStream to be non-null") + crtStream?.close() crtStream = null streamCompleted = true }