hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r563548 - in /jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http: cookie/ impl/conn/tsccm/ impl/cookie/
Date Tue, 07 Aug 2007 16:42:19 GMT
Author: olegk
Date: Tue Aug  7 09:42:09 2007
New Revision: 563548

URL: http://svn.apache.org/viewvc?view=rev&rev=563548
Log:
Moved attributes used only by strict specs when formatting cookies to SetCookie interface

Modified:
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SetCookie.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/RFC2109Spec.java

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java?view=diff&rev=563548&r1=563547&r2=563548
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java
Tue Aug  7 09:42:09 2007
@@ -123,23 +123,5 @@
      */
     boolean isExpired(final Date date);
 
-    /**
-     * Returns <tt>true</tt> if cookie's path was set via a path attribute
-     * in the <tt>Set-Cookie</tt> header.
-     *
-     * @return value <tt>true</tt> if the cookie's path was explicitly 
-     * set, <tt>false</tt> otherwise.
-     */
-    boolean isPathAttributeSpecified();
-
-    /**
-     * Returns <tt>true</tt> if cookie's domain was set via a domain 
-     * attribute in the <tt>Set-Cookie</tt> header.
-     *
-     * @return value <tt>true</tt> if the cookie's domain was explicitly 
-     * set, <tt>false</tt> otherwise.
-     */
-    boolean isDomainAttributeSpecified();
-
 }
 

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SetCookie.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SetCookie.java?view=diff&rev=563548&r1=563547&r2=563548
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SetCookie.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SetCookie.java
Tue Aug  7 09:42:09 2007
@@ -110,6 +110,15 @@
     void setVersion(int version);
 
     /**
+     * Returns <tt>true</tt> if cookie's path was set via a path attribute
+     * in the <tt>Set-Cookie</tt> header.
+     *
+     * @return value <tt>true</tt> if the cookie's path was explicitly 
+     * set, <tt>false</tt> otherwise.
+     */
+    boolean isPathAttributeSpecified();
+
+    /**
      * Indicates whether the cookie had a path specified in a 
      * path attribute of the <tt>Set-Cookie</tt> header. This value
      * is important for generating the <tt>Cookie</tt> header because 
@@ -123,6 +132,15 @@
      * @see #isPathAttributeSpecified
      */
     public void setPathAttributeSpecified(boolean value);
+
+    /**
+     * Returns <tt>true</tt> if cookie's domain was set via a domain 
+     * attribute in the <tt>Set-Cookie</tt> header.
+     *
+     * @return value <tt>true</tt> if the cookie's domain was explicitly 
+     * set, <tt>false</tt> otherwise.
+     */
+    boolean isDomainAttributeSpecified();
 
     /**
      * Indicates whether the cookie had a domain specified in a 

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java?view=diff&rev=563548&r1=563547&r2=563548
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java
Tue Aug  7 09:42:09 2007
@@ -30,15 +30,9 @@
 
 package org.apache.http.impl.conn.tsccm;
 
-import java.util.Iterator;
 import java.util.LinkedList;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.http.conn.HttpRoute;
-//@@@ create entry w/o operator, set operator afterwards
-import org.apache.http.conn.ClientConnectionOperator; //@@@
-
 
 /**
  * A connection sub-pool for a specific route, used by {@link ConnPoolByRoute}.

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java?view=diff&rev=563548&r1=563547&r2=563548
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
Tue Aug  7 09:42:09 2007
@@ -41,7 +41,6 @@
 import org.apache.http.conn.ManagedClientConnection;
 import org.apache.http.conn.OperatedClientConnection;
 import org.apache.http.conn.SchemeRegistry;
-import org.apache.http.conn.params.HttpConnectionManagerParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.impl.conn.DefaultClientConnectionOperator;
 

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/RFC2109Spec.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/RFC2109Spec.java?view=diff&rev=563548&r1=563547&r2=563548
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/RFC2109Spec.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/RFC2109Spec.java
Tue Aug  7 09:42:09 2007
@@ -40,6 +40,7 @@
 import org.apache.http.cookie.CookiePathComparator;
 import org.apache.http.cookie.MalformedCookieException;
 import org.apache.http.cookie.SM;
+import org.apache.http.cookie.SetCookie;
 import org.apache.http.message.BufferedHeader;
 import org.apache.http.util.CharArrayBuffer;
 
@@ -208,13 +209,17 @@
     private void formatCookieAsVer(final CharArrayBuffer buffer, 
             final Cookie cookie, int version) {
         formatParamAsVer(buffer, cookie.getName(), cookie.getValue(), version);
-        if (cookie.getPath() != null && cookie.isPathAttributeSpecified()) {
-            buffer.append("; ");
-            formatParamAsVer(buffer, "$Path", cookie.getPath(), version);
+        if (cookie.getPath() != null) {
+            if (cookie instanceof SetCookie && ((SetCookie) cookie).isPathAttributeSpecified())
{
+                buffer.append("; ");
+                formatParamAsVer(buffer, "$Path", cookie.getPath(), version);
+            }
         }
-        if (cookie.getDomain() != null && cookie.isDomainAttributeSpecified()) {
-            buffer.append("; ");
-            formatParamAsVer(buffer, "$Domain", cookie.getDomain(), version);
+        if (cookie.getDomain() != null) {
+            if (cookie instanceof SetCookie && ((SetCookie) cookie).isDomainAttributeSpecified())
{
+                buffer.append("; ");
+                formatParamAsVer(buffer, "$Domain", cookie.getDomain(), version);
+            }
         }
     }
     



Mime
View raw message