Bug fix: Correct the issue with connection state detection in DefaultManagedAsyncClientConnection#isOpen().
This commit is contained in:
parent
d68f8b068a
commit
b45e9818cc
|
@ -98,7 +98,20 @@ final class DefaultManagedAsyncClientConnection implements ManagedAsyncClientCon
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpen() {
|
public boolean isOpen() {
|
||||||
return ioSession.isOpen();
|
final IOSession ioSession = this.ioSession;
|
||||||
|
if (ioSession.isOpen()) {
|
||||||
|
final IOEventHandler handler = ioSession.getHandler();
|
||||||
|
if (handler instanceof HttpConnection) {
|
||||||
|
final HttpConnection conn = (HttpConnection) handler;
|
||||||
|
final ProtocolVersion protocolVersion = conn.getProtocolVersion();
|
||||||
|
if (protocolVersion != null && protocolVersion.greaterEquals(HttpVersion.HTTP_2)) {
|
||||||
|
return conn.isOpen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue