467936 -w Check HttpOutput aggregateSize is < bufferSize

This commit is contained in:
Greg Wilkins 2015-05-22 09:54:27 +10:00
parent c7cff6ec7e
commit 5bde7f34ea
1 changed files with 6 additions and 1 deletions

View File

@ -90,6 +90,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()
@ -350,7 +355,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;