"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/BasicHttpClientConnectionManager.java" between
httpcomponents-client-5.2-src.tar.gz and httpcomponents-client-5.2.1-src.tar.gz

About: Apache HttpComponents Client provides reusable components for client-side authentication, HTTP state management, and HTTP connection management. Java sources.

BasicHttpClientConnectionManager.java  (httpcomponents-client-5.2-src):BasicHttpClientConnectionManager.java  (httpcomponents-client-5.2.1-src)
skipping to change at line 32 skipping to change at line 32
* individuals on behalf of the Apache Software Foundation. For more * individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see * information on the Apache Software Foundation, please see
* <http://www.apache.org/>. * <http://www.apache.org/>.
* *
*/ */
package org.apache.hc.client5.http.impl.io; package org.apache.hc.client5.http.impl.io;
import java.io.IOException; import java.io.IOException;
import java.time.Instant; import java.time.Instant;
import java.util.Objects;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException; import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import org.apache.hc.client5.http.DnsResolver; import org.apache.hc.client5.http.DnsResolver;
import org.apache.hc.client5.http.HttpRoute; import org.apache.hc.client5.http.HttpRoute;
import org.apache.hc.client5.http.SchemePortResolver; import org.apache.hc.client5.http.SchemePortResolver;
import org.apache.hc.client5.http.config.ConnectionConfig; import org.apache.hc.client5.http.config.ConnectionConfig;
skipping to change at line 71 skipping to change at line 72
import org.apache.hc.core5.http.config.Registry; import org.apache.hc.core5.http.config.Registry;
import org.apache.hc.core5.http.config.RegistryBuilder; import org.apache.hc.core5.http.config.RegistryBuilder;
import org.apache.hc.core5.http.impl.io.HttpRequestExecutor; import org.apache.hc.core5.http.impl.io.HttpRequestExecutor;
import org.apache.hc.core5.http.io.HttpConnectionFactory; import org.apache.hc.core5.http.io.HttpConnectionFactory;
import org.apache.hc.core5.http.io.SocketConfig; import org.apache.hc.core5.http.io.SocketConfig;
import org.apache.hc.core5.http.protocol.HttpContext; import org.apache.hc.core5.http.protocol.HttpContext;
import org.apache.hc.core5.io.CloseMode; import org.apache.hc.core5.io.CloseMode;
import org.apache.hc.core5.util.Args; import org.apache.hc.core5.util.Args;
import org.apache.hc.core5.util.Asserts; import org.apache.hc.core5.util.Asserts;
import org.apache.hc.core5.util.Deadline; import org.apache.hc.core5.util.Deadline;
import org.apache.hc.core5.util.LangUtils;
import org.apache.hc.core5.util.TimeValue; import org.apache.hc.core5.util.TimeValue;
import org.apache.hc.core5.util.Timeout; import org.apache.hc.core5.util.Timeout;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/** /**
* A connection manager for a single connection. This connection manager maintai ns only one active * A connection manager for a single connection. This connection manager maintai ns only one active
* connection. Even though this class is fully thread-safe it ought to be used b y one execution * connection. Even though this class is fully thread-safe it ought to be used b y one execution
* thread only, as only one thread a time can lease the connection at a time. * thread only, as only one thread a time can lease the connection at a time.
* <p> * <p>
skipping to change at line 307 skipping to change at line 307
} }
} }
} }
synchronized ManagedHttpClientConnection getConnection(final HttpRoute route , final Object state) throws IOException { synchronized ManagedHttpClientConnection getConnection(final HttpRoute route , final Object state) throws IOException {
Asserts.check(!isClosed(), "Connection manager has been shut down"); Asserts.check(!isClosed(), "Connection manager has been shut down");
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("{} Get connection for route {}", id, route); LOG.debug("{} Get connection for route {}", id, route);
} }
Asserts.check(!this.leased, "Connection %s is still allocated", conn); Asserts.check(!this.leased, "Connection %s is still allocated", conn);
if (!LangUtils.equals(this.route, route) || !LangUtils.equals(this.state , state)) { if (!Objects.equals(this.route, route) || !Objects.equals(this.state, st ate)) {
closeConnection(CloseMode.GRACEFUL); closeConnection(CloseMode.GRACEFUL);
} }
this.route = route; this.route = route;
this.state = state; this.state = state;
checkExpiry(); checkExpiry();
validate(); validate();
if (this.conn == null) { if (this.conn == null) {
this.conn = this.connFactory.createConnection(null); this.conn = this.connFactory.createConnection(null);
this.created = System.currentTimeMillis(); this.created = System.currentTimeMillis();
} else { } else {
 End of changes. 3 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)