Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix/jetty-12.1.x/12681-cached-co…
Browse files Browse the repository at this point in the history
…ntent-already-released' into fix/jetty-12.1.x/serlvet6-demos

# Conflicts:
#	jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/content/CachingHttpContentFactory.java
  • Loading branch information
gregw committed Jan 13, 2025
1 parent 5744f05 commit f3f8f80
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public void writeTo(Content.Sink sink, long offset, long length, Callback callba
boolean retained = false;
try
{
retained = retain();
retained = cachedRetain();
if (retained)
sink.write(true, BufferUtil.slice(_buffer.getByteBuffer(), Math.toIntExact(offset), Math.toIntExact(length)), Callback.from(this::release, callback));
else
Expand All @@ -388,7 +388,7 @@ public void writeTo(Content.Sink sink, long offset, long length, Callback callba
* its internal buffer if it is.
* @return true if this content can be used and has been retained, false otherwise.
*/
private boolean retain()
private boolean cachedRetain()
{
return _cache.computeIfPresent(_cacheKey, (s, cachingHttpContent) ->
{
Expand Down

0 comments on commit f3f8f80

Please sign in to comment.