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
371c431b6b
commit
16c88fd9ed
@ -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…
Reference in New Issue
Block a user