Merged branch 'jetty-9.2.x' into 'master'.

This commit is contained in:
Simone Bordet 2014-10-24 14:06:54 +02:00
commit d13cdf2592
1 changed files with 30 additions and 34 deletions

View File

@ -94,7 +94,6 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
private final HttpChannelState _state;
private final Request _request;
private final Response _response;
private MetaData.Response _committedInfo;
private RequestLog _requestLog;
public HttpChannel(Connector connector, HttpConfiguration configuration, EndPoint endPoint, HttpTransport transport, HttpInput input)
@ -210,7 +209,6 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
_committed.set(false);
_request.recycle();
_response.recycle();
_committedInfo=null;
_requestLog=null;
}
@ -366,6 +364,36 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
}
}
if (action==Action.COMPLETE)
{
try
{
_state.completed();
if (!_response.isCommitted() && !_request.isHandled())
{
_response.sendError(404);
}
else
{
// Complete generating the response
_response.closeOutput();
}
}
catch(EofException|ClosedChannelException e)
{
LOG.debug(e);
}
catch(Exception e)
{
LOG.warn("complete failed",e);
}
finally
{
_request.setHandled(true);
_transport.completed();
}
}
}
finally
{
@ -374,37 +402,6 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
Thread.currentThread().setName(threadName);
}
if (action==Action.COMPLETE)
{
try
{
_state.completed();
if (!_response.isCommitted() && !_request.isHandled())
{
_response.sendError(404);
}
else
{
// Complete generating the response
_response.closeOutput();
}
}
catch(EofException|ClosedChannelException e)
{
LOG.debug(e);
}
catch(Exception e)
{
LOG.warn("complete failed",e);
}
finally
{
_request.setHandled(true);
_transport.completed();
}
}
if (LOG.isDebugEnabled())
LOG.debug("{} handle exit, result {}", this, action);
@ -563,7 +560,6 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
final Callback committed = (status<200&&status>=100)?new Commit100Callback(callback):new CommitCallback(callback);
// committing write
_committedInfo=info;
_transport.send(info, _request.isHead(), content, complete, committed);
}
else if (info==null)