pjfanning commented on code in PR #1142:
URL: https://github.com/apache/pekko-http/pull/1142#discussion_r3542771210
##########
http/src/main/scala/org/apache/pekko/http/scaladsl/coding/DeflateCompressor.scala:
##########
@@ -60,10 +60,20 @@ private[coding] class DeflateCompressor private[coding]
(compressionLevel: Int)
protected def finishWithBuffer(buffer: Array[Byte]): ByteString = {
deflater.finish()
val res = drainDeflater(deflater, buffer)
- deflater.end()
+ endDeflater()
res
}
+ private[coding] def endDeflater(): Unit =
+ if (!deflaterEnded) {
+ deflaterEnded = true
+ deflater.end()
+ }
+
+ private[coding] override def cleanup(): Unit = endDeflater()
+
+ private var deflaterEnded = false
Review Comment:
I moved the declaration
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]