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

This commit is contained in:
Simone Bordet 2015-09-29 09:42:28 +02:00
commit 701ca1aa26
5 changed files with 74 additions and 48 deletions

View File

@ -234,7 +234,11 @@ public abstract class AbstractConnection implements Connection
@Override @Override
public String toString() 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 private class ReadCallback implements Callback

View File

@ -554,8 +554,7 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
_requests, _requests,
_committed.get(), _committed.get(),
_state.getState(), _state.getState(),
_state.getState()==HttpChannelState.State.IDLE?"-":_request.getRequestURI() _uri);
);
} }
public void onRequest(MetaData.Request request) public void onRequest(MetaData.Request request)

View File

@ -517,6 +517,55 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
return new Content(c); 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 private class Content extends HttpInput.Content
{ {
public Content(ByteBuffer 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); 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);
}
} }

View File

@ -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 public static class PoisonPillContent extends Content
{ {
private final String _name; private final String _name;

View File

@ -2250,7 +2250,13 @@ public class Request implements HttpServletRequest
@Override @Override
public String toString() 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());
} }
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */