File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,20 @@ public void close() throws IOException {
98
98
99
99
@ Override
100
100
public boolean isOpen () {
101
- return ioSession .isOpen ();
101
+ final IOSession ioSession = this .ioSession ;
102
+ if (ioSession .isOpen ()) {
103
+ final IOEventHandler handler = ioSession .getHandler ();
104
+ if (handler instanceof HttpConnection ) {
105
+ final HttpConnection conn = (HttpConnection ) handler ;
106
+ final ProtocolVersion protocolVersion = conn .getProtocolVersion ();
107
+ if (protocolVersion != null && protocolVersion .greaterEquals (HttpVersion .HTTP_2 )) {
108
+ return conn .isOpen ();
109
+ }
110
+ }
111
+ return true ;
112
+ } else {
113
+ return false ;
114
+ }
102
115
}
103
116
104
117
@ Override
You can’t perform that action at this time.
0 commit comments