From 90c07f34908883a0800589b78e194f6019daf403 Mon Sep 17 00:00:00 2001 From: Ryan Schmitt Date: Thu, 3 Oct 2019 13:20:00 -0700 Subject: [PATCH] Upgrade httpcore.version to 5.0-beta9 --- .../http/impl/async/LoggingIOSession.java | 15 +++++++++++++++ .../DefaultManagedAsyncClientConnection.java | 17 ++++++----------- pom.xml | 2 +- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/LoggingIOSession.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/LoggingIOSession.java index a0256c81f..ebf515bfc 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/LoggingIOSession.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/LoggingIOSession.java @@ -158,6 +158,11 @@ class LoggingIOSession implements ProtocolIOSession { } } + @Override + public boolean isOpen() { + return channel.isOpen(); + } + @Override public void close() { if (this.log.isDebugEnabled()) { @@ -258,6 +263,16 @@ class LoggingIOSession implements ProtocolIOSession { return this.id + " " + this.session.toString(); } + @Override + public int read(final ByteBuffer dst) throws IOException { + return channel.read(dst); + } + + @Override + public int write(final ByteBuffer src) throws IOException { + return channel.write(src); + } + class LoggingByteChannel implements ByteChannel { @Override diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/DefaultManagedAsyncClientConnection.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/DefaultManagedAsyncClientConnection.java index 39f3284b1..e8836380d 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/DefaultManagedAsyncClientConnection.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/DefaultManagedAsyncClientConnection.java @@ -46,7 +46,6 @@ import org.apache.hc.core5.net.NamedEndpoint; import org.apache.hc.core5.reactor.Command; import org.apache.hc.core5.reactor.IOEventHandler; import org.apache.hc.core5.reactor.IOSession; -import org.apache.hc.core5.reactor.ProtocolLayer; import org.apache.hc.core5.reactor.ssl.SSLBufferMode; import org.apache.hc.core5.reactor.ssl.SSLSessionInitializer; import org.apache.hc.core5.reactor.ssl.SSLSessionVerifier; @@ -123,22 +122,18 @@ final class DefaultManagedAsyncClientConnection implements ManagedAsyncClientCon @Override public EndpointDetails getEndpointDetails() { - if (ioSession instanceof ProtocolLayer) { - final IOEventHandler handler = ((ProtocolLayer) ioSession).getHandler(); - if (handler instanceof HttpConnection) { - return ((HttpConnection) handler).getEndpointDetails(); - } + final IOEventHandler handler = ioSession.getHandler(); + if (handler instanceof HttpConnection) { + return ((HttpConnection) handler).getEndpointDetails(); } return null; } @Override public ProtocolVersion getProtocolVersion() { - if (ioSession instanceof ProtocolLayer) { - final IOEventHandler handler = ((ProtocolLayer) ioSession).getHandler(); - if (handler instanceof HttpConnection) { - return ((HttpConnection) handler).getProtocolVersion(); - } + final IOEventHandler handler = ioSession.getHandler(); + if (handler instanceof HttpConnection) { + return ((HttpConnection) handler).getProtocolVersion(); } return HttpVersion.DEFAULT; } diff --git a/pom.xml b/pom.xml index 88075c7eb..25b6c60d0 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ 1.7 1.7 - 5.0-beta8 + 5.0-beta9 2.9.1 1.12 1.4.1