PoolingAsyncClientConnectionManager incorrectly emits Ping commands to HTTP/1.1 endpoints #255

This commit is contained in:
滕杰1 2020-09-14 20:12:41 +08:00 committed by Oleg Kalnichevski
parent 848abe93a7
commit 20266db737
1 changed files with 1 additions and 1 deletions

View File

@ -247,7 +247,7 @@ public class PoolingAsyncClientConnectionManager implements AsyncClientConnectio
if (TimeValue.isNonNegative(timeValue) && connection != null &&
poolEntry.getUpdated() + timeValue.toMilliseconds() <= System.currentTimeMillis()) {
final ProtocolVersion protocolVersion = connection.getProtocolVersion();
if (HttpVersion.HTTP_2_0.greaterEquals(protocolVersion)) {
if (protocolVersion != null && protocolVersion.greaterEquals(HttpVersion.HTTP_2_0)) {
connection.submitCommand(new PingCommand(new BasicPingHandler(new Callback<Boolean>() {
@Override