hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1055406 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java
Date Wed, 05 Jan 2011 10:54:20 GMT
Author: olegk
Date: Wed Jan  5 10:54:20 2011
New Revision: 1055406

URL: http://svn.apache.org/viewvc?rev=1055406&view=rev
Log:
Always use remote port of the underyling connection as default when creating CookieOrigin
instance

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java?rev=1055406&r1=1055405&r2=1055406&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java
Wed Jan  5 10:54:20 2011
@@ -48,8 +48,6 @@ import org.apache.http.client.CookieStor
 import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.client.params.HttpClientParams;
 import org.apache.http.conn.ManagedClientConnection;
-import org.apache.http.conn.scheme.Scheme;
-import org.apache.http.conn.scheme.SchemeRegistry;
 import org.apache.http.cookie.Cookie;
 import org.apache.http.cookie.CookieOrigin;
 import org.apache.http.cookie.CookieSpec;
@@ -146,16 +144,7 @@ public class RequestAddCookies implement
         String hostName = targetHost.getHostName();
         int port = targetHost.getPort();
         if (port < 0) {
-
-            // Obtain the scheme registry
-            SchemeRegistry sr = (SchemeRegistry) context.getAttribute(
-                    ClientContext.SCHEME_REGISTRY);
-            if (sr != null) {
-                Scheme scheme = sr.get(targetHost.getSchemeName());
-                port = scheme.resolvePort(port);
-            } else {
-                port = conn.getRemotePort();
-            }
+            port = conn.getRemotePort();
         }
 
         CookieOrigin cookieOrigin = new CookieOrigin(



Mime
View raw message