hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1599971 - /httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java
Date Wed, 04 Jun 2014 08:16:14 GMT
Author: olegk
Date: Wed Jun  4 08:16:14 2014
New Revision: 1599971

URL: http://svn.apache.org/r1599971
Log:
Post HTTPCLIENT-1504 code improvement (suggested by Sebb)

Modified:
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java?rev=1599971&r1=1599970&r2=1599971&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java
Wed Jun  4 08:16:14 2014
@@ -234,15 +234,16 @@ public abstract class AbstractConnPool<T
                     if (entry == null) {
                         break;
                     }
-                    if (this.validateAfterInactivity > 0) {
+                    if (entry.isExpired(System.currentTimeMillis())) {
+                        entry.close();
+                    } else if (this.validateAfterInactivity > 0) {
                         if (entry.getUpdated() + this.validateAfterInactivity <= System.currentTimeMillis())
{
                             if (!validate(entry)) {
                                 entry.close();
                             }
                         }
                     }
-                    if (entry.isClosed() || entry.isExpired(System.currentTimeMillis()))
{
-                        entry.close();
+                    if (entry.isClosed()) {
                         this.available.remove(entry);
                         pool.free(entry, false);
                     } else {



Mime
View raw message