You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2020/09/15 08:35:13 UTC
[httpcomponents-client] branch master updated: protocol version
judge
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
The following commit(s) were added to refs/heads/master by this push:
new 37ed853 protocol version judge
37ed853 is described below
commit 37ed853cec086f0b8cf1ab083af628140ef865ce
Author: 滕杰1 <te...@xdf.cn>
AuthorDate: Mon Sep 14 20:12:41 2020 +0800
protocol version judge
---
.../hc/client5/http/impl/nio/PoolingAsyncClientConnectionManager.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConnectionManager.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConnectionManager.java
index 974df99..a6c6daf 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConnectionManager.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConnectionManager.java
@@ -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