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:
Norman Maurer 2019-11-28 11:03:39 +01:00
parent 371c431b6b
commit 16c88fd9ed

View File

@ -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);
}