Use EmbeddedChannel.finishAndReleaseAll() to remove boiler-plate code (#9824)
Motivation: We can make use of EmbeddedChannel.finishAndReleaseAll() and so remove some code Modifications: Use finishAndReleaseAll() Result: Less code to maintain
This commit is contained in:
parent
98615a0de5
commit
3654d2c245
@ -284,16 +284,7 @@ public class CompressorHttp2ConnectionEncoder extends DecoratingHttp2ConnectionE
|
||||
* @param compressor The compressor for {@code stream}
|
||||
*/
|
||||
void cleanup(Http2Stream stream, EmbeddedChannel compressor) {
|
||||
if (compressor.finish()) {
|
||||
for (;;) {
|
||||
final ByteBuf buf = compressor.readOutbound();
|
||||
if (buf == null) {
|
||||
break;
|
||||
}
|
||||
|
||||
buf.release();
|
||||
}
|
||||
}
|
||||
compressor.finishAndReleaseAll();
|
||||
stream.removeProperty(propertyKey);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user