Skip to content

Commit

Permalink
add some fixes to SizeLimitHandler
Browse files Browse the repository at this point in the history
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
  • Loading branch information
lachlan-roberts committed Nov 9, 2022
1 parent 4dc81ad commit ec197a2
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ public boolean isOptimizedForDirectBuffers()
@Override
public HttpInput.Content readFrom(HttpInput.Content content)
{
if (content == null)
return null;

if (content.hasContent())
{
_read += content.remaining();
Expand All @@ -140,7 +143,16 @@ public void write(ByteBuffer content, boolean last, Callback callback)
if (content.hasRemaining())
{
_written += content.remaining();
checkResponseLimit(_written);

try
{
checkResponseLimit(_written);
}
catch (Throwable t)
{
callback.failed(t);
return;
}
}
getNextInterceptor().write(content, last, callback);
}
Expand Down

1 comment on commit ec197a2

@AN3Orik
Copy link

@AN3Orik AN3Orik commented on ec197a2 Jun 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Producing NPE via #9476

Please sign in to comment.