Skip to content

Commit 890e2fb

Browse files
committed
wip: debugging k/n test failures in smithy-kotlin
1 parent a79931f commit 890e2fb

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

aws-crt-kotlin/native/src/aws/sdk/kotlin/crt/http/HttpClientConnectionNative.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ package aws.sdk.kotlin.crt.http
77
import aws.sdk.kotlin.crt.*
88
import aws.sdk.kotlin.crt.io.Buffer
99
import aws.sdk.kotlin.crt.io.ByteCursorBuffer
10-
import aws.sdk.kotlin.crt.util.asAwsByteCursor
11-
import aws.sdk.kotlin.crt.util.initFromCursor
12-
import aws.sdk.kotlin.crt.util.toKString
13-
import aws.sdk.kotlin.crt.util.use
14-
import aws.sdk.kotlin.crt.util.withAwsByteCursor
10+
import aws.sdk.kotlin.crt.util.*
1511
import kotlinx.atomicfu.atomic
1612
import kotlinx.cinterop.*
1713
import libcrt.*
@@ -146,8 +142,11 @@ private fun onIncomingBody(
146142
data: CPointer<aws_byte_cursor>?,
147143
userdata: COpaquePointer?,
148144
): Int {
149-
val ctx = userdata?.asStableRef<HttpStreamContext>()?.get() ?: return AWS_OP_ERR
150-
val stream = ctx.stream ?: return AWS_OP_ERR
145+
val stableRef = userdata?.asStableRef<HttpStreamContext>()
146+
val ctx = stableRef?.get()
147+
if (ctx == null) return AWS_OP_ERR
148+
val stream = ctx.stream
149+
if (stream == null) return AWS_OP_ERR
151150

152151
try {
153152
val body = if (data != null) ByteCursorBuffer(data) else Buffer.Empty

build-support/src/main/kotlin/aws/sdk/kotlin/gradle/crt/CMakeUtils.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ val KonanTarget.osxArchitectureName
6666
KonanTarget.WATCHOS_ARM64 -> "arm64_32"
6767
else -> null
6868
}
69-
else -> null
7069
}
7170

7271
fun Project.cmakeBuildDir(target: KotlinNativeTarget): File =

0 commit comments

Comments
 (0)