Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'.

This commit is contained in:
Simone Bordet 2020-08-18 12:22:44 +02:00
commit 158a57276e
2 changed files with 11 additions and 4 deletions

View File

@ -40,7 +40,6 @@ public class HttpChannelOverHTTP extends HttpChannel
private final HttpConnectionOverHTTP connection;
private final HttpSenderOverHTTP sender;
private final HttpReceiverOverHTTP receiver;
private final LongAdder inMessages = new LongAdder();
private final LongAdder outMessages = new LongAdder();
public HttpChannelOverHTTP(HttpConnectionOverHTTP connection)
@ -93,7 +92,6 @@ public class HttpChannelOverHTTP extends HttpChannel
public void receive()
{
inMessages.increment();
receiver.receive();
}
@ -149,7 +147,7 @@ public class HttpChannelOverHTTP extends HttpChannel
protected long getMessagesIn()
{
return inMessages.longValue();
return receiver.getMessagesIn();
}
protected long getMessagesOut()

View File

@ -20,6 +20,7 @@ package org.eclipse.jetty.client.http;
import java.io.EOFException;
import java.nio.ByteBuffer;
import java.util.concurrent.atomic.LongAdder;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.HttpClientTransport;
@ -45,6 +46,7 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res
{
private static final Logger LOG = LoggerFactory.getLogger(HttpReceiverOverHTTP.class);
private final LongAdder inMessages = new LongAdder();
private final HttpParser parser;
private RetainableByteBuffer networkBuffer;
private boolean shutdown;
@ -343,9 +345,11 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res
return false;
int status = exchange.getResponse().getStatus();
if (status != HttpStatus.CONTINUE_100)
{
inMessages.increment();
complete = true;
}
return !responseSuccess(exchange);
}
@ -386,6 +390,11 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res
getHttpConnection().close(failure);
}
long getMessagesIn()
{
return inMessages.longValue();
}
@Override
public String toString()
{