use of org.eclipse.jetty.server.HttpConnection in project gerrit by GerritCodeReview.
the class HiddenErrorHandler method handle.
@Override
public void handle(String target, Request baseRequest, HttpServletRequest req, HttpServletResponse res) throws IOException {
HttpConnection conn = HttpConnection.getCurrentConnection();
baseRequest.setHandled(true);
try {
log(req);
} finally {
reply(conn, res);
}
}
use of org.eclipse.jetty.server.HttpConnection in project zm-mailbox by Zimbra.
the class JettyUtil method setIdleTimeout.
public static void setIdleTimeout(long timeout, HttpServletRequest request) {
if (request != null) {
Object attr = request.getAttribute("org.eclipse.jetty.server.HttpConnection");
if (attr instanceof HttpConnection) {
@SuppressWarnings("resource") HttpConnection conn = (HttpConnection) attr;
EndPoint ep = conn.getEndPoint();
if (ep != null) {
ep.setIdleTimeout(timeout);
} else {
ZimbraLog.misc.warn("null endpoint setting Jetty timeout?", new Exception());
}
} else {
//this won't work for SPDY connections, so we'll have to consider this further once we enable it.
ZimbraLog.misc.warn("got [%s] not instanceof org.eclipse.jetty.server.HttpConnection", attr, new Exception());
}
} else {
ZimbraLog.misc.warn("cannot set timeout for null request", new Exception());
}
}
Aggregations