From 61d6e669db5057355a9fdea2c36666bb24978e22 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Tue, 19 Dec 2023 13:59:07 +1100 Subject: [PATCH] make ContentChunk retainable so multipart can use the chunks Signed-off-by: Lachlan Roberts --- .../jetty/delegate/impl/ContentChunk.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/jetty/delegate/impl/ContentChunk.java b/runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/jetty/delegate/impl/ContentChunk.java index ec39ee7f..48ead32c 100644 --- a/runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/jetty/delegate/impl/ContentChunk.java +++ b/runtime/runtime_impl_jetty12/src/main/java/com/google/apphosting/runtime/jetty/delegate/impl/ContentChunk.java @@ -18,17 +18,15 @@ import java.nio.ByteBuffer; import java.util.Objects; + import org.eclipse.jetty.io.Content; +import org.eclipse.jetty.io.Retainable; import org.eclipse.jetty.util.BufferUtil; -public class ContentChunk implements Content.Chunk { +public class ContentChunk extends Retainable.ReferenceCounter implements Content.Chunk { private final ByteBuffer byteBuffer; private final boolean last; - public ContentChunk(ByteBuffer byteBuffer) { - this(byteBuffer, true); - } - public ContentChunk(byte[] bytes) { this(BufferUtil.toBuffer(bytes), true); } @@ -48,16 +46,6 @@ public boolean isLast() { return last; } - @Override - public void retain() { - throw new UnsupportedOperationException(); - } - - @Override - public boolean release() { - return true; - } - @Override public String toString() {