Replace reponse.commit with response.closeOutput

This commit is contained in:
Greg Wilkins 2013-06-04 10:51:49 +10:00
parent 6cbffcb332
commit bacff75b31
3 changed files with 7 additions and 11 deletions

View File

@ -318,9 +318,9 @@ public class HttpChannel<T> implements HttpParser.RequestHandler<T>, Runnable
if (!_response.isCommitted() && !_request.isHandled()) if (!_response.isCommitted() && !_request.isHandled())
_response.sendError(404); _response.sendError(404);
else
// Complete generating the response // Complete generating the response
_response.complete(); _response.closeOutput();
} }
catch(EofException e) catch(EofException e)
{ {

View File

@ -436,7 +436,7 @@ public class Response implements HttpServletResponse
_mimeType=null; _mimeType=null;
} }
complete(); closeOutput();
} }
/** /**
@ -516,7 +516,7 @@ public class Response implements HttpServletResponse
resetBuffer(); resetBuffer();
setHeader(HttpHeader.LOCATION, location); setHeader(HttpHeader.LOCATION, location);
setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
complete(); closeOutput();
} }
@Override @Override
@ -792,6 +792,7 @@ public class Response implements HttpServletResponse
getOutputStream().close(); getOutputStream().close();
break; break;
default: default:
_out.close();
} }
} }
@ -1062,11 +1063,6 @@ public class Response implements HttpServletResponse
return _reason; return _reason;
} }
public void complete()
{
_out.close();
}
public HttpFields getHttpFields() public HttpFields getHttpFields()
{ {
return _fields; return _fields;

View File

@ -459,7 +459,7 @@ public class Server extends HandlerWrapper implements Attributes
response.setStatus(200); response.setStatus(200);
response.getHttpFields().put(HttpHeader.ALLOW,"GET,POST,HEAD,OPTIONS"); response.getHttpFields().put(HttpHeader.ALLOW,"GET,POST,HEAD,OPTIONS");
response.setContentLength(0); response.setContentLength(0);
response.complete(); response.closeOutput();
} }
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */