You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: runtime/auth/aws-signing-common/api/aws-signing-common.api
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,9 @@ public final class aws/smithy/kotlin/runtime/auth/awssigning/AwsChunkedSource :
23
23
public fun <init> (Laws/smithy/kotlin/runtime/io/SdkSource;Laws/smithy/kotlin/runtime/auth/awssigning/AwsSigner;Laws/smithy/kotlin/runtime/auth/awssigning/AwsSigningConfig;[BLaws/smithy/kotlin/runtime/http/DeferredHeaders;)V
24
24
public synthetic fun <init> (Laws/smithy/kotlin/runtime/io/SdkSource;Laws/smithy/kotlin/runtime/auth/awssigning/AwsSigner;Laws/smithy/kotlin/runtime/auth/awssigning/AwsSigningConfig;[BLaws/smithy/kotlin/runtime/http/DeferredHeaders;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
25
25
public fun close ()V
26
+
public final fun getContentBytesTransferred ()J
26
27
public fun read (Laws/smithy/kotlin/runtime/io/SdkBuffer;J)J
28
+
public final fun setContentBytesTransferred (J)V
27
29
}
28
30
29
31
public final class aws/smithy/kotlin/runtime/auth/awssigning/AwsSignatureType : java/lang/Enum {
Copy file name to clipboardExpand all lines: runtime/auth/aws-signing-common/common/src/aws/smithy/kotlin/runtime/auth/awssigning/internal/AwsChunkedReader.kt
+20-6Lines changed: 20 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,13 @@ internal class AwsChunkedReader(
57
57
*/
58
58
internalvar hasLastChunkBeenSent:Boolean=false
59
59
60
+
/**
61
+
* Tracks the number of bytes used for chunk metadata.
62
+
* This includes chunk headers, terminators (CRLF), and trailers.
63
+
* Used to calculate the actual payload bytes transferred by subtracting metadata bytes from the total bytes read.
64
+
*/
65
+
internalvar chunkMetadataBytes:Long=0L
66
+
60
67
/**
61
68
* Ensures that the internal [chunk] is valid for reading. If it's not valid, try to load the next chunk. Note that
62
69
* this function will suspend until the whole chunk has been loaded.
@@ -65,7 +72,11 @@ internal class AwsChunkedReader(
65
72
*/
66
73
internalsuspendfunensureValidChunk(): Boolean {
67
74
// check if the current chunk is still valid
68
-
if (chunk.size >0L) returntrue
75
+
if (chunk.size >0L) {
76
+
// // Reset metadata bytes counter as only first read of a chunk contains metadata
77
+
chunkMetadataBytes =0L
78
+
returntrue
79
+
}
69
80
70
81
// if not, try to fetch a new chunk
71
82
val nextChunk =when {
@@ -80,9 +91,10 @@ internal class AwsChunkedReader(
80
91
next
81
92
}
82
93
}
83
-
94
+
val preTerminatorChunkSize = nextChunk?.size ?:0L
84
95
nextChunk?.writeUtf8("\r\n") // terminating CRLF to signal end of chunk
85
-
96
+
val chunkSizeWithTerminator = nextChunk?.size ?:0L
0 commit comments