Merge remote-tracking branch 'origin/jetty-9.2.x'

This commit is contained in:
Greg Wilkins 2015-05-22 10:01:04 +10:00
commit 68412d1958
1 changed files with 6 additions and 1 deletions

View File

@ -104,6 +104,11 @@ public class HttpOutput extends ServletOutputStream implements Runnable
HttpConfiguration config = channel.getHttpConfiguration();
_bufferSize = config.getOutputBufferSize();
_commitSize = config.getOutputAggregationSize();
if (_commitSize>_bufferSize)
{
LOG.warn("OutputAggregationSize {} exceeds bufferSize {}",_commitSize,_bufferSize);
_commitSize=_bufferSize;
}
}
public HttpChannel getHttpChannel()
@ -403,7 +408,7 @@ public class HttpOutput extends ServletOutputStream implements Runnable
write(_aggregate, complete && len==0);
// should we fill aggregate again from the buffer?
if (len>0 && !complete && len<=_commitSize)
if (len>0 && !complete && len<=_commitSize && len<=BufferUtil.space(_aggregate))
{
BufferUtil.append(_aggregate, b, off, len);
return;