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 2019/11/22 21:36:18 UTC

[httpcomponents-client] branch master updated: HTTPCLIENT-2028: Now allowing 0 for validateAfterInactivity

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 72af7cf  HTTPCLIENT-2028: Now allowing 0 for validateAfterInactivity
72af7cf is described below

commit 72af7cf5a55041b61f52d9304d5f709be2cf471e
Author: Peter Frank <pf...@fandango.com>
AuthorDate: Fri Nov 22 11:28:35 2019 -0800

    HTTPCLIENT-2028: Now allowing 0 for validateAfterInactivity
    
    The purpose of this change is to allow stale checking all the time, in previous versions of HttpClient this was accomplished by staleConnectionCheckEnabled=true which is now removed, this adds that idea back
---
 .../hc/client5/http/impl/io/PoolingHttpClientConnectionManager.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManager.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManager.java
index f43af52..52e7719 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManager.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManager.java
@@ -287,7 +287,7 @@ public class PoolingHttpClientConnectionManager
                     log.debug(id + ": endpoint leased " + ConnPoolSupport.formatStats(route, state, pool));
                 }
                 try {
-                    if (TimeValue.isPositive(validateAfterInactivity)) {
+                    if (TimeValue.isNonNegative(validateAfterInactivity)) {
                         final ManagedHttpClientConnection conn = poolEntry.getConnection();
                         if (conn != null
                                 && poolEntry.getUpdated() + validateAfterInactivity.toMillis() <= System.currentTimeMillis()) {