diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java index 02480fefcb6b..5a9fc88d0d23 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java @@ -287,7 +287,7 @@ private void onWriteComplete(boolean last, Throwable failure) _state = State.CLOSED; closedCallback = _closedCallback; _closedCallback = null; - releaseBuffer(failure); + releaseBuffer(); wake = updateApiState(failure); } else if (_state == State.CLOSE) @@ -508,7 +508,7 @@ public void completed(Throwable failure) try (AutoLock l = _channelState.lock()) { _state = State.CLOSED; - releaseBuffer(failure); + releaseBuffer(); } } @@ -648,15 +648,12 @@ private ByteBuffer acquireBuffer() return _aggregate; } - private void releaseBuffer(Throwable failure) + private void releaseBuffer() { if (_aggregate != null) { ByteBufferPool bufferPool = _channel.getConnector().getByteBufferPool(); - if (failure == null) - bufferPool.release(_aggregate); - else - bufferPool.remove(_aggregate); + bufferPool.release(_aggregate); _aggregate = null; } } @@ -1403,7 +1400,7 @@ public void recycle() _commitSize = config.getOutputAggregationSize(); if (_commitSize > _bufferSize) _commitSize = _bufferSize; - releaseBuffer(null); + releaseBuffer(); _written = 0; _writeListener = null; _onError = null;