debug improvements from nghttp2 testing

This commit is contained in:
Greg Wilkins 2015-03-11 14:23:39 +11:00
parent 0592ecf3e9
commit 5456de2160
3 changed files with 6 additions and 4 deletions

View File

@ -40,6 +40,7 @@ import javax.servlet.http.HttpSession;
import org.eclipse.jetty.alpn.ALPN; import org.eclipse.jetty.alpn.ALPN;
import org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory; import org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory;
import org.eclipse.jetty.http2.server.HTTP2CServerConnectionFactory;
import org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory; import org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory;
import org.eclipse.jetty.jmx.MBeanContainer; import org.eclipse.jetty.jmx.MBeanContainer;
import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpConfiguration;
@ -86,7 +87,7 @@ public class Http2Server
http_config.setSendServerVersion(true); http_config.setSendServerVersion(true);
// HTTP Connector // HTTP Connector
ServerConnector http = new ServerConnector(server,new HttpConnectionFactory(http_config)); ServerConnector http = new ServerConnector(server,new HttpConnectionFactory(http_config), new HTTP2CServerConnectionFactory(http_config));
http.setPort(8080); http.setPort(8080);
server.addConnector(http); server.addConnector(http);

View File

@ -1308,7 +1308,8 @@ public class Request implements HttpServletRequest
@Override @Override
public String getRequestURI() public String getRequestURI()
{ {
return _metadata.getURI().getPath(); MetaData metadata = _metadata;
return (metadata==null)?null:_metadata.getURI().getPath();
} }
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */

View File

@ -495,7 +495,7 @@ public class Server extends HandlerWrapper implements Attributes
final Response response=connection.getResponse(); final Response response=connection.getResponse();
if (LOG.isDebugEnabled()) if (LOG.isDebugEnabled())
LOG.debug(request.getDispatcherType()+" "+request.getMethod()+" "+target+" on "+connection); LOG.debug("{} on {}{}",request.getDispatcherType(),connection,"\n"+request.getMethod()+" "+request.getHttpURI()+"\n"+request.getHttpFields());
if ("*".equals(target)) if ("*".equals(target))
{ {
@ -507,7 +507,7 @@ public class Server extends HandlerWrapper implements Attributes
handle(target, request, request, response); handle(target, request, request, response);
if (LOG.isDebugEnabled()) if (LOG.isDebugEnabled())
LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus()+" handled="+request.isHandled()); LOG.debug("RESPONSE for {} h={}{}",target,request.isHandled(),"\n"+response.getStatus()+" "+response.getReason()+"\n"+response.getHttpFields());
} }
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */