He-Pin commented on code in PR #1134:
URL: https://github.com/apache/pekko-http/pull/1134#discussion_r3528820305
##########
http/src/main/scala/org/apache/pekko/http/scaladsl/coding/GzipCompressor.scala:
##########
@@ -70,12 +70,26 @@ private[coding] object GzipCompressor {
@InternalApi
private[coding] class GzipDecompressor(
maxBytesPerChunk: Int = Decoder.MaxBytesPerChunkDefault) extends
DeflateDecompressorBase(maxBytesPerChunk) {
+ protected[coding] def createInflater(): Inflater = new Inflater(true)
+
override def createLogic(attr: Attributes) = new ParsingLogic {
- private val inflater = new Inflater(true)
- private val crc32: CRC32 = new CRC32
+ private[this] val inflater = createInflater()
+ private[this] val crc32: CRC32 = new CRC32
+ private[this] var inflaterEnded = false
+
+ private def cleanupInflater(): Unit =
+ if (!inflaterEnded) {
+ inflaterEnded = true
Review Comment:
Maybe we can mark it as null ? instead of an inflaterEnded
--
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]