-
Notifications
You must be signed in to change notification settings - Fork 974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UNDERTOW-2143 Deflaters operate directly on ByteBuffers #1367
Conversation
//we may already have some input, if so compress it | ||
if (!deflater.needsInput()) { | ||
deflateData(false); | ||
if (!deflater.needsInput()) { | ||
return 0; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case is no longer possible because we deflate from a source buffer and return the difference in position (the amount the deflater has consumed), and set an EMPTY buffer to prevent ourselves from leaking references to that buffer. As such, before and after a call to write
, the deflater always needs input.
@@ -556,7 +554,6 @@ private void freeBuffer() { | |||
deflater = null; | |||
pooledObject.close(); | |||
} | |||
IoUtils.safeClose(additionalBuffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm missing the points where the buffers are closed? I think you need to close, for example, trailerBuffer here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailerBuffer
is no longer a pooled buffer, rather the result of ByteBuffer.wrap(
on the byte-array result of getTrailer()
b7eec23
to
2c97a39
Compare
Jira: https://issues.redhat.com/browse/UNDERTOW-2143