mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-16 15:07:27 +00:00
Bug fix: Correct the issue with connection state detection in DefaultManagedAsyncClientConnection#isOpen().
This commit is contained in:
parent
ca5e14e4e7
commit
f4e396f69c
@ -98,7 +98,20 @@ public void close() throws IOException {
|
||||
|
||||
@Override
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user