hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rola...@apache.org
Subject svn commit: r509294 - in /jakarta/httpcomponents/httpclient/trunk/src: examples/org/apache/http/examples/conn/ java/org/apache/http/conn/ java/org/apache/http/impl/conn/
Date Mon, 19 Feb 2007 18:42:09 GMT
Author: rolandw
Date: Mon Feb 19 10:42:08 2007
New Revision: 509294

URL: http://svn.apache.org/viewvc?view=rev&rev=509294
Log:
support for local address in operator

Modified:
    jakarta/httpcomponents/httpclient/trunk/src/examples/org/apache/http/examples/conn/OperatorConnectDirect.java
    jakarta/httpcomponents/httpclient/trunk/src/examples/org/apache/http/examples/conn/OperatorConnectProxy.java
    jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/conn/ClientConnectionOperator.java
    jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/impl/conn/DefaultClientConnectionOperator.java
    jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/impl/conn/ThreadSafeClientConnManager.java

Modified: jakarta/httpcomponents/httpclient/trunk/src/examples/org/apache/http/examples/conn/OperatorConnectDirect.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/src/examples/org/apache/http/examples/conn/OperatorConnectDirect.java?view=diff&rev=509294&r1=509293&r2=509294
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/src/examples/org/apache/http/examples/conn/OperatorConnectDirect.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/src/examples/org/apache/http/examples/conn/OperatorConnectDirect.java
Mon Feb 19 10:42:08 2007
@@ -104,7 +104,7 @@
         HttpContext ctx = createContext();
 
         System.out.println("opening connection to " + target);
-        scop.openConnection(conn, target, ctx, getParams());
+        scop.openConnection(conn, target, null, ctx, getParams());
 
         System.out.println("sending request");
         conn.sendRequestHeader(req);

Modified: jakarta/httpcomponents/httpclient/trunk/src/examples/org/apache/http/examples/conn/OperatorConnectProxy.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/src/examples/org/apache/http/examples/conn/OperatorConnectProxy.java?view=diff&rev=509294&r1=509293&r2=509294
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/src/examples/org/apache/http/examples/conn/OperatorConnectProxy.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/src/examples/org/apache/http/examples/conn/OperatorConnectProxy.java
Mon Feb 19 10:42:08 2007
@@ -109,7 +109,7 @@
         HttpContext ctx = createContext();
 
         System.out.println("opening connection to " + proxy);
-        scop.openConnection(conn, proxy, ctx, getParams());
+        scop.openConnection(conn, proxy, null, ctx, getParams());
 
         HttpRequest connect = createConnect(target);
         System.out.println("opening tunnel to " + target);

Modified: jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/conn/ClientConnectionOperator.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/conn/ClientConnectionOperator.java?view=diff&rev=509294&r1=509293&r2=509294
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/conn/ClientConnectionOperator.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/conn/ClientConnectionOperator.java
Mon Feb 19 10:42:08 2007
@@ -32,6 +32,7 @@
 package org.apache.http.conn;
 
 import java.io.IOException;
+import java.net.InetAddress;
 
 import org.apache.http.HttpHost;
 import org.apache.http.params.HttpParams;
@@ -75,6 +76,8 @@
      *
      * @param conn      the connection to open
      * @param target    the target host to connect to
+     * @param local     the local address to route from, or
+     *                  <code>null</code> for the default
      * @param context   the context for the connection
      * @param params    the parameters for the connection
      *
@@ -82,6 +85,7 @@
      */
     void openConnection(OperatedClientConnection conn,
                         HttpHost target,
+                        InetAddress local,
                         HttpContext context,
                         HttpParams params)
         throws IOException

Modified: jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/impl/conn/DefaultClientConnectionOperator.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/impl/conn/DefaultClientConnectionOperator.java?view=diff&rev=509294&r1=509293&r2=509294
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/impl/conn/DefaultClientConnectionOperator.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/impl/conn/DefaultClientConnectionOperator.java
Mon Feb 19 10:42:08 2007
@@ -99,6 +99,7 @@
     // non-javadoc, see interface ClientConnectionOperator
     public void openConnection(OperatedClientConnection conn,
                                HttpHost target,
+                               InetAddress local,
                                HttpContext context,
                                HttpParams params)
         throws IOException {
@@ -111,6 +112,7 @@
             throw new IllegalArgumentException
                 ("Target host must not be null.");
         }
+        // local address may be null
         //@@@ is context allowed to be null?
         if (params == null) {
             throw new IllegalArgumentException
@@ -120,9 +122,6 @@
             throw new IllegalArgumentException
                 ("Connection must not be open.");
         }
-
-        InetAddress local = null;
-        //@@@ TODO: deal with local address stuff (from context?)
 
         final Scheme schm = schemeRegistry.getScheme(target.getSchemeName());
         if (schm == null) {

Modified: jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/impl/conn/ThreadSafeClientConnManager.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/impl/conn/ThreadSafeClientConnManager.java?view=diff&rev=509294&r1=509293&r2=509294
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/impl/conn/ThreadSafeClientConnManager.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/impl/conn/ThreadSafeClientConnManager.java
Mon Feb 19 10:42:08 2007
@@ -1183,6 +1183,7 @@
             ThreadSafeClientConnManager.this.connOperator.openConnection
                 (this.connection,
                  (proxy != null) ? proxy : route.getTargetHost(),
+                 route.getLocalAddress(),
                  context, params);
 
             if (proxy == null)



Mime
View raw message