hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rola...@apache.org
Subject svn commit: r620255 - in /httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing: BasicRouteDirector.java HttpRouteDirector.java
Date Sun, 10 Feb 2008 10:23:57 GMT
Author: rolandw
Date: Sun Feb 10 02:23:55 2008
New Revision: 620255

URL: http://svn.apache.org/viewvc?rev=620255&view=rev
Log:
HttpRoutePlanner uses RouteInfo

Modified:
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/BasicRouteDirector.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/HttpRouteDirector.java

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/BasicRouteDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/BasicRouteDirector.java?rev=620255&r1=620254&r2=620255&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/BasicRouteDirector.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/BasicRouteDirector.java
Sun Feb 10 02:23:55 2008
@@ -61,7 +61,7 @@
      *          either the next step to perform, or success, or 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) {
             throw new IllegalArgumentException
                 ("Planned route may not be null.");
@@ -69,7 +69,7 @@
 
         int step = UNREACHABLE;
 
-        if (fact == null)
+        if ((fact == null) || (fact.getHopCount() < 1))
             step = firstStep(plan);
         else if (plan.getHopCount() > 1)
             step = proxiedStep(plan, fact);
@@ -88,7 +88,7 @@
      *
      * @return  the first step
      */
-    protected int firstStep(HttpRoute plan) {
+    protected int firstStep(RouteInfo plan) {
 
         return (plan.getHopCount() > 1) ?
             CONNECT_PROXY : CONNECT_TARGET;
@@ -104,7 +104,7 @@
      * @return  one of the constants defined in this class, indicating
      *          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)
             return UNREACHABLE;
@@ -139,7 +139,7 @@
      * @return  one of the constants defined in this class, indicating
      *          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)
             return UNREACHABLE;

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/HttpRouteDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/HttpRouteDirector.java?rev=620255&r1=620254&r2=620255&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/HttpRouteDirector.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/routing/HttpRouteDirector.java
Sun Feb 10 02:23:55 2008
@@ -81,7 +81,7 @@
      *          either the next step to perform, or success, or failure.
      *          0 is for success, a negative value for failure.
      */
-    public int nextStep(HttpRoute plan, HttpRoute fact)
+    public int nextStep(RouteInfo plan, RouteInfo fact)
         ;
 
 



Mime
View raw message