Skip to content

Commit

Permalink
Issue jetty#11803 - use static exception for normal completion
Browse files Browse the repository at this point in the history
  • Loading branch information
scrat98 committed May 26, 2024
1 parent f410849 commit b60fca3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.eclipse.jetty.io.Content;
import org.eclipse.jetty.util.IteratingCallback;
import org.eclipse.jetty.util.MathUtils;
import org.eclipse.jetty.util.StaticException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -195,6 +196,7 @@ public void cancel(LastWill lastWill)
private static final class ActiveSubscription extends IteratingCallback implements LastWillSubscription
{
private static final long NO_MORE_DEMAND = -1;
private static final Throwable COMPLETED = new StaticException("Source.Content read fully");
private final AtomicReference<LastWill> cancelled;
private final AtomicLong demand;
private Content.Source content;
Expand Down Expand Up @@ -275,7 +277,7 @@ protected Action process()

if (chunk.isLast())
{
cancel(new CompletionException("Source.Content read fully", null), FinalSignal.COMPLETE);
cancel(COMPLETED, FinalSignal.COMPLETE);
return Action.IDLE;
}

Expand Down

0 comments on commit b60fca3

Please sign in to comment.