"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncRedirectExec.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.

AsyncRedirectExec.java  (httpcomponents-client-5.2-src):AsyncRedirectExec.java  (httpcomponents-client-5.2.1-src)
skipping to change at line 31 skipping to change at line 31
* This software consists of voluntary contributions made by many * This software consists of voluntary contributions made by many
* 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.async; package org.apache.hc.client5.http.impl.async;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.net.URI;
import java.util.Objects;
import org.apache.hc.client5.http.CircularRedirectException; import org.apache.hc.client5.http.CircularRedirectException;
import org.apache.hc.client5.http.HttpRoute; import org.apache.hc.client5.http.HttpRoute;
import org.apache.hc.client5.http.RedirectException; import org.apache.hc.client5.http.RedirectException;
import org.apache.hc.client5.http.async.AsyncExecCallback; import org.apache.hc.client5.http.async.AsyncExecCallback;
import org.apache.hc.client5.http.async.AsyncExecChain; import org.apache.hc.client5.http.async.AsyncExecChain;
import org.apache.hc.client5.http.async.AsyncExecChainHandler; import org.apache.hc.client5.http.async.AsyncExecChainHandler;
import org.apache.hc.client5.http.auth.AuthExchange; import org.apache.hc.client5.http.auth.AuthExchange;
import org.apache.hc.client5.http.config.RequestConfig; import org.apache.hc.client5.http.config.RequestConfig;
import org.apache.hc.client5.http.protocol.HttpClientContext; import org.apache.hc.client5.http.protocol.HttpClientContext;
skipping to change at line 59 skipping to change at line 60
import org.apache.hc.core5.http.HttpException; import org.apache.hc.core5.http.HttpException;
import org.apache.hc.core5.http.HttpHost; import org.apache.hc.core5.http.HttpHost;
import org.apache.hc.core5.http.HttpRequest; import org.apache.hc.core5.http.HttpRequest;
import org.apache.hc.core5.http.HttpResponse; import org.apache.hc.core5.http.HttpResponse;
import org.apache.hc.core5.http.HttpStatus; import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.Method; import org.apache.hc.core5.http.Method;
import org.apache.hc.core5.http.ProtocolException; import org.apache.hc.core5.http.ProtocolException;
import org.apache.hc.core5.http.nio.AsyncDataConsumer; import org.apache.hc.core5.http.nio.AsyncDataConsumer;
import org.apache.hc.core5.http.nio.AsyncEntityProducer; import org.apache.hc.core5.http.nio.AsyncEntityProducer;
import org.apache.hc.core5.http.support.BasicRequestBuilder; import org.apache.hc.core5.http.support.BasicRequestBuilder;
import org.apache.hc.core5.util.LangUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/** /**
* Request execution handler in the asynchronous request execution chain * Request execution handler in the asynchronous request execution chain
* responsible for handling of request redirects. * responsible for handling of request redirects.
* <p> * <p>
* Further responsibilities such as communication with the opposite * Further responsibilities such as communication with the opposite
* endpoint is delegated to the next executor in the request execution * endpoint is delegated to the next executor in the request execution
* chain. * chain.
skipping to change at line 172 skipping to change at line 172
} }
break; break;
default: default:
redirectBuilder = BasicRequestBuilder.copy(scope.ori ginalRequest); redirectBuilder = BasicRequestBuilder.copy(scope.ori ginalRequest);
} }
redirectBuilder.setUri(redirectUri); redirectBuilder.setUri(redirectUri);
state.reroute = false; state.reroute = false;
state.redirectURI = redirectUri; state.redirectURI = redirectUri;
state.currentRequest = redirectBuilder.build(); state.currentRequest = redirectBuilder.build();
if (!LangUtils.equals(currentRoute.getTargetHost(), newTarge t)) { if (!Objects.equals(currentRoute.getTargetHost(), newTarget) ) {
final HttpRoute newRoute = routePlanner.determineRoute(n ewTarget, clientContext); final HttpRoute newRoute = routePlanner.determineRoute(n ewTarget, clientContext);
if (!LangUtils.equals(currentRoute, newRoute)) { if (!Objects.equals(currentRoute, newRoute)) {
state.reroute = true; state.reroute = true;
final AuthExchange targetAuthExchange = clientContex t.getAuthExchange(currentRoute.getTargetHost()); final AuthExchange targetAuthExchange = clientContex t.getAuthExchange(currentRoute.getTargetHost());
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("{} resetting target auth state", exch angeId); LOG.debug("{} resetting target auth state", exch angeId);
} }
targetAuthExchange.reset(); targetAuthExchange.reset();
if (currentRoute.getProxyHost() != null) { if (currentRoute.getProxyHost() != null) {
final AuthExchange proxyAuthExchange = clientCon text.getAuthExchange(currentRoute.getProxyHost()); final AuthExchange proxyAuthExchange = clientCon text.getAuthExchange(currentRoute.getProxyHost());
if (proxyAuthExchange.isConnectionBased()) { if (proxyAuthExchange.isConnectionBased()) {
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
 End of changes. 4 change blocks. 
3 lines changed or deleted 3 lines changed or added

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