HttpRoutePlanner uses RouteInfo
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@620255 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2c2dd57f72
commit
a955029035
|
@ -61,7 +61,7 @@ public class BasicRouteDirector implements HttpRouteDirector {
|
||||||
* either the next step to perform, or success, or failure.
|
* either the next step to perform, or success, or failure.
|
||||||
* 0 is for success, a negative value for failure.
|
* 0 is for success, a negative value for failure.
|
||||||
*/
|
*/
|
||||||
public int nextStep(HttpRoute plan, HttpRoute fact) {
|
public int nextStep(RouteInfo plan, RouteInfo fact) {
|
||||||
if (plan == null) {
|
if (plan == null) {
|
||||||
throw new IllegalArgumentException
|
throw new IllegalArgumentException
|
||||||
("Planned route may not be null.");
|
("Planned route may not be null.");
|
||||||
|
@ -69,7 +69,7 @@ public class BasicRouteDirector implements HttpRouteDirector {
|
||||||
|
|
||||||
int step = UNREACHABLE;
|
int step = UNREACHABLE;
|
||||||
|
|
||||||
if (fact == null)
|
if ((fact == null) || (fact.getHopCount() < 1))
|
||||||
step = firstStep(plan);
|
step = firstStep(plan);
|
||||||
else if (plan.getHopCount() > 1)
|
else if (plan.getHopCount() > 1)
|
||||||
step = proxiedStep(plan, fact);
|
step = proxiedStep(plan, fact);
|
||||||
|
@ -88,7 +88,7 @@ public class BasicRouteDirector implements HttpRouteDirector {
|
||||||
*
|
*
|
||||||
* @return the first step
|
* @return the first step
|
||||||
*/
|
*/
|
||||||
protected int firstStep(HttpRoute plan) {
|
protected int firstStep(RouteInfo plan) {
|
||||||
|
|
||||||
return (plan.getHopCount() > 1) ?
|
return (plan.getHopCount() > 1) ?
|
||||||
CONNECT_PROXY : CONNECT_TARGET;
|
CONNECT_PROXY : CONNECT_TARGET;
|
||||||
|
@ -104,7 +104,7 @@ public class BasicRouteDirector implements HttpRouteDirector {
|
||||||
* @return one of the constants defined in this class, indicating
|
* @return one of the constants defined in this class, indicating
|
||||||
* either the next step to perform, or success, or failure
|
* either the next step to perform, or success, or failure
|
||||||
*/
|
*/
|
||||||
protected int directStep(HttpRoute plan, HttpRoute fact) {
|
protected int directStep(RouteInfo plan, RouteInfo fact) {
|
||||||
|
|
||||||
if (fact.getHopCount() > 1)
|
if (fact.getHopCount() > 1)
|
||||||
return UNREACHABLE;
|
return UNREACHABLE;
|
||||||
|
@ -139,7 +139,7 @@ public class BasicRouteDirector implements HttpRouteDirector {
|
||||||
* @return one of the constants defined in this class, indicating
|
* @return one of the constants defined in this class, indicating
|
||||||
* either the next step to perform, or success, or failure
|
* either the next step to perform, or success, or failure
|
||||||
*/
|
*/
|
||||||
protected int proxiedStep(HttpRoute plan, HttpRoute fact) {
|
protected int proxiedStep(RouteInfo plan, RouteInfo fact) {
|
||||||
|
|
||||||
if (fact.getHopCount() <= 1)
|
if (fact.getHopCount() <= 1)
|
||||||
return UNREACHABLE;
|
return UNREACHABLE;
|
||||||
|
|
|
@ -81,7 +81,7 @@ public interface HttpRouteDirector {
|
||||||
* either the next step to perform, or success, or failure.
|
* either the next step to perform, or success, or failure.
|
||||||
* 0 is for success, a negative value for failure.
|
* 0 is for success, a negative value for failure.
|
||||||
*/
|
*/
|
||||||
public int nextStep(HttpRoute plan, HttpRoute fact)
|
public int nextStep(RouteInfo plan, RouteInfo fact)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue