mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-29 13:16:01 +01:00
Fix extraneous incremental chunk sizes.
This commit is contained in:
committed by
Greyson Parrelli
parent
ed24fd0c4b
commit
ea38376c3a
@@ -63,7 +63,7 @@ class DigestingRequestBody(
|
||||
|
||||
outputStream.flush()
|
||||
|
||||
val incrementalDigest: ByteArray = if (isIncremental) {
|
||||
val incrementalDigest: ByteArray? = if (isIncremental) {
|
||||
if (contentLength != outputStream.totalBytesWritten) {
|
||||
Log.w(TAG, "Content uploaded ${logMessage(outputStream.totalBytesWritten, contentLength)} bytes compared to expected!")
|
||||
} else {
|
||||
@@ -73,10 +73,12 @@ class DigestingRequestBody(
|
||||
digestStream.close()
|
||||
digestStream.toByteArray()
|
||||
} else {
|
||||
ByteArray(0)
|
||||
null
|
||||
}
|
||||
|
||||
attachmentDigest = AttachmentDigest(outputStream.transmittedDigest, incrementalDigest, sizeChoice.sizeInBytes)
|
||||
val incrementalDigestChunkSize: Int = if (incrementalDigest?.isNotEmpty() == true) sizeChoice.sizeInBytes else 0
|
||||
|
||||
attachmentDigest = AttachmentDigest(outputStream.transmittedDigest, incrementalDigest, incrementalDigestChunkSize)
|
||||
}
|
||||
|
||||
override fun contentLength(): Long {
|
||||
|
||||
Reference in New Issue
Block a user