diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java index f0185b0f0a1..ce15cd40693 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java @@ -234,7 +234,11 @@ public abstract class AbstractConnection implements Connection @Override public String toString() { - return String.format("%s@%x", getClass().getSimpleName(), hashCode()); + return String.format("%s@%x[%s,%s]", + getClass().getSimpleName(), + hashCode(), + _state.get(), + _endPoint); } private class ReadCallback implements Callback diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java index 9e02326dfc8..d6295de76c3 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java @@ -554,8 +554,7 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor _requests, _committed.get(), _state.getState(), - _state.getState()==HttpChannelState.State.IDLE?"-":_request.getRequestURI() - ); + _uri); } public void onRequest(MetaData.Request request) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java index 4f3a84b1474..791d05e3701 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java @@ -517,6 +517,55 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http return new Content(c); } + @Override + public void abort(Throwable failure) + { + // Do a direct close of the output, as this may indicate to a client that the + // response is bad either with RST or by abnormal completion of chunked response. + getEndPoint().close(); + } + + @Override + public boolean isPushSupported() + { + return false; + } + + /** + * @see org.eclipse.jetty.server.HttpTransport#push(org.eclipse.jetty.http.MetaData.Request) + */ + @Override + public void push(org.eclipse.jetty.http.MetaData.Request request) + { + LOG.debug("ignore push in {}",this); + } + + public void asyncReadFillInterested() + { + getEndPoint().fillInterested(_asyncReadCallback); + } + + public void blockingReadFillInterested() + { + getEndPoint().fillInterested(_blockingReadCallback); + } + + public void blockingReadException(Throwable e) + { + _blockingReadCallback.failed(e); + } + + @Override + public String toString() + { + return String.format("%s[p=%s,g=%s,c=%s]", + super.toString(), + _parser, + _generator, + _channel); + return super.toString()+"<--"+BufferUtil.toDetailString(_requestBuffer); + } + private class Content extends HttpInput.Content { public Content(ByteBuffer content) @@ -764,48 +813,4 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http return String.format("%s[i=%s,cb=%s]",super.toString(),_info,_callback); } } - - @Override - public void abort(Throwable failure) - { - // Do a direct close of the output, as this may indicate to a client that the - // response is bad either with RST or by abnormal completion of chunked response. - getEndPoint().close(); - } - - @Override - public boolean isPushSupported() - { - return false; - } - - /** - * @see org.eclipse.jetty.server.HttpTransport#push(org.eclipse.jetty.http.MetaData.Request) - */ - @Override - public void push(org.eclipse.jetty.http.MetaData.Request request) - { - LOG.debug("ignore push in {}",this); - } - - public void asyncReadFillInterested() - { - getEndPoint().fillInterested(_asyncReadCallback); - } - - public void blockingReadFillInterested() - { - getEndPoint().fillInterested(_blockingReadCallback); - } - - public void blockingReadException(Throwable e) - { - _blockingReadCallback.failed(e); - } - - @Override - public String toString() - { - return super.toString()+"<--"+BufferUtil.toDetailString(_requestBuffer); - } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java index cb47ec11f73..aab55d5c413 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java @@ -634,6 +634,18 @@ public class HttpInput extends ServletInputStream implements Runnable } } + @Override + public String toString() + { + return String.format("%s@%x[r=%d,s=%s,e=%s,f=%s]", + getClass().getSimpleName(), + hashCode(), + _contentRead, + _contentState, + _eofState, + _onError); + } + public static class PoisonPillContent extends Content { private final String _name; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java index 76b62dae51d..817a4e1c04f 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java @@ -2250,7 +2250,13 @@ public class Request implements HttpServletRequest @Override public String toString() { - return (_handled?"[":"(") + getMethod() + " " + _metadata.getURI() + (_handled?"]@":")@") + hashCode() + " " + super.toString(); + return String.format("%s%s%s %s%s@%x", + getClass().getSimpleName(), + _handled ? "[" : "(", + getMethod(), + _uri, + _handled ? "]" : ")", + hashCode()); } /* ------------------------------------------------------------ */