jetty-9 some better names
This commit is contained in:
parent
bad8f74840
commit
b1c50180b9
|
@ -49,7 +49,7 @@ public class EncodingHttpWriter extends HttpWriter
|
|||
public void write (char[] s,int offset, int length) throws IOException
|
||||
{
|
||||
if (length==0)
|
||||
_out.checkAllWritten();
|
||||
_out.closeIfAllContentWritten();
|
||||
|
||||
while (length > 0)
|
||||
{
|
||||
|
|
|
@ -46,13 +46,13 @@ import org.eclipse.jetty.util.resource.Resource;
|
|||
*/
|
||||
public class HttpOutput extends ServletOutputStream
|
||||
{
|
||||
private final HttpChannel _channel;
|
||||
private final HttpChannel<?> _channel;
|
||||
private boolean _closed;
|
||||
private long _written;
|
||||
private ByteBuffer _aggregate;
|
||||
private int _bufferSize;
|
||||
|
||||
public HttpOutput(HttpChannel channel)
|
||||
public HttpOutput(HttpChannel<?> channel)
|
||||
{
|
||||
_channel = channel;
|
||||
_bufferSize = _channel.getHttpChannelConfig().getOutputBufferSize();
|
||||
|
@ -114,9 +114,9 @@ public class HttpOutput extends ServletOutputStream
|
|||
_channel.write(BufferUtil.EMPTY_BUFFER, false);
|
||||
}
|
||||
|
||||
public boolean checkAllWritten() throws IOException
|
||||
public boolean closeIfAllContentWritten() throws IOException
|
||||
{
|
||||
return _channel.getResponse().checkAllContentWritten(_written);
|
||||
return _channel.getResponse().closeIfAllContentWritten(_written);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -169,10 +169,8 @@ public class HttpOutput extends ServletOutputStream
|
|||
_written += len;
|
||||
|
||||
// Check if all written or full
|
||||
if (!checkAllWritten() && BufferUtil.isFull(_aggregate))
|
||||
{
|
||||
if (!closeIfAllContentWritten() && BufferUtil.isFull(_aggregate))
|
||||
_channel.write(_aggregate, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -188,7 +186,7 @@ public class HttpOutput extends ServletOutputStream
|
|||
_written++;
|
||||
|
||||
// Check if all written or full
|
||||
if (!checkAllWritten() && BufferUtil.isFull(_aggregate))
|
||||
if (!closeIfAllContentWritten() && BufferUtil.isFull(_aggregate))
|
||||
_channel.write(_aggregate, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class Iso88591HttpWriter extends HttpWriter
|
|||
{
|
||||
HttpOutput out = _out;
|
||||
if (length==0)
|
||||
out.checkAllWritten();
|
||||
out.closeIfAllContentWritten();
|
||||
|
||||
while (length > 0)
|
||||
{
|
||||
|
|
|
@ -705,7 +705,7 @@ public class Response implements HttpServletResponse
|
|||
{
|
||||
try
|
||||
{
|
||||
checkAllContentWritten(written);
|
||||
closeIfAllContentWritten(written);
|
||||
}
|
||||
catch(IOException e)
|
||||
{
|
||||
|
@ -714,7 +714,7 @@ public class Response implements HttpServletResponse
|
|||
}
|
||||
}
|
||||
|
||||
public boolean checkAllContentWritten(long written) throws IOException
|
||||
public boolean closeIfAllContentWritten(long written) throws IOException
|
||||
{
|
||||
if (_contentLength >= 0 && written >= _contentLength)
|
||||
{
|
||||
|
|
|
@ -44,7 +44,7 @@ public class Utf8HttpWriter extends HttpWriter
|
|||
{
|
||||
HttpOutput out = _out;
|
||||
if (length==0)
|
||||
out.checkAllWritten();
|
||||
out.closeIfAllContentWritten();
|
||||
|
||||
while (length > 0)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue