Aborting the response if the content length limit is reached.

This commit is contained in:
Simone Bordet 2012-12-07 16:42:02 +01:00
parent 97a2f3328f
commit d6bd9df93a
1 changed files with 1 additions and 1 deletions

View File

@ -88,7 +88,7 @@ public abstract class BufferingResponseListener extends Response.Listener.Empty
{
long newLength = buffer.length + content.remaining();
if (newLength > maxLength)
throw new IllegalStateException("Buffering capacity exceeded");
response.abort(new IllegalArgumentException("Buffering capacity exceeded"));
byte[] newBuffer = new byte[(int)newLength];
System.arraycopy(buffer, 0, newBuffer, 0, buffer.length);