Skip to content

Commit c906b75

Browse files
committed
stream.close() in onResponseComplete
1 parent 611c622 commit c906b75

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"id": "1ab4f8b7-5721-4024-a4dc-d0c595495bd2",
3+
"type": "bugfix",
4+
"description": "Close HttpStreams in CrtHttpEngine after call completion"
5+
}

runtime/protocol/http-client-engines/http-client-engine-crt/jvm/src/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandler.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,11 @@ internal class SdkStreamResponseHandler(
166166
// stream is only valid until the end of this callback, ensure any further data being read downstream
167167
// doesn't call incrementWindow on a resource that has been free'd
168168
lock.withLock {
169+
crtStream?.close()
169170
crtStream = null
170171
streamCompleted = true
171172
}
173+
stream.close()
172174

173175
// close the body channel
174176
if (errorCode != 0) {

0 commit comments

Comments
 (0)