This commit is contained in:
Greg Wilkins 2017-04-26 16:02:18 +02:00
parent fe173454e1
commit 5e5d650b05
3 changed files with 11 additions and 5 deletions

View File

@ -367,8 +367,15 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
if (LOG.isDebugEnabled())
LOG.debug("Could not perform ERROR dispatch, aborting", x);
Throwable failure = (Throwable)_request.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
failure.addSuppressed(x);
minimalErrorResponse(failure);
if (failure==null)
{
minimalErrorResponse(x);
}
else
{
failure.addSuppressed(x);
minimalErrorResponse(failure);
}
}
break;
}

View File

@ -654,7 +654,8 @@ public class Response implements HttpServletResponse
if (error_handler!=null)
error_handler.handle(null, request, request, this);
}
closeOutput();
if (!request.isAsyncStarted())
closeOutput();
}
/**

View File

@ -52,7 +52,6 @@ import javax.servlet.http.HttpServletResponseWrapper;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.DebugListener;
import org.eclipse.jetty.server.Dispatcher;
import org.eclipse.jetty.server.HttpChannel;
import org.eclipse.jetty.server.QuietServletException;
import org.eclipse.jetty.server.Request;
@ -753,7 +752,6 @@ public class AsyncServletTest
// ignored
}
// System.err.println(request.getDispatcherType()+" "+request.getRequestURI());
historyAdd(request.getDispatcherType()+" "+request.getRequestURI());
if (request instanceof ServletRequestWrapper || response instanceof ServletResponseWrapper)
historyAdd("wrapped"+((request instanceof ServletRequestWrapper)?" REQ":"")+((response instanceof ServletResponseWrapper)?" RSP":""));