416096 DefaultServlet leaves open file descriptors with file sizes greater than response buffer

This commit is contained in:
Jan Bartel 2013-08-29 12:16:38 +10:00
parent ef166c23e6
commit 35d379a335
1 changed files with 3 additions and 3 deletions

View File

@ -478,6 +478,7 @@ public class HttpOutput extends ServletOutputStream
if (_eof) if (_eof)
{ {
// Handle EOF // Handle EOF
_in.close();
closed(); closed();
_channel.getByteBufferPool().release(_buffer); _channel.getByteBufferPool().release(_buffer);
return true; return true;
@ -489,7 +490,6 @@ public class HttpOutput extends ServletOutputStream
{ {
_eof=true; _eof=true;
len=0; len=0;
_in.close();
} }
else if (len<_buffer.capacity()) else if (len<_buffer.capacity())
{ {
@ -552,6 +552,7 @@ public class HttpOutput extends ServletOutputStream
{ {
if (_eof) if (_eof)
{ {
_in.close();
closed(); closed();
_channel.getByteBufferPool().release(_buffer); _channel.getByteBufferPool().release(_buffer);
return true; return true;
@ -563,8 +564,7 @@ public class HttpOutput extends ServletOutputStream
if (len<0) if (len<0)
{ {
_eof=true; _eof=true;
len=0; len=0;
_in.close();
} }
else if (len<_buffer.capacity()) else if (len<_buffer.capacity())
{ {