svn commit: r531354 - in /jakarta/commons/proper/httpclient/trunk: release_notes.txt src/java/org/apache/commons/httpclient/Cookie.java

2007-04-23 Thread olegk
Author: olegk
Date: Sun Apr 22 23:53:20 2007
New Revision: 531354

URL: http://svn.apache.org/viewvc?view=revrev=531354
Log:
HTTPCLIENT-645: Cookie#compare() changed to do a simple case-sensitive string 
comparison when comparing path attributes instead of using a static instance of 
RuleBasedCollator

Contributed by Oleg Kalnichevski
Reviewed by Roland Weber

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/Cookie.java

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?view=diffrev=531354r1=531353r2=531354
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Sun Apr 22 
23:53:20 2007
@@ -1,3 +1,9 @@
+Changes since 3.1 RC 1
+
+* [HTTPCLIENT-645] - Cookie#compare() changed to do a simple case-sensitive 
string comparison 
+   when comparing path attributes instead of using a static instance 
of RuleBasedCollator
+   Contributed by Oleg Kalnichevski olegk at apache.org
+
 Release 3.1 RC 1
 ---
 New features:

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/Cookie.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/Cookie.java?view=diffrev=531354r1=531353r2=531354
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/Cookie.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/Cookie.java
 Sun Apr 22 23:53:20 2007
@@ -31,10 +31,8 @@
 package org.apache.commons.httpclient;
 
 import java.io.Serializable;
-import java.text.RuleBasedCollator;
 import java.util.Comparator;
 import java.util.Date;
-import java.util.Locale;
 
 import org.apache.commons.httpclient.cookie.CookiePolicy;
 import org.apache.commons.httpclient.cookie.CookieSpec;
@@ -482,7 +480,7 @@
 return 1;
 }
 } else {
-return STRING_COLLATOR.compare(c1.getPath(), c2.getPath());
+return c1.getPath().compareTo(c2.getPath());
 }
 }
 
@@ -530,14 +528,6 @@
private int cookieVersion = 0;
 
// -- Constants
-
-   /** 
-* Collator for Cookie comparisons.  Could be replaced with references to
-* specific Locales.
-*/
-   private static final RuleBasedCollator STRING_COLLATOR =
-(RuleBasedCollator) RuleBasedCollator.getInstance(
-new Locale(en, US, ));
 
/** Log object for this class */
private static final Log LOG = LogFactory.getLog(Cookie.class);



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r519128 - /jakarta/commons/proper/httpclient/tags/HTTPCLIENT_3_1_RC1/

2007-03-16 Thread olegk
Author: olegk
Date: Fri Mar 16 13:21:15 2007
New Revision: 519128

URL: http://svn.apache.org/viewvc?view=revrev=519128
Log:
HttpClient release 3.1-rc1

Added:
jakarta/commons/proper/httpclient/tags/HTTPCLIENT_3_1_RC1/
  - copied from r519127, jakarta/commons/proper/httpclient/trunk/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r518368 - /jakarta/commons/proper/httpclient/trunk/maven.xml

2007-03-14 Thread olegk
Author: olegk
Date: Wed Mar 14 15:55:50 2007
New Revision: 518368

URL: http://svn.apache.org/viewvc?view=revrev=518368
Log:
Include NOTICE file in the bin and src distributions

Modified:
jakarta/commons/proper/httpclient/trunk/maven.xml

Modified: jakarta/commons/proper/httpclient/trunk/maven.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/maven.xml?view=diffrev=518368r1=518367r2=518368
==
--- jakarta/commons/proper/httpclient/trunk/maven.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/maven.xml Wed Mar 14 15:55:50 2007
@@ -24,6 +24,7 @@
 /ant:copy
 
ant:copy file=release_notes.txt 
tofile=${maven.dist.bin.assembly.dir}/RELEASE_NOTES.txt /
+   ant:copy file=NOTICE.txt 
tofile=${maven.dist.bin.assembly.dir}/NOTICE.txt /
 
ant:fixcrlf srcdir=${maven.dist.bin.assembly.dir} eol=lf 
encoding=ISO-8859-1
includes=**/*.xml **/*.properties **/*.html **/*.css /
@@ -33,10 +34,11 @@
 
ant:copy file=LICENSE.txt 
tofile=${maven.dist.bin.assembly.dir}/LICENSE /
ant:copy file=README.txt tofile=${maven.dist.bin.assembly.dir}/README 
/
+   ant:copy file=NOTICE.txt tofile=${maven.dist.bin.assembly.dir}/NOTICE 
/
ant:copy file=release_notes.txt 
tofile=${maven.dist.bin.assembly.dir}/RELEASE_NOTES /
 
ant:fixcrlf srcdir=${maven.dist.bin.assembly.dir} eol=lf 
encoding=ISO-8859-1
-   includes=LICENSE README RELEASE_NOTES /
+   includes=LICENSE README NOTICE RELEASE_NOTES /
 
   /postGoal
 
@@ -61,6 +63,7 @@
 /ant:copy
 
ant:copy file=release_notes.txt 
tofile=${maven.dist.src.assembly.dir}/RELEASE_NOTES.txt /
+   ant:copy file=NOTICE.txt 
tofile=${maven.dist.src.assembly.dir}/NOTICE.txt /
 
ant:fixcrlf srcdir=${maven.dist.src.assembly.dir} javafiles=true 
eol=lf tab=remove tablength=4 encoding=ISO-8859-1
@@ -74,10 +77,11 @@
 
ant:copy file=LICENSE.txt 
tofile=${maven.dist.src.assembly.dir}/LICENSE /
ant:copy file=README.txt tofile=${maven.dist.src.assembly.dir}/README 
/
+   ant:copy file=NOTICE.txt tofile=${maven.dist.src.assembly.dir}/NOTICE 
/
ant:copy file=release_notes.txt 
tofile=${maven.dist.src.assembly.dir}/RELEASE_NOTES /
 
ant:fixcrlf srcdir=${maven.dist.src.assembly.dir} eol=lf 
encoding=ISO-8859-1
-   includes=LICENSE README RELEASE_NOTES /
+   includes=LICENSE README NOTICE RELEASE_NOTES /
 
   /postGoal
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r517699 - in /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl: HostConfigurationWithHostFactory.java HttpHostFactory.java

2007-03-13 Thread olegk
Author: olegk
Date: Tue Mar 13 06:55:56 2007
New Revision: 517699

URL: http://svn.apache.org/viewvc?view=revrev=517699
Log:
HTTPCLIENT-640: HostConfiguration that gets its Host from a factory. 

This is useful for integrating a specialized Protocol or SocketFactory; for 
example, a SecureSocketFactory that authenticates via SSL. Use 
HttpClient.setHostConfiguration to install a HostConfigurationWithHostFactory 
that contains the specialized HostFactory, Protocol or SocketFactory

Contributed by John Kristian jkristian at netflix.com

Added:

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java
   (with props)

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java
   (with props)

Added: 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java?view=autorev=517699
==
--- 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java
 (added)
+++ 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java
 Tue Mar 13 06:55:56 2007
@@ -0,0 +1,60 @@
+package org.apache.commons.httpclient.contrib.ssl;
+
+import org.apache.commons.httpclient.HostConfiguration;
+import org.apache.commons.httpclient.HttpURL;
+import org.apache.commons.httpclient.protocol.Protocol;
+
+/**
+ * A kind of HostConfiguration that gets its Host from a factory. This is 
useful
+ * for integrating a specialized Protocol or SocketFactory; for example, a
+ * SecureSocketFactory that authenticates via SSL. Use
+ * HttpClient.setHostConfiguration to install a 
HostConfigurationWithHostFactory
+ * that contains the specialized HostFactory, Protocol or SocketFactory.
+ * p
+ * An alternative is to use Protocol.registerProtocol to register a specialized
+ * Protocol. But that has drawbacks: it makes it hard to integrate modules 
(e.g.
+ * web applications in a servlet container) with different strategies, because
+ * they share the specialized Protocol (Protocol.PROTOCOLS is static). And it
+ * can't support different Protocols for different hosts or ports (since the
+ * host and port aren't parameters to Protocol.getProtocol).
+ * 
+ * @author John Kristian
+ */
+class HostConfigurationWithHostFactory extends HostConfiguration
+{
+public HostConfigurationWithHostFactory(HttpHostFactory factory)
+{
+this.factory = factory;
+}
+
+private HostConfigurationWithHostFactory(HostConfigurationWithHostFactory 
that)
+{
+super(that);
+this.factory = that.factory;
+}
+
+private final HttpHostFactory factory;
+
+public Object clone()
+{
+return new HostConfigurationWithHostFactory(this);
+}
+
+private static final String DEFAULT_SCHEME = new 
String(HttpURL.DEFAULT_SCHEME);
+
+public void setHost(String host)
+{
+setHost(host, Protocol.getProtocol(DEFAULT_SCHEME).getDefaultPort());
+}
+
+public void setHost(final String host, int port)
+{
+setHost(host, port, DEFAULT_SCHEME);
+}
+
+public synchronized void setHost(String host, int port, String scheme)
+{
+setHost(factory.getHost(this, scheme, host, port));
+}
+
+}

Propchange: 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java
--
svn:keywords = Date Author Id Revision HeadURL

Propchange: 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java
--
svn:mime-type = text/plain

Added: 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java?view=autorev=517699
==
--- 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java
 (added)
+++ 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java
 Tue Mar 13 06:55:56 2007
@@ -0,0 +1,58 @@
+package org.apache.commons.httpclient.contrib.ssl;
+
+import org.apache.commons.httpclient.HostConfiguration;
+import

svn commit: r517705 - in /jakarta/commons/proper/httpclient/trunk: build.xml project.xml release_notes.txt src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java

2007-03-13 Thread olegk
Author: olegk
Date: Tue Mar 13 07:27:03 2007
New Revision: 517705

URL: http://svn.apache.org/viewvc?view=revrev=517705
Log:
Changes for 3.1-rc1 release

Modified:
jakarta/commons/proper/httpclient/trunk/build.xml
jakarta/commons/proper/httpclient/trunk/project.xml
jakarta/commons/proper/httpclient/trunk/release_notes.txt

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java

Modified: jakarta/commons/proper/httpclient/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/build.xml?view=diffrev=517705r1=517704r2=517705
==
--- jakarta/commons/proper/httpclient/trunk/build.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/build.xml Tue Mar 13 07:27:03 2007
@@ -38,7 +38,7 @@
   property name=component.title value=HttpClient Library/
 
   !-- The current version number of this component --
-  property name=component.version   value=3.1-beta1/
+  property name=component.version   value=3.1-rc1/
 
 !-- == Properties: Source Directories  --
 

Modified: jakarta/commons/proper/httpclient/trunk/project.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/project.xml?view=diffrev=517705r1=517704r2=517705
==
--- jakarta/commons/proper/httpclient/trunk/project.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/project.xml Tue Mar 13 07:27:03 2007
@@ -7,7 +7,7 @@
   artifactIdcommons-httpclient/artifactId
   gumpRepositoryIdjakarta-commons-httpclient/gumpRepositoryId
   inceptionYear2001/inceptionYear
-  currentVersion3.1-beta1/currentVersion
+  currentVersion3.1-rc1/currentVersion
   packageorg.apache.commons.httpclient/package
 
   organization
@@ -33,6 +33,11 @@
 
urlhttp://svn.apache.org/repos/asf/jakarta/commons/proper/${pom.artifactId.substring(8)}/trunk/url
   /repository
   versions
+version
+  id3.1-rc1/id
+  name3.1-rc1/name
+  tagHTTPCLIENT_3_1_RC1/tag
+/version
 version
   id3.1-beta1/id
   name3.1-beta1/name

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?view=diffrev=517705r1=517704r2=517705
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Tue Mar 13 
07:27:03 2007
@@ -1,4 +1,13 @@
-Changes since Release 3.1 Beta 1:
+Release 3.1 RC 1
+---
+New features:
+---
+
+(1) HTTP state management
+ 
+ * RFC 2965 cookie specification support
+  
+---
 * [HTTPCLIENT-641] - Resource Leakage when loading keystore in 
AuthSSLProtocolSocketFactory.
Contributed by Hanson Char
 
@@ -31,38 +40,11 @@
 
 * [HTTPCLIENT-610] - Added for convenience 
HttpMethodBase.getResponseBodyAsString(int)
Contributed by Ortwin Glueck oglueck at apache.org
-   
-Release 3.1 Beta 1

-Changes since Release 3.1 Alpha 1:
-
-* [HTTPCLIENT-598] - Fixed ContentLengthInputStream#available()
-   Contributed by Igor Lubashev igorlord at yahoo.com
-
-* [HTTPCLIENT-597] - Improved handling of idle connections in the 
multithreaded HTTP connection 
-   manager. 
-   Contributed by Michael Becke mbecke at apache.org
-
-* [HTTPCLIENT-593] - Fixed problem with #equals() and #hashCode() methods in 
subclasses of 
-   DefaultProtocolSocketFactory and SSLProtocolSocketFactory
-   Contributed by Chris Audley chrisaudley at yahoo.com
-
-* [HTTPCLIENT-594] - HttpMethodBase#aborted variable was declared transient 
instead of volatile
-   by mistake.
-   Contributed by Oleg Kalnichevski olegk at apache.org
-
-Release 3.1 Alpha 1

-New features:

-
-(1) HTTP state management
- 
- * RFC 2965 cookie specification support
-   
 ---
 API changes since 3.0
-
+   
+Class added: 
+  public org.apache.commons.httpclient.HttpContentTooLargeException extends 
org.apache.commons.httpclient.HttpException
 Class added: 
   public org.apache.commons.httpclient.InvalidRedirectLocationException 
extends org.apache.commons.httpclient.RedirectException
 Class added: 
@@ -92,27 +74,60 @@
   new:
 deprecated: public ConnectMethod();
 
-Class changed: org.apache.commons.httpclient.HttpMethodBase
+Class changed: org.apache.commons.httpclient.ContentLengthInputStream
   Methods added:
-protected void 
processCookieHeaders(org.apache.commons.httpclient.cookie.CookieSpec, 
org.apache.commons.httpclient.Header[], 
org.apache.commons.httpclient.HttpState, 
org.apache.commons.httpclient.HttpConnection

svn commit: r517885 - in /jakarta/commons/proper/httpclient/trunk/xdocs: downloads.xml news.xml status.xml

2007-03-13 Thread olegk
Author: olegk
Date: Tue Mar 13 14:39:52 2007
New Revision: 517885

URL: http://svn.apache.org/viewvc?view=revrev=517885
Log:
Changes for 3.1-rc1 release

Modified:
jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml
jakarta/commons/proper/httpclient/trunk/xdocs/news.xml
jakarta/commons/proper/httpclient/trunk/xdocs/status.xml

Modified: jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml?view=diffrev=517885r1=517884r2=517885
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml Tue Mar 13 
14:39:52 2007
@@ -14,7 +14,7 @@
  The following releases are avilable for download:
/p
ul
- liCURRENT - 3.1-beta1 - 30 October 2006 - 
+ liCURRENT - 3.1-rc1 - 16 March 2007 - 
 a 
href=http://jakarta.apache.org/site/downloads/downloads_commons-httpclient.cgi;Download/a
 - a 
  
href=http://www.apache.org/dist/jakarta/commons/httpclient/RELEASE-NOTES.txt;
  Release notes/a/li
@@ -46,12 +46,12 @@
p
  If you are using Maven for your project, you can create a dependency 
in your
  project.xml with one of the following:/p
-pb3.1-beta1/b/p
+pb3.1-rc1/b/p
  source![CDATA[
 dependency
 groupIdcommons-httpclient/groupId
 artifactIdcommons-httpclient/artifactId
-version3.1-beta1/version
+version3.1-rc1/version
 urlhttp://jakarta.apache.org/commons/httpclient//url
 /dependency
  ]]/source

Modified: jakarta/commons/proper/httpclient/trunk/xdocs/news.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/xdocs/news.xml?view=diffrev=517885r1=517884r2=517885
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/news.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/news.xml Tue Mar 13 14:39:52 
2007
@@ -10,6 +10,13 @@
   /properties
 
   body
+section name=16 March 2007 - HttpClient 3.1-rc1 released
+p
+  HttpClient 3.1-rc1 has been released. This version fixes a 
number of issues
+  found since 3.1-beta1. This release is expected to be the last 
one before 
+  HttpClient 3.1 goes final.
+/p
+/section
 section name=30 October 2006 - HttpClient 3.1-beta1 released
 p
   HttpClient 3.1-beta1 has been released. This version finalizes 
the RFC 2965 cookie 

Modified: jakarta/commons/proper/httpclient/trunk/xdocs/status.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/xdocs/status.xml?view=diffrev=517885r1=517884r2=517885
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/status.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/status.xml Tue Mar 13 
14:39:52 2007
@@ -18,10 +18,8 @@
Cookie2 or port sensitive cookies) and a number of improvements to 
the 
HTTP connection management. HttpClient 3.1 is backward compatible 
with 
HttpClient 3.0/p
-
-pBug reports targeted for the next release can be found
- a 
href=http://issues.apache.org/jira/secure/IssueNavigator.jspa?requestId=12311032;here/a.
-   /p
+pHttpClient 3.1 is likely to be the last non-bug fixing release of 
the 
+   HttpClient 3.x code line/p
 /section
 
 section name=Release Info



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r507122 - /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java

2007-02-13 Thread olegk
Author: olegk
Date: Tue Feb 13 10:01:48 2007
New Revision: 507122

URL: http://svn.apache.org/viewvc?view=revrev=507122
Log:
HTTPCLIENT-630: Made readObject/writeObject methods private

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java?view=diffrev=507122r1=507121r2=507122
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
 Tue Feb 13 10:01:48 2007
@@ -3606,7 +3606,7 @@
  * @param oos the object-output stream
  * @throws IOException If an IO problem occurs.
  */
-protected void writeObject(ObjectOutputStream oos)
+private void writeObject(ObjectOutputStream oos)
 throws IOException {
 
 oos.defaultWriteObject();
@@ -3621,7 +3621,7 @@
  * input stream cannot be found.
  * @throws IOException If an IO problem occurs.
  */
-protected void readObject(ObjectInputStream ois)
+private void readObject(ObjectInputStream ois)
 throws ClassNotFoundException, IOException {
 
 ois.defaultReadObject();



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r507134 - in /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie: RFC2109Spec.java RFC2965Spec.java

2007-02-13 Thread olegk
Author: olegk
Date: Tue Feb 13 10:18:05 2007
New Revision: 507134

URL: http://svn.apache.org/viewvc?view=revrev=507134
Log:
HTTPCLIENT-631: RFC2109Spec#SET_COOKIE_KEY, RFC2965Spec#SET_COOKIE2_KEY static 
variables made final

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2109Spec.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2109Spec.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2109Spec.java?view=diffrev=507134r1=507133r2=507134
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2109Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2109Spec.java
 Tue Feb 13 10:18:05 2007
@@ -59,7 +59,7 @@
  * Cookie Response Header  name for cookies processed
  * by this spec.
  */
-public static String SET_COOKIE_KEY = set-cookie;
+public final static String SET_COOKIE_KEY = set-cookie;
 
 /** Default constructor */
 public RFC2109Spec() {

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?view=diffrev=507134r1=507133r2=507134
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 Tue Feb 13 10:18:05 2007
@@ -62,7 +62,7 @@
 * Cookie Response Header  name for cookies processed
 * by this spec.
 */
-public static String SET_COOKIE2_KEY = set-cookie2;
+public final static String SET_COOKIE2_KEY = set-cookie2;
 
 /**
 * used for formatting RFC 2956 style cookies



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r507149 - /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpHost.java

2007-02-13 Thread olegk
Author: olegk
Date: Tue Feb 13 10:34:15 2007
New Revision: 507149

URL: http://svn.apache.org/viewvc?view=revrev=507149
Log:
HTTPCLIENT-632: Removed superfluous null check

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpHost.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpHost.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpHost.java?view=diffrev=507149r1=507148r2=507149
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpHost.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpHost.java
 Tue Feb 13 10:34:15 2007
@@ -159,10 +159,8 @@
  */
 public String toURI() {
 StringBuffer buffer = new StringBuffer(50);
-if (this.protocol != null) {
-buffer.append(this.protocol.getScheme());
-buffer.append(://);
-}
+buffer.append(this.protocol.getScheme());
+buffer.append(://);
 buffer.append(this.hostname);
 if (this.port != this.protocol.getDefaultPort()) {
 buffer.append(':');



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r490153 - /jakarta/commons/proper/httpclient/trunk/project.xml

2006-12-25 Thread olegk
Author: olegk
Date: Mon Dec 25 08:49:29 2006
New Revision: 490153

URL: http://svn.apache.org/viewvc?view=revrev=490153
Log:
Updated dev list

Modified:
jakarta/commons/proper/httpclient/trunk/project.xml

Modified: jakarta/commons/proper/httpclient/trunk/project.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/project.xml?view=diffrev=490153r1=490152r2=490153
==
--- jakarta/commons/proper/httpclient/trunk/project.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/project.xml Mon Dec 25 08:49:29 2006
@@ -146,10 +146,10 @@
 
   mailingLists
 mailingList
-  nameHttpClient Developer List/name
-  subscribe[EMAIL PROTECTED]/subscribe
-  unsubscribe[EMAIL PROTECTED]/unsubscribe
-  
archivehttp://mail-archives.apache.org/mod_mbox/jakarta-httpclient-dev//archive
+  nameHttpComponents Developer List/name
+  subscribe[EMAIL PROTECTED]/subscribe
+  unsubscribe[EMAIL PROTECTED]/unsubscribe
+  
archivehttp://mail-archives.apache.org/mod_mbox/jakarta-httpcomponents-dev//archive
 /mailingList
 mailingList
   nameHttpClient User List/name



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r487802 - /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java

2006-12-16 Thread olegk
Author: olegk
Date: Sat Dec 16 06:14:16 2006
New Revision: 487802

URL: http://svn.apache.org/viewvc?view=revrev=487802
Log:
* Small tweaks to the original Odi's patch
* Added #getResponseBody(int) method for consistency

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java?view=diffrev=487802r1=487801r2=487802
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 Sat Dec 16 06:14:16 2006
@@ -34,9 +34,7 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.InputStreamReader;
 import java.io.InterruptedIOException;
-import java.io.Reader;
 import java.util.Collection;
 
 import org.apache.commons.httpclient.auth.AuthState;
@@ -699,6 +697,63 @@
 }
 
 /**
+ * Returns the response body of the HTTP method, if any, as an array of 
bytes.
+ * If response body is not available or cannot be read, returns 
ttnull/tt
+ * 
+ * Note: This will cause the entire response body to be buffered in 
memory. This method is
+ * safe if the content length of the response is unknown, because the 
amount of memory used
+ * is limited.p
+ * 
+ * If the response is large this method involves lots of array copying and 
many object 
+ * allocations, which makes it unsuitable for high-performance / 
low-footprint applications.
+ * Those applications should use [EMAIL PROTECTED] 
#getResponseBodyAsStream()}.
+ * 
+ * @param maxlen the maximum content length to accept (number of bytes). 
+ * @return The response body.
+ * 
+ * @throws IOException If an I/O (transport) problem occurs while 
obtaining the 
+ * response body.
+ */
+public byte[] getResponseBody(int maxlen) throws IOException {
+if (maxlen  0) throw new IllegalArgumentException(maxlen must be 
positive);
+if (this.responseBody == null) {
+InputStream instream = getResponseBodyAsStream();
+if (instream != null) {
+// we might already know that the content is larger
+long contentLength = getResponseContentLength();
+if ((contentLength != -1)  (contentLength  maxlen)) {
+throw new HttpContentTooLargeException(
+Content-Length is  + contentLength, maxlen);
+}
+
+LOG.debug(Buffering response body);
+ByteArrayOutputStream rawdata = new ByteArrayOutputStream(
+contentLength  0 ? (int) contentLength : 
DEFAULT_INITIAL_BUFFER_SIZE);
+byte[] buffer = new byte[2048];
+int pos = 0;
+int len;
+do {
+len = instream.read(buffer, 0, Math.min(buffer.length, 
maxlen-pos));
+if (len == -1) break;
+rawdata.write(buffer, 0, len);
+pos += len;
+} while (pos  maxlen);
+
+setResponseStream(null);
+// check if there is even more data
+if (pos == maxlen) {
+if (instream.read() != -1)
+throw new HttpContentTooLargeException(
+Content-Length not known but larger than 
++ maxlen, maxlen);
+}
+this.responseBody = rawdata.toByteArray();
+}
+}
+return this.responseBody;
+}
+
+/**
  * Returns the response body of the HTTP method, if any, as an [EMAIL 
PROTECTED] InputStream}. 
  * If response body is not available, returns ttnull/tt
  * 
@@ -770,36 +825,15 @@
  */
 public String getResponseBodyAsString(int maxlen) throws IOException {
 if (maxlen  0) throw new IllegalArgumentException(maxlen must be 
positive);
-
-// we might already know that the content is larger
-long contentLength = getResponseContentLength();
-if ((contentLength != -1)  (contentLength  maxlen)) {
-throw new HttpContentTooLargeException(Content-Length is + 
contentLength, maxlen);
+byte[] rawdata = null;
+if (responseAvailable()) {
+rawdata = getResponseBody(maxlen);
 }
-
-LOG.debug(Buffering response body);
-ByteArrayOutputStream rawdata = new ByteArrayOutputStream(
-contentLength  0 ? (int

svn commit: r486658 - in /jakarta/commons/proper/httpclient/trunk: release_notes.txt src/java/org/apache/commons/httpclient/HttpMethodDirector.java

2006-12-13 Thread olegk
Author: olegk
Date: Wed Dec 13 06:05:50 2006
New Revision: 486658

URL: http://svn.apache.org/viewvc?view=revrev=486658
Log:
Fix for [HTTPCLIENT-616]: HttpMethodDirector.executeWithRetry method fails to 
close the underlying connection if a RuntimeException is thrown

Contributed by Jason Bird
Reviewed by Oleg Kalnichevski

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?view=diffrev=486658r1=486657r2=486658
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Wed Dec 13 
06:05:50 2006
@@ -1,5 +1,9 @@
 Changes since Release 3.1 Beta 1:
 
+* [HTTPCLIENT-616] - HttpMethodDirector.executeWithRetry method fixed to close 
the 
+   underlying connection if a RuntimeException is thrown
+   Contributed by Jason Bird
+
 * [HTTPCLIENT-606] - Added a HTTP method level parameter for URI charset
Contributed by Oleg Kalnichevski olegk at apache.org
 

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java?view=diffrev=486658r1=486657r2=486658
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
 Wed Dec 13 06:05:50 2006
@@ -453,7 +453,7 @@
 releaseConnection = true;
 throw e;
 } catch (RuntimeException e) {
-if (this.conn.isOpen) {
+if (this.conn.isOpen()) {
 LOG.debug(Closing the connection.);
 this.conn.close();
 }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r486665 - in /jakarta/commons/proper/httpclient/trunk: release_notes.txt src/java/org/apache/commons/httpclient/methods/FileRequestEntity.java

2006-12-13 Thread olegk
Author: olegk
Date: Wed Dec 13 06:19:07 2006
New Revision: 486665

URL: http://svn.apache.org/viewvc?view=revrev=486665
Log:
Fix for [HTTPCLIENT-612]: FileRequestEntity in SVN does not close input file

Contributed by Sebastian Bazley
Reviewed by Oleg Kalnichevski

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/FileRequestEntity.java

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?view=diffrev=486665r1=486664r2=486665
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Wed Dec 13 
06:19:07 2006
@@ -1,5 +1,8 @@
 Changes since Release 3.1 Beta 1:
 
+* [HTTPCLIENT-612] - FileRequestEntity now always closes the input file.
+   Contributed by Sebastian Bazley sebb at apache.org
+
 * [HTTPCLIENT-616] - HttpMethodDirector.executeWithRetry method fixed to close 
the 
underlying connection if a RuntimeException is thrown
Contributed by Jason Bird

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/FileRequestEntity.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/FileRequestEntity.java?view=diffrev=486665r1=486664r2=486665
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/FileRequestEntity.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/FileRequestEntity.java
 Wed Dec 13 06:19:07 2006
@@ -71,9 +71,13 @@
 byte[] tmp = new byte[4096];
 int i = 0;
 InputStream instream = new FileInputStream(this.file);
-while ((i = instream.read(tmp)) = 0) {
-out.write(tmp, 0, i);
-}
+try {
+while ((i = instream.read(tmp)) = 0) {
+out.write(tmp, 0, i);
+}
+} finally {
+instream.close();
+}
 }
 
 }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r483949 - in /jakarta/commons/proper/httpclient/trunk: ./ src/java/org/apache/commons/httpclient/ src/java/org/apache/commons/httpclient/params/

2006-12-08 Thread olegk
Author: olegk
Date: Fri Dec  8 03:34:50 2006
New Revision: 483949

URL: http://svn.apache.org/viewvc?view=revrev=483949
Log:
Fix for [HTTPCLIENT-606] HttpMethodDirector fails when redirecting to a encoded 
URL location

changelog:

- Added a HTTP method level parameter for URI charset

Contributed by Oleg Kalnichevski olegk at apache.org

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ConnectMethod.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpMethodParams.java

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?view=diffrev=483949r1=483948r2=483949
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Fri Dec  8 
03:34:50 2006
@@ -1,5 +1,8 @@
 Changes since Release 3.1 Beta 1:
 
+* [HTTPCLIENT-606] - Added a HTTP method level parameter for URI charset
+   Contributed by Oleg Kalnichevski olegk at apache.org
+
 * [HTTPCLIENT-610] - Added for convenience 
HttpMethodBase.getResponseBodyAsString(int)
Contributed by Ortwin Glueck oglueck at apache.org


Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ConnectMethod.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ConnectMethod.java?view=diffrev=483949r1=483948r2=483949
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ConnectMethod.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ConnectMethod.java
 Fri Dec  8 03:34:50 2006
@@ -116,7 +116,8 @@
 }
 
 public URI getURI() throws URIException {
-return new URI(getPath(), true);
+String charset = getParams().getUriCharset();
+return new URI(getPath(), true, charset);
 }
 
 /**

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java?view=diffrev=483949r1=483948r2=483949
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 Fri Dec  8 03:34:50 2006
@@ -218,7 +218,8 @@
 if (uri == null || uri.equals()) {
 uri = /;
 }
-setURI(new URI(uri, true));
+String charset = getParams().getUriCharset();
+setURI(new URI(uri, true, charset));
 } catch (URIException e) {
 throw new IllegalArgumentException(Invalid uri ' 
 + uri + ':  + e.getMessage() 
@@ -262,7 +263,8 @@
 buffer.append('?');
 buffer.append(this.queryString);
 }
-return new URI(buffer.toString(), true);
+String charset = getParams().getUriCharset();
+return new URI(buffer.toString(), true, charset);
 }
 
 /**

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java?view=diffrev=483949r1=483948r2=483949
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
 Fri Dec  8 03:34:50 2006
@@ -596,8 +596,11 @@
 this.conn.getPort(), 
method.getPath()
);
-   redirectUri = new URI(location, true);
-   if (redirectUri.isRelativeURI()) {
+   
+String charset = method.getParams().getUriCharset();
+redirectUri = new URI(location, true, charset);
+   
+if (redirectUri.isRelativeURI()) {
if 
(this.params.isParameterTrue

svn commit: r470480 - /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java

2006-11-02 Thread olegk
Author: olegk
Date: Thu Nov  2 11:16:32 2006
New Revision: 470480

URL: http://svn.apache.org/viewvc?view=revrev=470480
Log:
Enabled detection of proxy settings in a browser (applet) for JDK 1.5 and 1.6

Contributed by Jiri Kopsa Jiri.Kopsa at Sun.COM

Modified:

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java?view=diffrev=470480r1=470479r2=470480
==
--- 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java
 Thu Nov  2 11:16:32 2006
@@ -107,17 +107,15 @@
 if (result == null) {
 invokeFailover = true;
 }
-} else if (javaVers.startsWith(1.4))  {
-result = detectProxySettingsJDK14(sampleURL);
+} else if (javaVers.startsWith(1.4) || (javaVers.startsWith(1.5) 
|| javaVers.startsWith(1.6)))  {
+result = detectProxySettingsJDK14_JDK15_JDK16(sampleURL);
 if (result == null) {
 invokeFailover = true;
 }
-} else if (javaVers.startsWith(1.5))  {
-invokeFailover = true;
 } else {
 if (LOG.isDebugEnabled()) {
 LOG.debug(Sun Plugin reported java version not 1.3.X,  +
-  1.4.X or 1.5.X - trying failover detection...);
+  1.4.X, 1.5.X or 1.6.X - trying failover 
detection...);
 }
 invokeFailover = true;
 }
@@ -220,7 +218,7 @@
  * @param sampleURL the URL to check proxy settings for
  * @return ProxyHost the host and port of the proxy that should be used
  */
-private static ProxyHost detectProxySettingsJDK14(URL sampleURL) {
+private static ProxyHost detectProxySettingsJDK14_JDK15_JDK16(URL 
sampleURL) {
 ProxyHost result = null;
 try {
 // Look around for the 1.4.X plugin proxy detection class... 
@@ -232,6 +230,7 @@
 new Class[] {URL.class});
 Object proxyInfoArrayObj = 
 getProxyInfoMethod.invoke(null, new Object[] {sampleURL});
+
 if (proxyInfoArrayObj == null  
 || Array.getLength(proxyInfoArrayObj) == 0) {
 if (LOG.isDebugEnabled()) {
@@ -257,6 +256,7 @@
 result = new ProxyHost(proxyIP, proxyPort);
 }
 } catch (Exception e) { 
+e.printStackTrace();
 LOG.warn(Sun Plugin 1.4.X proxy detection class not found,  +
  will try failover detection, e:+e);
 }
@@ -325,4 +325,4 @@
 }
 return result;
 }
-}
+}
\ No newline at end of file



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r468880 - /jakarta/commons/proper/httpclient/tags/HTTPCLIENT_3_1_BETA1/

2006-10-29 Thread olegk
Author: olegk
Date: Sun Oct 29 03:33:11 2006
New Revision: 468880

URL: http://svn.apache.org/viewvc?view=revrev=468880
Log:
HttpClient release 3.1-beta1

Added:
jakarta/commons/proper/httpclient/tags/HTTPCLIENT_3_1_BETA1/
  - copied from r468879, jakarta/commons/proper/httpclient/trunk/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r468688 - in /jakarta/commons/proper/httpclient/trunk: build.xml project.xml src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java xdocs/downloads.xml xdocs/news.xml

2006-10-28 Thread olegk
Author: olegk
Date: Sat Oct 28 05:59:24 2006
New Revision: 468688

URL: http://svn.apache.org/viewvc?view=revrev=468688
Log:
Changes for 3.1-beta1 release

Modified:
jakarta/commons/proper/httpclient/trunk/build.xml
jakarta/commons/proper/httpclient/trunk/project.xml

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml
jakarta/commons/proper/httpclient/trunk/xdocs/news.xml
jakarta/commons/proper/httpclient/trunk/xdocs/status.xml

Modified: jakarta/commons/proper/httpclient/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/build.xml?view=diffrev=468688r1=468687r2=468688
==
--- jakarta/commons/proper/httpclient/trunk/build.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/build.xml Sat Oct 28 05:59:24 2006
@@ -38,7 +38,7 @@
   property name=component.title value=HttpClient Library/
 
   !-- The current version number of this component --
-  property name=component.version   value=3.1-alpha1/
+  property name=component.version   value=3.1-beta1/
 
 !-- == Properties: Source Directories  --
 

Modified: jakarta/commons/proper/httpclient/trunk/project.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/project.xml?view=diffrev=468688r1=468687r2=468688
==
--- jakarta/commons/proper/httpclient/trunk/project.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/project.xml Sat Oct 28 05:59:24 2006
@@ -7,7 +7,7 @@
   artifactIdcommons-httpclient/artifactId
   gumpRepositoryIdjakarta-commons-httpclient/gumpRepositoryId
   inceptionYear2001/inceptionYear
-  currentVersion3.1-alpha1/currentVersion
+  currentVersion3.1-beta1/currentVersion
   packageorg.apache.commons.httpclient/package
 
   organization
@@ -33,6 +33,11 @@
 
urlhttp://svn.apache.org/repos/asf/jakarta/commons/proper/${pom.artifactId.substring(8)}/trunk/url
   /repository
   versions
+version
+  id3.1-beta1/id
+  name3.1-beta1/name
+  tagHTTPCLIENT_3_1_BETA1/tag
+/version
 version
   id3.1-alpha1/id
   name3.1-alpha1/name

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java?view=diffrev=468688r1=468687r2=468688
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
 Sat Oct 28 05:59:24 2006
@@ -66,7 +66,7 @@
 protected HttpParams createParams() {
 HttpClientParams params = new HttpClientParams(null);
 
-params.setParameter(HttpMethodParams.USER_AGENT, Jakarta 
Commons-HttpClient/3.1-alpha1);
+params.setParameter(HttpMethodParams.USER_AGENT, Jakarta 
Commons-HttpClient/3.1-beta1);
 params.setVersion(HttpVersion.HTTP_1_1);
 params.setConnectionManagerClass(SimpleHttpConnectionManager.class);
 params.setCookiePolicy(CookiePolicy.DEFAULT);

Modified: jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml?view=diffrev=468688r1=468687r2=468688
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml Sat Oct 28 
05:59:24 2006
@@ -14,7 +14,7 @@
  The following releases are avilable for download:
/p
ul
- liCURRENT - 3.1-alpha1 - 26 June 2006 - 
+ liCURRENT - 3.1-beta1 - 30 October 2006 - 
 a 
href=http://jakarta.apache.org/site/downloads/downloads_commons-httpclient.cgi;Download/a
 - a 
  
href=http://www.apache.org/dist/jakarta/commons/httpclient/RELEASE-NOTES.txt;
  Release notes/a/li
@@ -46,12 +46,12 @@
p
  If you are using Maven for your project, you can create a dependency 
in your
  project.xml with one of the following:/p
-pb3.1-alpha1/b/p
+pb3.1-beta1/b/p
  source![CDATA[
 dependency
 groupIdcommons-httpclient/groupId
 artifactIdcommons-httpclient/artifactId
-version3.1-alpha1/version
+version3.1-beta1/version
 urlhttp://jakarta.apache.org/commons/httpclient//url
 /dependency
  ]]/source

Modified: jakarta/commons/proper/httpclient

svn commit: r468695 - /jakarta/commons/proper/httpclient/trunk/release_notes.txt

2006-10-28 Thread olegk
Author: olegk
Date: Sat Oct 28 08:39:24 2006
New Revision: 468695

URL: http://svn.apache.org/viewvc?view=revrev=468695
Log:
3.1 Beta 1 release notes

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?view=diffrev=468695r1=468694r2=468695
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Sat Oct 28 
08:39:24 2006
@@ -1,3 +1,4 @@
+Release 3.1 Beta 1
 ---
 Changes since Release 3.1 Alpha 1:
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r451784 - /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/SocketFactoryWrapper.java

2006-10-01 Thread olegk
Author: olegk
Date: Sun Oct  1 11:55:49 2006
New Revision: 451784

URL: http://svn.apache.org/viewvc?view=revrev=451784
Log:
[HTTPCLIENT-601]: SecureProtocolFactoryWrapper class for using the socket 
factory created by Java Web Start

Contributed by Mark Claassen mclaassen at ocie.net
Reviewed by Oleg Kalnichevski  Roland Weber

Added:

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/SocketFactoryWrapper.java
   (with props)

Added: 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/SocketFactoryWrapper.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/SocketFactoryWrapper.java?view=autorev=451784
==
--- 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/SocketFactoryWrapper.java
 (added)
+++ 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/SocketFactoryWrapper.java
 Sun Oct  1 11:55:49 2006
@@ -0,0 +1,101 @@
+/*
+ * $Header$
+ * $Revision$
+ * $Date$
+ *
+ * 
+ *
+ *  Copyright 2002-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the License);
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an AS IS BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * http://www.apache.org/.
+ *
+ */
+package org.apache.commons.httpclient.contrib.ssl;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.net.SocketAddress;
+import java.net.UnknownHostException;
+import javax.net.ssl.SSLSocketFactory;
+import org.apache.commons.httpclient.ConnectTimeoutException;
+import org.apache.commons.httpclient.params.HttpConnectionParams;
+import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory;
+
+/**
+ * Author: Mark Claassen
+ * p
+ * Uses some code from EasySSLProtocolSocketFactory.java
+ * 
+ * p
+ * Wraps a SSLSocketFactory with a SecureProtocolSocketFactory.
+ * p
+ * This was designed to make HttpClient work in situations where an 
application is being deployed by
+ * Java Web Start. In these cases, SSL connections are negotiated by webstart 
implementations of the
+ * KeyManager and TrustManager. Wrapping the socket factory obtained from
+ * HttpsURLConnection.getDefaultSocketFactory allows the use of HttpClient 
while still leveraging
+ * Java Web Start's handling of SSL certificates
+ */
+public class SocketFactoryWrapper implements SecureProtocolSocketFactory {
+
+private SSLSocketFactory socketFactory;
+
+public SocketFactoryWrapper(SSLSocketFactory socketFactory) {
+this.socketFactory = socketFactory;
+}
+
+public Socket createSocket(String host, int port) throws IOException, 
UnknownHostException {
+return socketFactory.createSocket(host, port);
+}
+
+public Socket createSocket(String host, int port, InetAddress 
localAddress, int localPort)
+throws IOException, UnknownHostException {
+return socketFactory.createSocket(host, port, localAddress, localPort);
+}
+
+public Socket createSocket(
+String host, 
+int port, InetAddress localAddress, int localPort,
+HttpConnectionParams params) throws IOException, 
UnknownHostException,
+ConnectTimeoutException {
+// Based on code from EasySSLProtocolSocketFactory.java
+Socket rval;
+if (params == null) {
+throw new IllegalArgumentException(Parameters may not be null);
+}
+int timeout = params.getConnectionTimeout();
+if (timeout == 0) {
+rval = socketFactory.createSocket(host, port, localAddress, 
localPort);
+} else {
+rval = socketFactory.createSocket();
+SocketAddress localaddr = new InetSocketAddress(localAddress, 
localPort);
+SocketAddress remoteaddr = new InetSocketAddress(host, port);
+rval.bind(localaddr);
+rval.connect(remoteaddr, timeout);
+}
+return rval;
+}
+
+public Socket

svn commit: r446851 - in /jakarta/commons/proper/httpclient/trunk: release_notes.txt src/java/org/apache/commons/httpclient/ContentLengthInputStream.java

2006-09-16 Thread olegk
Author: olegk
Date: Sat Sep 16 03:36:35 2006
New Revision: 446851

URL: http://svn.apache.org/viewvc?view=revrev=446851
Log:
Fix for [HTTPCLIENT-598]: ContentLengthInputStream does not implement 
available() properly

Contributed by Igor Lubashev igorlord at yahoo.com
Reviewed by Oleg Kalnichevski

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ContentLengthInputStream.java

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?view=diffrev=446851r1=446850r2=446851
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Sat Sep 16 
03:36:35 2006
@@ -1,6 +1,9 @@
 ---
 Changes since Release 3.1 Alpha 1:
 
+* [HTTPCLIENT-598] - Fixed ContentLengthInputStream#available()
+   Contributed by Igor Lubashev igorlord at yahoo.com
+
 * [HTTPCLIENT-597] - Improved handling of idle connections in the 
multithreaded HTTP connection 
manager. 
Contributed by Michael Becke mbecke at apache.org

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ContentLengthInputStream.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ContentLengthInputStream.java?view=diffrev=446851r1=446850r2=446851
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ContentLengthInputStream.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ContentLengthInputStream.java
 Sat Sep 16 03:36:35 2006
@@ -204,4 +204,16 @@
 }
 return length;
 }
+
+public int available() throws IOException {
+if (this.closed) {
+return 0;
+}
+int avail = this.wrappedStream.available();
+if (this.pos + avail  this.contentLength ) {
+avail = (int)(this.contentLength - this.pos);
+}
+return avail; 
+}
+
 }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r441940 - /jakarta/commons/proper/httpclient/trunk/release_notes.txt

2006-09-10 Thread olegk
Author: olegk
Date: Sun Sep 10 04:14:12 2006
New Revision: 441940

URL: http://svn.apache.org/viewvc?view=revrev=441940
Log:
HTTPCLIENT-597

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?view=diffrev=441940r1=441939r2=441940
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Sun Sep 10 
04:14:12 2006
@@ -1,6 +1,10 @@
 ---
 Changes since Release 3.1 Alpha 1:
 
+* [HTTPCLIENT-597] - Improved handling of idle connections in the 
multithreaded HTTP connection 
+   manager. 
+   Contributed by Michael Becke mbecke at apache.org
+
 * [HTTPCLIENT-593] - Fixed problem with #equals() and #hashCode() methods in 
subclasses of 
DefaultProtocolSocketFactory and SSLProtocolSocketFactory
Contributed by Chris Audley chrisaudley at yahoo.com



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r432652 - /jakarta/commons/proper/httpclient/trunk/project.properties

2006-08-18 Thread olegk
Author: olegk
Date: Fri Aug 18 10:21:16 2006
New Revision: 432652

URL: http://svn.apache.org/viewvc?rev=432652view=rev
Log:
Changed maven.compile.debug flag to true

Modified:
jakarta/commons/proper/httpclient/trunk/project.properties

Modified: jakarta/commons/proper/httpclient/trunk/project.properties
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/project.properties?rev=432652r1=432651r2=432652view=diff
==
--- jakarta/commons/proper/httpclient/trunk/project.properties (original)
+++ jakarta/commons/proper/httpclient/trunk/project.properties Fri Aug 18 
10:21:16 2006
@@ -2,7 +2,7 @@
 
 maven.compile.source=1.2
 maven.compile.target=1.2
-maven.compile.debug=false
+maven.compile.debug=true
 
 maven.xdoc.date=left
 maven.xdoc.version=${pom.currentVersion}



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r429849 - in /jakarta/commons/proper/httpclient/trunk: release_notes.txt src/java/org/apache/commons/httpclient/HttpMethodBase.java

2006-08-08 Thread olegk
Author: olegk
Date: Tue Aug  8 15:06:09 2006
New Revision: 429849

URL: http://svn.apache.org/viewvc?rev=429849view=rev
Log:
Fix for [HTTPCLIENT-594]: HttpMethodBase#aborted variable mistakenly declared 
transient instead of volatile

Contributed by Oleg Kalnichevski
Reviewed by Ortwin Glück and Roland Weber

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?rev=429849r1=429848r2=429849view=diff
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Tue Aug  8 
15:06:09 2006
@@ -1,3 +1,10 @@
+---
+Changes since Release 3.1 Alpha 1:
+
+* [HTTPCLIENT-594] - HttpMethodBase#aborted variable was declared transient 
instead of volatile
+   by mistake.
+   Contributed by Oleg Kalnichevski olegk at apache.org
+
 Release 3.1 Alpha 1
 ---
 New features:

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java?rev=429849r1=429848r2=429849view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 Tue Aug  8 15:06:09 2006
@@ -175,7 +175,7 @@
 protected HttpVersion effectiveVersion = null;
 
 /** Whether the execution of this method has been aborted */
-private transient boolean aborted = false;
+private volatile boolean aborted = false;
 
 /** Whether the HTTP request has been transmitted to the target
  * server it its entirety */



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r429852 - in /jakarta/commons/proper/httpclient/trunk: ./ src/java/org/apache/commons/httpclient/protocol/ src/test/org/apache/commons/httpclient/

2006-08-08 Thread olegk
Author: olegk
Date: Tue Aug  8 15:14:36 2006
New Revision: 429852

URL: http://svn.apache.org/viewvc?rev=429852view=rev
Log:
Fix for [HTTPCLIENT-593]: ProtocolSocketFactory equals and hashCode don't 
support subclassing

Contributed by Chris Audley chrisaudley at yahoo.com
Reviewed by Oleg Kalnichevski, Ortwin Glück and Roland Weber

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/protocol/DefaultProtocolSocketFactory.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/protocol/SSLProtocolSocketFactory.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestEquals.java

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?rev=429852r1=429851r2=429852view=diff
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Tue Aug  8 
15:14:36 2006
@@ -1,6 +1,10 @@
 ---
 Changes since Release 3.1 Alpha 1:
 
+* [HTTPCLIENT-593] - Fixed problem with #equals() and #hashCode() methods in 
subclasses of 
+   DefaultProtocolSocketFactory and SSLProtocolSocketFactory
+   Contributed by Chris Audley chrisaudley at yahoo.com
+
 * [HTTPCLIENT-594] - HttpMethodBase#aborted variable was declared transient 
instead of volatile
by mistake.
Contributed by Oleg Kalnichevski olegk at apache.org

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/protocol/DefaultProtocolSocketFactory.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/protocol/DefaultProtocolSocketFactory.java?rev=429852r1=429851r2=429852view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/protocol/DefaultProtocolSocketFactory.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/protocol/DefaultProtocolSocketFactory.java
 Tue Aug  8 15:14:36 2006
@@ -143,14 +143,14 @@
  * All instances of DefaultProtocolSocketFactory are the same.
  */
 public boolean equals(Object obj) {
-return ((obj != null)  
obj.getClass().equals(DefaultProtocolSocketFactory.class));
+return ((obj != null)  obj.getClass().equals(getClass()));
 }
 
 /**
  * All instances of DefaultProtocolSocketFactory have the same hash code.
  */
 public int hashCode() {
-return DefaultProtocolSocketFactory.class.hashCode();
+return getClass().hashCode();
 }
 
 }

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/protocol/SSLProtocolSocketFactory.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/protocol/SSLProtocolSocketFactory.java?rev=429852r1=429851r2=429852view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/protocol/SSLProtocolSocketFactory.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/protocol/SSLProtocolSocketFactory.java
 Tue Aug  8 15:14:36 2006
@@ -168,14 +168,14 @@
  * All instances of SSLProtocolSocketFactory are the same.
  */
 public boolean equals(Object obj) {
-return ((obj != null)  
obj.getClass().equals(SSLProtocolSocketFactory.class));
+return ((obj != null)  obj.getClass().equals(getClass()));
 }
 
 /**
  * All instances of SSLProtocolSocketFactory have the same hash code.
  */
 public int hashCode() {
-return SSLProtocolSocketFactory.class.hashCode();
+return getClass().hashCode();
 }
 
 }

Modified: 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestEquals.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestEquals.java?rev=429852r1=429851r2=429852view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestEquals.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestEquals.java
 Tue Aug  8 15:14:36 2006
@@ -86,6 +86,21 @@
 
 }
 
+public void testProtocolSocketFactorySublass() {
+ProtocolSocketFactory factory1 = new DefaultProtocolSocketFactory();
+ProtocolSocketFactory factory2 = new

svn commit: r429857 - /jakarta/commons/proper/httpclient/trunk/project.xml

2006-08-08 Thread olegk
Author: olegk
Date: Tue Aug  8 15:18:44 2006
New Revision: 429857

URL: http://svn.apache.org/viewvc?rev=429857view=rev
Log:
Fix for [HTTPCLIENT-595]: Fix junit scope in maven pom

Contributed by Carlos Sanchez

Modified:
jakarta/commons/proper/httpclient/trunk/project.xml

Modified: jakarta/commons/proper/httpclient/trunk/project.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/project.xml?rev=429857r1=429856r2=429857view=diff
==
--- jakarta/commons/proper/httpclient/trunk/project.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/project.xml Tue Aug  8 15:18:44 2006
@@ -321,6 +321,9 @@
   artifactIdjunit/artifactId
   version3.8.1/version
   urlhttp://www.junit.org//url
+  properties
+scopetest/scope
+  /properties
 /dependency
 dependency
   groupIdcommons-logging/groupId



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r429299 - /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java

2006-08-07 Thread olegk
Author: olegk
Date: Mon Aug  7 03:51:29 2006
New Revision: 429299

URL: http://svn.apache.org/viewvc?rev=429299view=rev
Log:
[HTTPCLIENT-574]: Subclasses do not have write access to StatusLine

Contributed by Caleb Lyness caleb_lyness at yahoo.com

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java?rev=429299r1=429298r2=429299view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 Mon Aug  7 03:51:29 2006
@@ -108,7 +108,7 @@
 private HeaderGroup requestHeaders = new HeaderGroup();
 
 /** The Status-Line from the response. */
-private StatusLine statusLine = null;
+protected StatusLine statusLine = null;
 
 /** Response headers, if any. */
 private HeaderGroup responseHeaders = new HeaderGroup();
@@ -172,7 +172,7 @@
 private static final int RESPONSE_WAIT_TIME_MS = 3000;
 
 /** HTTP protocol version used for execution of this method. */
-private HttpVersion effectiveVersion = null;
+protected HttpVersion effectiveVersion = null;
 
 /** Whether the execution of this method has been aborted */
 private transient boolean aborted = false;



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r417001 - in /jakarta/commons/proper/httpclient/trunk/xdocs: developerguide.xml navigation.xml releases.xml

2006-06-25 Thread olegk
Author: olegk
Date: Sun Jun 25 03:32:26 2006
New Revision: 417001

URL: http://svn.apache.org/viewvc?rev=417001view=rev
Log:
Removed outdated HttpClient release process guide. The up to date version of 
this document is hosted in Wiki

Removed:
jakarta/commons/proper/httpclient/trunk/xdocs/releases.xml
Modified:
jakarta/commons/proper/httpclient/trunk/xdocs/developerguide.xml
jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml

Modified: jakarta/commons/proper/httpclient/trunk/xdocs/developerguide.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/xdocs/developerguide.xml?rev=417001r1=417000r2=417001view=diff
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/developerguide.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/developerguide.xml Sun Jun 25 
03:32:26 2006
@@ -33,17 +33,5 @@
   /ul
 /section
 
-section name=Overview
-  table
-tr
-  thDocument/th
-  thDescription/th
-/tr
-tr
-  tda href=releases.htmlRelease Guide/a/td
-  tdThis document describes the release process for HttpClient./td
-/tr
-  /table
-/section
   /body
 /document

Modified: jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml?rev=417001r1=417000r2=417001view=diff
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml Sun Jun 25 
03:32:26 2006
@@ -32,9 +32,7 @@
 item name=Trouble Shooting href=/troubleshooting.html/
 item name=Tutorial href=/tutorial.html/
   /item
-  item name=Developer Guide href=/developerguide.html
-item name=Release Process href=/releases.html/
-  /item
+  item name=Developer Guide href=/developerguide.html/
 /menu
 
 commons;



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r417003 - /jakarta/commons/proper/httpclient/tags/HTTPCLIENT_3_1_ALPHA1/

2006-06-25 Thread olegk
Author: olegk
Date: Sun Jun 25 03:39:28 2006
New Revision: 417003

URL: http://svn.apache.org/viewvc?rev=417003view=rev
Log:
HttpClient release 3.1-alpha1

Added:
jakarta/commons/proper/httpclient/tags/HTTPCLIENT_3_1_ALPHA1/
  - copied from r417002, jakarta/commons/proper/httpclient/trunk/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r416901 - /jakarta/commons/proper/httpclient/trunk/release_notes.txt

2006-06-24 Thread olegk
Author: olegk
Date: Sat Jun 24 04:03:32 2006
New Revision: 416901

URL: http://svn.apache.org/viewvc?rev=416901view=rev
Log:
Preparing 3.1-ALPHA1 release
* Added a list of new features
* Added a list of API changes since 3.0

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?rev=416901r1=416900r2=416901view=diff
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Sat Jun 24 
04:03:32 2006
@@ -1,4 +1,89 @@
-Changes toward 3.1 
+Release 3.1 Alpha 1
+---
+New features:
+---
+
+(1) HTTP state management
+ 
+ * RFC 2965 cookie specification support
+   
+---
+API changes since 3.0
+
+Class added: 
+  public org.apache.commons.httpclient.InvalidRedirectLocationException 
extends org.apache.commons.httpclient.RedirectException
+Class added: 
+  public org.apache.commons.httpclient.cookie.Cookie2 extends 
org.apache.commons.httpclient.Cookie
+Class added: 
+  public abstract org.apache.commons.httpclient.cookie.CookieAttributeHandler 
extends java.lang.Object
+Class added: 
+  public final org.apache.commons.httpclient.cookie.CookieOrigin extends 
java.lang.Object
+Class added: 
+  public org.apache.commons.httpclient.cookie.CookiePathComparator extends 
java.lang.Object implements java.util.Comparator
+Class added: 
+  public abstract org.apache.commons.httpclient.cookie.CookieVersionSupport 
extends java.lang.Object
+Class added: 
+  public org.apache.commons.httpclient.cookie.RFC2965Spec extends 
org.apache.commons.httpclient.cookie.CookieSpecBase implements 
org.apache.commons.httpclient.cookie.CookieVersionSupport
+Class added: 
+  public org.apache.commons.httpclient.methods.FileRequestEntity extends 
java.lang.Object implements org.apache.commons.httpclient.methods.RequestEntity
+Class changed: org.apache.commons.httpclient.ConnectMethod
+  Methods added:
+public ConnectMethod(org.apache.commons.httpclient.HostConfiguration);
+public java.lang.String getPath();
+public org.apache.commons.httpclient.URI getURI() throws 
org.apache.commons.httpclient.URIException;
+
+  Method changed:
+  old:
+public ConnectMethod();
+
+  new:
+deprecated: public ConnectMethod();
+
+Class changed: org.apache.commons.httpclient.HttpMethodBase
+  Methods added:
+protected void 
processCookieHeaders(org.apache.commons.httpclient.cookie.CookieSpec, 
org.apache.commons.httpclient.Header[], 
org.apache.commons.httpclient.HttpState, 
org.apache.commons.httpclient.HttpConnection);
+
+Class changed: org.apache.commons.httpclient.HttpState
+  Method changed:
+  old:
+public void clearCookies();
+
+  new:
+public synchronized void clearCookies();
+
+Class changed: org.apache.commons.httpclient.HttpURL
+  Methods added:
+protected void setURI();
+
+Class changed: org.apache.commons.httpclient.SimpleHttpConnectionManager
+  Methods added:
+public SimpleHttpConnectionManager(boolean);
+public void shutdown();
+
+Class changed: org.apache.commons.httpclient.cookie.CookiePolicy
+  Methods added:
+public static java.lang.String[] getRegisteredCookieSpecs();
+
+  Fields added:
+deprecated: public final static int RFC2965 = 3;
+public final static java.lang.String RFC_2965 = rfc2965;
+
+Class changed: org.apache.commons.httpclient.cookie.RFC2109Spec
+  Fields added:
+public static java.lang.String SET_COOKIE_KEY;
+
+Class changed: org.apache.commons.httpclient.methods.StringRequestEntity
+  Method changed:
+  old:
+public StringRequestEntity(java.lang.String);
+
+  new:
+deprecated: public StringRequestEntity(java.lang.String);
+
+API diff generated by JarDiff http://www.osjava.org/jardiff/
+  
+---
+Changes since Release 3.0.1:
 
  * [HTTPCLIENT-588] - Fixed parsing of relative URIs with internal 
double-slashes ('//')
Contributed by Gordon Mohr gojomo at archive.org



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r416903 - in /jakarta/commons/proper/httpclient/trunk: build.xml project.xml src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java

2006-06-24 Thread olegk
Author: olegk
Date: Sat Jun 24 04:18:22 2006
New Revision: 416903

URL: http://svn.apache.org/viewvc?rev=416903view=rev
Log:
Updates for 3.1-alpha1 release

Modified:
jakarta/commons/proper/httpclient/trunk/build.xml
jakarta/commons/proper/httpclient/trunk/project.xml

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java

Modified: jakarta/commons/proper/httpclient/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/build.xml?rev=416903r1=416902r2=416903view=diff
==
--- jakarta/commons/proper/httpclient/trunk/build.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/build.xml Sat Jun 24 04:18:22 2006
@@ -38,7 +38,7 @@
   property name=component.title value=HttpClient Library/
 
   !-- The current version number of this component --
-  property name=component.version   value=3.0/
+  property name=component.version   value=3.1-alpha1/
 
 !-- == Properties: Source Directories  --
 

Modified: jakarta/commons/proper/httpclient/trunk/project.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/project.xml?rev=416903r1=416902r2=416903view=diff
==
--- jakarta/commons/proper/httpclient/trunk/project.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/project.xml Sat Jun 24 04:18:22 2006
@@ -7,7 +7,7 @@
   artifactIdcommons-httpclient/artifactId
   gumpRepositoryIdjakarta-commons-httpclient/gumpRepositoryId
   inceptionYear2001/inceptionYear
-  currentVersion3.0.1/currentVersion
+  currentVersion3.1-alpha1/currentVersion
   packageorg.apache.commons.httpclient/package
 
   organization
@@ -33,6 +33,11 @@
 
urlhttp://svn.apache.org/repos/asf/jakarta/commons/proper/${pom.artifactId.substring(8)}/trunk/url
   /repository
   versions
+version
+  id3.1-alpha1/id
+  name3.1-alpha1/name
+  tagHTTPCLIENT_3_1_ALPHA1/tag
+/version
 version
   id3.0.1/id
   name3.0.1/name

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java?rev=416903r1=416902r2=416903view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
 Sat Jun 24 04:18:22 2006
@@ -66,7 +66,7 @@
 protected HttpParams createParams() {
 HttpClientParams params = new HttpClientParams(null);
 
-params.setParameter(HttpMethodParams.USER_AGENT, Jakarta 
Commons-HttpClient/3.0);
+params.setParameter(HttpMethodParams.USER_AGENT, Jakarta 
Commons-HttpClient/3.1-alpha1);
 params.setVersion(HttpVersion.HTTP_1_1);
 params.setConnectionManagerClass(SimpleHttpConnectionManager.class);
 params.setCookiePolicy(CookiePolicy.DEFAULT);



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r416912 - in /jakarta/commons/proper/httpclient/trunk/xdocs: downloads.xml news.xml status.xml

2006-06-24 Thread olegk
Author: olegk
Date: Sat Jun 24 06:19:56 2006
New Revision: 416912

URL: http://svn.apache.org/viewvc?rev=416912view=rev
Log:
Updates for the 3.1-alpha1 release

Modified:
jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml
jakarta/commons/proper/httpclient/trunk/xdocs/news.xml
jakarta/commons/proper/httpclient/trunk/xdocs/status.xml

Modified: jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml?rev=416912r1=416911r2=416912view=diff
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml Sat Jun 24 
06:19:56 2006
@@ -14,22 +14,22 @@
  The following releases are avilable for download:
/p
ul
- li3.0.1 - 08 May 2006 - 
+ liCURRENT - 3.1-alpha1 - 26 June 2006 - 
 a 
href=http://jakarta.apache.org/site/downloads/downloads_commons-httpclient.cgi;Download/a
 - a 
  
href=http://www.apache.org/dist/jakarta/commons/httpclient/RELEASE-NOTES.txt;
  Release notes/a/li
/ul
ul
- li2.0.2 - 11 October 2004 - 
+ liSTABLE - 3.0.1 - 08 May 2006 - 
 a 
href=http://jakarta.apache.org/site/downloads/downloads_commons-httpclient.cgi;Download/a
 - a 
- 
href=http://www.apache.org/dist/jakarta/commons/httpclient/RELEASE-NOTES-2.0.txt;
+ 
href=http://www.apache.org/dist/jakarta/commons/httpclient/RELEASE-NOTES.txt;
  Release notes/a/li
/ul
p
  Nightly source drops and binary builds can be obtained at the 
following URLs:
/p
ul
-   liSTABLE 3.0 brecommended/b - a 
href=http://svn.apache.org/builds/jakarta-commons/nightly/commons-httpclient/;latest
 from HEAD(3.0)/a - bPlease note that this code is not API compatible with 
2.0./b/li
+   liUNSTABLE - a 
href=http://svn.apache.org/builds/jakarta-commons/nightly/commons-httpclient/;latest
 from HEAD (3.1)/a/li
/ul
p
  The latest a href=http://jakarta.apache.org/gump/;Gump/a 
generated binary
@@ -46,24 +46,25 @@
p
  If you are using Maven for your project, you can create a dependency 
in your
  project.xml with one of the following:/p
-b3.0.1/b
+pb3.1-alpha1/b/p
  source![CDATA[
 dependency
 groupIdcommons-httpclient/groupId
 artifactIdcommons-httpclient/artifactId
-version3.0.1/version
+version3.1-alpha1/version
 urlhttp://jakarta.apache.org/commons/httpclient//url
 /dependency
  ]]/source
-b2.0.2/b
+ pb3.0.1/b/p
  source![CDATA[
 dependency
 groupIdcommons-httpclient/groupId
 artifactIdcommons-httpclient/artifactId
-version2.0.2/version
+version3.0.1/version
 urlhttp://jakarta.apache.org/commons/httpclient//url
 /dependency
  ]]/source
+
pThere are also other jar versions available.  You can check
a 
href=http://www.ibiblio.org/maven/commons-httpclient/;HttpClient on 
ibiblio/a
for exactly what is available.

Modified: jakarta/commons/proper/httpclient/trunk/xdocs/news.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/xdocs/news.xml?rev=416912r1=416911r2=416912view=diff
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/news.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/news.xml Sat Jun 24 06:19:56 
2006
@@ -10,6 +10,14 @@
   /properties
 
   body
+section name=26 June 2006 - HttpClient 3.1-alpha1 released
+p
+  HttpClient 3.1-alpha1 has been released. This version adds 
support for the RFC 2965 cookie 
+  management (also known as Cookie2 or port sensitive cookies). 
All upstream projects dependent 
+  on HttpClient are strongly encouraged to review the new API and 
test new features for 
+  compatibility with their products.
+/p
+/section
 section name=12 May 2006 - HttpClient issue tracking migrated to 
Jira
 p
   HttpClient issue tracking has migrated from Bugzilla to Jira. 
Please do not enter new bug reports 

Modified: jakarta/commons/proper/httpclient/trunk/xdocs/status.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/xdocs/status.xml?rev=416912r1=416911r2=416912view=diff
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/status.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/status.xml Sat Jun 24 
06:19:56 2006
@@ -14,21 +14,20 @@
   body
 
 section name=Current Status
-pHttpClient 3.0 has arrived! We strongly encourage all

svn commit: r415958 - in /jakarta/commons/proper/httpclient/trunk: release_notes.txt src/java/org/apache/commons/httpclient/URI.java src/test/org/apache/commons/httpclient/TestURI.java

2006-06-21 Thread olegk
Author: olegk
Date: Wed Jun 21 03:51:00 2006
New Revision: 415958

URL: http://svn.apache.org/viewvc?rev=415958view=rev
Log:
[HTTPCLIENT-587] derelativizing of relative URIs with a scheme is incorrect

Contributed by Gordon Mohr gojomo at archive.org
Reviewed by Oleg Kalnichevski and Roland Weber

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?rev=415958r1=415957r2=415958view=diff
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Wed Jun 21 
03:51:00 2006
@@ -1,5 +1,8 @@
 Changes toward 3.1 
 
+ * [HTTPCLIENT-587] - Fixed incorrect derelativizing of relative URIs with a 
scheme
+   Contributed by Gordon Mohr gojomo at archive.org
+   
  * [HTTPCLIENT-494] - Invalid redirect location now causes a protocol exception
Contributed by Oleg Kalnichevski olegk at apache.org


Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java?rev=415958r1=415957r2=415958view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
 Wed Jun 21 03:51:00 2006
@@ -33,6 +33,7 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
+import java.util.Arrays;
 import java.util.Locale;
 import java.util.BitSet;
 import java.util.Hashtable;
@@ -512,6 +513,7 @@
 if (base._scheme != null) {
 this._scheme = base._scheme;
 this._authority = base._authority;
+this._is_net_path = base._is_net_path; 
 }
 if (base._is_opaque_part || relative._is_opaque_part) {
 this._scheme = base._scheme;
@@ -522,7 +524,9 @@
 this.setURI();
 return;
 }
-if (relative._scheme != null) {
+boolean schemesEqual = Arrays.equals(base._scheme,relative._scheme);
+if (relative._scheme != null 
+ (!schemesEqual  || relative._authority != null)) {
 this._scheme = relative._scheme;
 this._is_net_path = relative._is_net_path;
 this._authority = relative._authority;
@@ -565,7 +569,8 @@
 this._path = relative._path;
 }
 // resolve the path and query if necessary
-if (relative._scheme == null  relative._authority == null) {
+if (relative._authority == null 
+ (relative._scheme == null || schemesEqual)) {
 if ((relative._path == null || relative._path.length == 0)
  relative._query == null) {
 // handle a reference to the current document, see RFC 2396 

Modified: 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java?rev=415958r1=415957r2=415958view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java
 Wed Jun 21 03:51:00 2006
@@ -278,4 +278,22 @@
 }
 }
 
+/**
+ * Verify proper handling of relative URIs which have a scheme. 
+ * See bug http://issues.apache.org/jira/browse/HTTPCLIENT-587
+ * 
+ * @throws Exception
+ */
+public void testRelativeWithScheme() throws Exception {
+URI base = new URI(http://www.example.com/some/path;, true);
+URI rel1 = new URI(http:, true);
+URI rel2 = new URI(http:foo, true);
+URI rel3 = new URI(http:../../bar, true);
+URI derel1 = new URI(base, rel1);
+assertEquals(http://www.example.com/some/path,derel1.toString());
+URI derel2 = new URI(base, rel2);
+assertEquals(http://www.example.com/some/foo,derel2.toString());
+URI derel3 = new URI(base,rel3);
+assertEquals(http://www.example.com/bar,derel3.toString());
+}
 }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional

svn commit: r415961 - in /jakarta/commons/proper/httpclient/trunk: release_notes.txt src/java/org/apache/commons/httpclient/URI.java src/test/org/apache/commons/httpclient/TestURI.java

2006-06-21 Thread olegk
Author: olegk
Date: Wed Jun 21 04:05:19 2006
New Revision: 415961

URL: http://svn.apache.org/viewvc?rev=415961view=rev
Log:
[HTTPCLIENT-588] relative URIs with internal double-slashes ('//') misparsed

Contributed by Gordon Mohr gojomo at archive.org
Reviewed by Oleg Kalnichevski and Roland Weber

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?rev=415961r1=415960r2=415961view=diff
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Wed Jun 21 
04:05:19 2006
@@ -1,5 +1,8 @@
 Changes toward 3.1 
 
+ * [HTTPCLIENT-588] - Fixed parsing of relative URIs with internal 
double-slashes ('//')
+   Contributed by Gordon Mohr gojomo at archive.org
+   
  * [HTTPCLIENT-587] - Fixed incorrect derelativizing of relative URIs with a 
scheme
Contributed by Gordon Mohr gojomo at archive.org


Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java?rev=415961r1=415960r2=415961view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
 Wed Jun 21 04:05:19 2006
@@ -1919,7 +1919,8 @@
 boolean isStartedFromPath = false;
 int atColon = tmp.indexOf(':');
 int atSlash = tmp.indexOf('/');
-if (atColon = 0 || (atSlash = 0  atSlash  atColon)) {
+if ((atColon = 0  !tmp.startsWith(//))
+|| (atSlash = 0  atSlash  atColon)) {
 isStartedFromPath = true;
 }
 
@@ -1965,7 +1966,8 @@
 if (0 = at  at  length  tmp.charAt(at) == '/') {
 // Set flag
 _is_hier_part = true;
-if (at + 2  length  tmp.charAt(at + 1) == '/') {
+if (at + 2  length  tmp.charAt(at + 1) == '/' 
+ !isStartedFromPath) {
 // the temporary index to start the search from
 int next = indexFirstOf(tmp, /?#, at + 2);
 if (next == -1) {

Modified: 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java?rev=415961r1=415960r2=415961view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java
 Wed Jun 21 04:05:19 2006
@@ -296,4 +296,17 @@
 URI derel3 = new URI(base,rel3);
 assertEquals(http://www.example.com/bar,derel3.toString());
 }
+
+/**
+ * Verify proper handling of relative URIs with embedded double-slashes,
+ * like foo//bar//baz. 
+ * See bug http://issues.apache.org/jira/browse/HTTPCLIENT-588
+ * 
+ * @throws Exception
+ */
+public void testRelativeWithDoubleSlash() throws Exception {
+URI rel = new URI(foo//bar//baz,true);
+assertEquals(foo//bar//baz,rel.toString());
+}
+
 }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r414231 - /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java

2006-06-14 Thread olegk
Author: olegk
Date: Wed Jun 14 06:01:48 2006
New Revision: 414231

URL: http://svn.apache.org/viewvc?rev=414231view=rev
Log:
[HTTPCLIENT-552] Add shutdown method to SimpleHttpConnectionManager

Contributed by Oleg Kalnichevski
Reviewed by Michael Becke and Sebastian Bazley

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java?rev=414231r1=414230r2=414231view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java
 Wed Jun 14 06:01:48 2006
@@ -272,4 +272,12 @@
 httpConnection.close();
 }
 }
+
+/**
+ * since 3.1
+ */
+public void shutdown() {
+httpConnection.close();
+}
+
 }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r413837 - /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java

2006-06-13 Thread olegk
Author: olegk
Date: Tue Jun 13 01:35:00 2006
New Revision: 413837

URL: http://svn.apache.org/viewvc?rev=413837view=rev
Log:
[HTTPCLIENT-420] Provide a non-pooling connection manager

Changelog:
Added an option to the simple connection manager to disable connection 
persistence

Contributed by Oleg Kalnichevski
Reviewed by Roland Weber and Michael Becke

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java?rev=413837r1=413836r2=413837view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java
 Tue Jun 13 01:35:00 2006
@@ -71,7 +71,6 @@
 try {
 lastResponse.close();
 } catch (IOException ioe) {
-//FIXME: badness - close to force reconnect.
 conn.close();
 }
 }
@@ -97,8 +96,29 @@
  * It will not be used to enforce thread safety.
  */
 private volatile boolean inUse = false;
+
+private boolean alwaysClose = false;
+
+/**
+ * The connection manager created with this constructor will try to keep 
the 
+ * connection open (alive) between consecutive requests if the alwaysClose 
+ * parameter is set to ttfalse/tt. Otherwise the connection manager 
will 
+ * always close connections upon release.
+ * 
+ * @param alwaysClose if set tttrue/tt, the connection manager will 
always
+ *close connections upon release.
+ */
+public SimpleHttpConnectionManager(boolean alwaysClose) {
+super();
+this.alwaysClose = alwaysClose;
+}
 
+/**
+ * The connection manager created with this constructor will always try to 
keep 
+ * the connection open (alive) between consecutive requests.
+ */
 public SimpleHttpConnectionManager() {
+super();
 }
 
 /**
@@ -203,8 +223,12 @@
 if (conn != httpConnection) {
 throw new IllegalStateException(Unexpected release of an unknown 
connection.);
 }
-
-finishLastResponse(httpConnection);
+if (this.alwaysClose) {
+httpConnection.close();
+} else {
+// make sure the connection is reuseable
+finishLastResponse(httpConnection);
+}
 
 inUse = false;
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r413446 - /jakarta/commons/proper/httpclient/trunk/DEPENDENCIES.txt

2006-06-11 Thread olegk
Author: olegk
Date: Sun Jun 11 06:46:49 2006
New Revision: 413446

URL: http://svn.apache.org/viewvc?rev=413446view=rev
Log:
Included a description where to put the jar files for building and testing

Contributed by Sebastian Bazley sebb at apache.org

Modified:
jakarta/commons/proper/httpclient/trunk/DEPENDENCIES.txt

Modified: jakarta/commons/proper/httpclient/trunk/DEPENDENCIES.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/DEPENDENCIES.txt?rev=413446r1=413445r2=413446view=diff
==
--- jakarta/commons/proper/httpclient/trunk/DEPENDENCIES.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/DEPENDENCIES.txt Sun Jun 11 
06:46:49 2006
@@ -5,4 +5,15 @@
 * JCE 1.2.2 when running in JRE  1.4 (optional)
 * Commons Logging 1.0.0 or above 
 * Commons Codec 1.2.0 or above
+* junit (unit testing only)
 
+For building httpclient:
+---
+Create the lib directory if necessary, and add the following to the lib 
directory:
+* commons-codec.jar
+* commons-logging.jar
+
+For testing httpclient:
+--
+Create the lib directory if necessary, and add the following to the lib 
directory:
+* junit.jar



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r413447 - /jakarta/commons/proper/httpclient/trunk/project.xml

2006-06-11 Thread olegk
Author: olegk
Date: Sun Jun 11 06:49:35 2006
New Revision: 413447

URL: http://svn.apache.org/viewvc?rev=413447view=rev
Log:
Added Sebastian Bazley to the list of Commons HttpClient contributors

Modified:
jakarta/commons/proper/httpclient/trunk/project.xml

Modified: jakarta/commons/proper/httpclient/trunk/project.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/project.xml?rev=413447r1=413446r2=413447view=diff
==
--- jakarta/commons/proper/httpclient/trunk/project.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/project.xml Sun Jun 11 06:49:35 2006
@@ -241,6 +241,10 @@
   emailarmando.anton -at- newknow.com/email
 /contributor
 contributor
+  nameSebastian Bazley/name
+  emailsebb -at- apache.org/email
+/contributor
+contributor
   nameOla Berg/name
   email/email
 /contributor



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r413458 - /jakarta/commons/proper/httpclient/trunk/release_notes.txt

2006-06-11 Thread olegk
Author: olegk
Date: Sun Jun 11 07:42:23 2006
New Revision: 413458

URL: http://svn.apache.org/viewvc?rev=413458view=rev
Log:
Replaced Bugzilla ticket numbers with the corresponding Jira ticket numbers

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?rev=413458r1=413457r2=413458view=diff
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Sun Jun 11 
07:42:23 2006
@@ -6,18 +6,18 @@
  * [HTTPCLIENT-582] - Allow access to registered cookie policies
Contributed by Sebastian Bazley sebb at apache.org
 
- * 19102 - Added support for Set-Cookie2 response headers
+ * [HTTPCLIENT-189] - Added support for Set-Cookie2 response headers
Contributed by Samit Jain jain.samit at gmail.com
 
- * 10813 - Implemented RFC 2965 cookie spec (Cookie2); Added support for port 
+ * [HTTPCLIENT-66] - Implemented RFC 2965 cookie spec (Cookie2); Added support 
for port 
sensitive cookies
Contributed by Samit Jain jain.samit at gmail.com
 
- * 36918 - Digest auth scheme now uses correct digest uri in HTTP CONNECT 
+ * [HTTPCLIENT-506] - Digest auth scheme now uses correct digest uri in HTTP 
CONNECT 
requests
Contributed by Oleg Kalnichevski olegk at apache.org
 
- * 38818 - Failed CONNECT no longer leaves connection in an inconsistent state
+ * [HTTPCLIENT-570] - Failed CONNECT no longer leaves connection in an 
inconsistent state
Contributed by Oleg Kalnichevski olegk at apache.org
 
 Release 3.0.1



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r413281 - in /jakarta/commons/proper/httpclient/trunk: ./ src/java/org/apache/commons/httpclient/ src/test/org/apache/commons/httpclient/

2006-06-10 Thread olegk
Author: olegk
Date: Sat Jun 10 03:36:20 2006
New Revision: 413281

URL: http://svn.apache.org/viewvc?rev=413281view=rev
Log:
[HTTPCLIENT-494] Invalid redirects are not corrected

Changelog:
Invalid redirect location now causes a protocol exception

Contributed by Ortwin Glück and Oleg Kalnichevski
Reviewed by Roland Weber

Added:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/InvalidRedirectLocationException.java
   (with props)
Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestRedirects.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?rev=413281r1=413280r2=413281view=diff
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Sat Jun 10 
03:36:20 2006
@@ -1,5 +1,8 @@
 Changes toward 3.1 
 
+ * [HTTPCLIENT-494] - Invalid redirect location now causes a protocol exception
+   Contributed by Oleg Kalnichevski olegk at apache.org
+   
  * [HTTPCLIENT-582] - Allow access to registered cookie policies
Contributed by Sebastian Bazley sebb at apache.org
 

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java?rev=413281r1=413280r2=413281view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
 Sat Jun 10 03:36:20 2006
@@ -611,9 +611,9 @@
 }
 method.setURI(redirectUri);
 hostConfiguration.setHost(redirectUri);
-   } catch (URIException e) {
-   LOG.warn(Redirected location ' + location + ' is 
malformed);
-   return false;
+   } catch (URIException ex) {
+throw new InvalidRedirectLocationException(
+Invalid redirect location:  + location, location, ex);
}
 
 if 
(this.params.isParameterFalse(HttpClientParams.ALLOW_CIRCULAR_REDIRECTS)) {

Added: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/InvalidRedirectLocationException.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/InvalidRedirectLocationException.java?rev=413281view=auto
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/InvalidRedirectLocationException.java
 (added)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/InvalidRedirectLocationException.java
 Sat Jun 10 03:36:20 2006
@@ -0,0 +1,73 @@
+/*
+ * $HeadRL$
+ * $Revision$
+ * $Date$
+ *
+ * 
+ *
+ *  Copyright 1999-2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the License);
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an AS IS BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * http://www.apache.org/.
+ *
+ */
+
+package org.apache.commons.httpclient;
+
+/**
+ * Signals violation of HTTP specification caused by an invalid redirect
+ * location
+ * 
+ * @author a href=mailto:oleg at ural.ruOleg Kalnichevski/a
+ * 
+ * @since 3.1
+ */
+public class InvalidRedirectLocationException extends RedirectException {
+
+private final String location

svn commit: r413369 - in /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient: MultiThreadedHttpConnectionManager.java SimpleHttpConnectionManager.java

2006-06-10 Thread olegk
Author: olegk
Date: Sat Jun 10 15:07:56 2006
New Revision: 413369

URL: http://svn.apache.org/viewvc?rev=413369view=rev
Log:
[HTTPCLIENT-553] JavaDoc getConnection methods in Connection Managers

Contributed by Oleg Kalnichevski

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/MultiThreadedHttpConnectionManager.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/MultiThreadedHttpConnectionManager.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/MultiThreadedHttpConnectionManager.java?rev=413369r1=413368r2=413369view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/MultiThreadedHttpConnectionManager.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/MultiThreadedHttpConnectionManager.java
 Sat Jun 10 15:07:56 2006
@@ -373,7 +373,20 @@
 }
 
 /**
- * @see HttpConnectionManager#getConnectionWithTimeout(HostConfiguration, 
long)
+ * Gets a connection or waits if one is not available.  A connection is
+ * available if one exists that is not being used or if fewer than
+ * maxHostConnections have been created in the connectionPool, and fewer
+ * than maxTotalConnections have been created in all connectionPools.
+ *
+ * @param hostConfiguration The host configuration specifying the 
connection
+ *details.
+ * @param timeout the number of milliseconds to wait for a connection, 0 to
+ * wait indefinitely
+ *
+ * @return HttpConnection an available connection
+ *
+ * @throws HttpException if a connection does not become available in
+ * 'timeout' milliseconds
  * 
  * @since 3.0
  */
@@ -414,21 +427,6 @@
}
}
 
-/**
- * Gets a connection or waits if one is not available.  A connection is
- * available if one exists that is not being used or if fewer than
- * maxHostConnections have been created in the connectionPool, and fewer
- * than maxTotalConnections have been created in all connectionPools.
- *
- * @param hostConfiguration The host configuration.
- * @param timeout the number of milliseconds to wait for a connection, 0 to
- * wait indefinitely
- *
- * @return HttpConnection an available connection
- *
- * @throws HttpException if a connection does not become available in
- * 'timeout' milliseconds
- */
 private HttpConnection doGetConnection(HostConfiguration 
hostConfiguration, 
 long timeout) throws ConnectionPoolTimeoutException {
 

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java?rev=413369r1=413368r2=413369view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/SimpleHttpConnectionManager.java
 Sat Jun 10 15:07:56 2006
@@ -138,8 +138,13 @@
 }
 
 /**
- * @see HttpConnectionManager#getConnectionWithTimeout(HostConfiguration, 
long)
+ * This method always returns the same connection object. If the 
connection is already
+ * open, it will be closed and the new host configuration will be applied.
  * 
+ * @param hostConfiguration The host configuration specifying the 
connection
+ *details.
+ * @param timeout this parameter has no effect. The connection is always 
returned
+ *immediately.
  * @since 3.0
  */
 public HttpConnection getConnectionWithTimeout(



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r413050 - /jakarta/commons/proper/httpclient/trunk/lib/

2006-06-09 Thread olegk
Author: olegk
Date: Fri Jun  9 07:01:38 2006
New Revision: 413050

URL: http://svn.apache.org/viewvc?rev=413050view=rev
Log:
Removed lib directory and its content

Removed:
jakarta/commons/proper/httpclient/trunk/lib/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r413051 - /jakarta/commons/proper/httpclient/trunk/

2006-06-09 Thread olegk
Author: olegk
Date: Fri Jun  9 07:03:39 2006
New Revision: 413051

URL: http://svn.apache.org/viewvc?rev=413051view=rev
Log:
[HTTPCLIENT-584] Added lib to the svn:ignore list

Modified:
jakarta/commons/proper/httpclient/trunk/   (props changed)

Propchange: jakarta/commons/proper/httpclient/trunk/
--
--- svn:ignore (original)
+++ svn:ignore Fri Jun  9 07:03:39 2006
@@ -10,3 +10,4 @@
 classes
 log4j-tests.properties
 .settings
+lib



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r413108 - /jakarta/commons/proper/httpclient/trunk/DEPENDENCIES.txt

2006-06-09 Thread olegk
Author: olegk
Date: Fri Jun  9 10:54:25 2006
New Revision: 413108

URL: http://svn.apache.org/viewvc?rev=413108view=rev
Log:
[HTTPCLIENT-584] Added a list of HttpClient 3.x dependencies (primarily for 
Maven shy users)

Added:
jakarta/commons/proper/httpclient/trunk/DEPENDENCIES.txt   (with props)

Added: jakarta/commons/proper/httpclient/trunk/DEPENDENCIES.txt
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/DEPENDENCIES.txt?rev=413108view=auto
==
--- jakarta/commons/proper/httpclient/trunk/DEPENDENCIES.txt (added)
+++ jakarta/commons/proper/httpclient/trunk/DEPENDENCIES.txt Fri Jun  9 
10:54:25 2006
@@ -0,0 +1,8 @@
+HttpClient 3.x requires
+---
+* JRE 1.2.2 or above
+* JSSE 1.0.3 when running in JRE  1.4 (optional)
+* JCE 1.2.2 when running in JRE  1.4 (optional)
+* Commons Logging 1.0.0 or above 
+* Commons Codec 1.2.0 or above
+

Propchange: jakarta/commons/proper/httpclient/trunk/DEPENDENCIES.txt
--
svn:eol-style = native

Propchange: jakarta/commons/proper/httpclient/trunk/DEPENDENCIES.txt
--
svn:keywords = Date Author Id Revision HeadURL

Propchange: jakarta/commons/proper/httpclient/trunk/DEPENDENCIES.txt
--
svn:mime-type = text/plain



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r413112 - /jakarta/commons/proper/httpclient/trunk/project.properties

2006-06-09 Thread olegk
Author: olegk
Date: Fri Jun  9 11:06:06 2006
New Revision: 413112

URL: http://svn.apache.org/viewvc?rev=413112view=rev
Log:
Explicitly set compile source and target levels to 1.2

Modified:
jakarta/commons/proper/httpclient/trunk/project.properties

Modified: jakarta/commons/proper/httpclient/trunk/project.properties
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/project.properties?rev=413112r1=413111r2=413112view=diff
==
--- jakarta/commons/proper/httpclient/trunk/project.properties (original)
+++ jakarta/commons/proper/httpclient/trunk/project.properties Fri Jun  9 
11:06:06 2006
@@ -1,5 +1,9 @@
 # Maven specific project properties
 
+maven.compile.source=1.2
+maven.compile.target=1.2
+maven.compile.debug=false
+
 maven.xdoc.date=left
 maven.xdoc.version=${pom.currentVersion}
 maven.checkstyle.properties=checkstyle.xml.properties



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r413119 - /jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml

2006-06-09 Thread olegk
Author: olegk
Date: Fri Jun  9 11:20:14 2006
New Revision: 413119

URL: http://svn.apache.org/viewvc?rev=413119view=rev
Log:
Synced with the HTTPCLIENT_3_0 branch

Modified:
jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml

Modified: jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml?rev=413119r1=413118r2=413119view=diff
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/downloads.xml Fri Jun  9 
11:20:14 2006
@@ -14,7 +14,7 @@
  The following releases are avilable for download:
/p
ul
- li3.0 - 19 December 2005 - 
+ li3.0.1 - 08 May 2006 - 
 a 
href=http://jakarta.apache.org/site/downloads/downloads_commons-httpclient.cgi;Download/a
 - a 
  
href=http://www.apache.org/dist/jakarta/commons/httpclient/RELEASE-NOTES.txt;
  Release notes/a/li
@@ -30,7 +30,6 @@
/p
ul
liSTABLE 3.0 brecommended/b - a 
href=http://svn.apache.org/builds/jakarta-commons/nightly/commons-httpclient/;latest
 from HEAD(3.0)/a - bPlease note that this code is not API compatible with 
2.0./b/li
-   liSTABLE 2.0 - a 
href=http://svn.apache.org/builds/jakarta-commons/nightly/commons-httpclient2/;latest
 from the 2.0 branch/a/li
/ul
p
  The latest a href=http://jakarta.apache.org/gump/;Gump/a 
generated binary
@@ -46,21 +45,23 @@
/p
p
  If you are using Maven for your project, you can create a dependency 
in your
- project.xml with one of the following blocks:/p
+ project.xml with one of the following:/p
+b3.0.1/b
  source![CDATA[
 dependency
 groupIdcommons-httpclient/groupId
 artifactIdcommons-httpclient/artifactId
-version3.0/version
+version3.0.1/version
 urlhttp://jakarta.apache.org/commons/httpclient//url
 /dependency
  ]]/source
+b2.0.2/b
  source![CDATA[
 dependency
 groupIdcommons-httpclient/groupId
 artifactIdcommons-httpclient/artifactId
 version2.0.2/version
-urlhttp://jakarta.apache.org/commons/httpclient/2.0//url
+urlhttp://jakarta.apache.org/commons/httpclient//url
 /dependency
  ]]/source
pThere are also other jar versions available.  You can check



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r412047 - in /jakarta/commons/proper/httpclient/trunk/src: java/org/apache/commons/httpclient/methods/ test/org/apache/commons/httpclient/ test/org/apache/commons/httpclient/auth/

2006-06-06 Thread olegk
Author: olegk
Date: Tue Jun  6 01:50:08 2006
New Revision: 412047

URL: http://svn.apache.org/viewvc?rev=412047view=rev
Log:
[HTTPCLIENT-536] misleading lack of javadoc in StringRequestEntity

Contributed by Oleg Kalnichevski
Reviewed by Roland Weber

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/EntityEnclosingMethod.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestConnectionPersistence.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestEntityEnclosingMethod.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestNoncompliant.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestPostMethod.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestPostParameterEncoding.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestProxy.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestRedirects.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/auth/TestBasicAuth.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/EntityEnclosingMethod.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/EntityEnclosingMethod.java?rev=412047r1=412046r2=412047view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/EntityEnclosingMethod.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/EntityEnclosingMethod.java
 Tue Jun  6 01:50:08 2006
@@ -189,8 +189,11 @@
 if (LOG.isWarnEnabled()) {
 LOG.warn(charset +  not supported);
 }
-this.requestEntity = new StringRequestEntity(
-requestString);
+try {
+this.requestEntity = new StringRequestEntity(
+requestString, null, null);
+} catch (UnsupportedEncodingException ignore) {
+}
 }
 }
 

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java?rev=412047r1=412046r2=412047view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java
 Tue Jun  6 01:50:08 2006
@@ -1,5 +1,5 @@
 /*
- * $Header: 
/home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java,v
 1.3 2004/07/03 14:27:03 olegk Exp $
+ * $HeadURL$
  * $Revision$
  * $Date$
  *
@@ -58,16 +58,11 @@
  * will use the default platform charset to convert the content string 
  * and will provide no content type./p
  *  
- * pThis constructor may be deprecated or changed to use the 
- * default HTTP content charset (ISO-8859-1) in the release 3.1/p
- * 
- * pIt is strongly recommended to use 
- * [EMAIL PROTECTED] #StringRequestEntity(String, String, String)} 
constructor 
- * instead./p
- * 
  * @see #StringRequestEntity(String, String, String)
  * 
  * @param content The content to set.
+ * 
+ * @deprecated use [EMAIL PROTECTED] #StringRequestEntity(String, String, 
String)} instead
  */
 public StringRequestEntity(String content) {
 super();

Modified: 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestConnectionPersistence.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestConnectionPersistence.java?rev=412047r1=412046r2=412047view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestConnectionPersistence.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestConnectionPersistence.java
 Tue Jun  6 01:50:08 2006
@@ -78,7 +78,7 @@
 this.client.setHttpConnectionManager(connman);
 
 PostMethod httppost = new

svn commit: r410820 - in /jakarta/commons/proper/httpclient/trunk/src: contrib/org/apache/commons/httpclient/contrib/benchmark/ java/org/apache/commons/httpclient/methods/

2006-06-01 Thread olegk
Author: olegk
Date: Thu Jun  1 03:01:33 2006
New Revision: 410820

URL: http://svn.apache.org/viewvc?rev=410820view=rev
Log:
Added FileRequestEntity class

Added:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/FileRequestEntity.java
  - copied, changed from r410366, 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/FileRequestEntity.java
Removed:

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/FileRequestEntity.java
Modified:

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/HttpBenchmark.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/HttpBenchmark.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/HttpBenchmark.java?rev=410820r1=410819r2=410820view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/HttpBenchmark.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/HttpBenchmark.java
 Thu Jun  1 03:01:33 2006
@@ -41,6 +41,7 @@
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.HttpVersion;
+import org.apache.commons.httpclient.methods.FileRequestEntity;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.commons.httpclient.methods.HeadMethod;
 import org.apache.commons.httpclient.methods.PostMethod;

Copied: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/FileRequestEntity.java
 (from r410366, 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/FileRequestEntity.java)
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/FileRequestEntity.java?p2=jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/FileRequestEntity.javap1=jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/FileRequestEntity.javar1=410366r2=410820rev=410820view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/FileRequestEntity.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/FileRequestEntity.java
 Thu Jun  1 03:01:33 2006
@@ -26,7 +26,7 @@
  * http://www.apache.org/.
  *
  */
-package org.apache.commons.httpclient.contrib.benchmark;
+package org.apache.commons.httpclient.methods;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -36,6 +36,11 @@
 
 import org.apache.commons.httpclient.methods.RequestEntity;
 
+/**
+ * A RequestEntity that represents a File.
+ * 
+ * @since 3.1
+ */
 public class FileRequestEntity implements RequestEntity {
 
 final File file;



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r410827 - /jakarta/commons/proper/httpclient/trunk/src/examples/PostSOAP.java

2006-06-01 Thread olegk
Author: olegk
Date: Thu Jun  1 03:36:25 2006
New Revision: 410827

URL: http://svn.apache.org/viewvc?rev=410827view=rev
Log:
Added PostSOAP example

Contributed by Paul King paulk at asert.com.au

Added:
jakarta/commons/proper/httpclient/trunk/src/examples/PostSOAP.java   (with 
props)

Added: jakarta/commons/proper/httpclient/trunk/src/examples/PostSOAP.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/examples/PostSOAP.java?rev=410827view=auto
==
--- jakarta/commons/proper/httpclient/trunk/src/examples/PostSOAP.java (added)
+++ jakarta/commons/proper/httpclient/trunk/src/examples/PostSOAP.java Thu Jun  
1 03:36:25 2006
@@ -0,0 +1,102 @@
+/*
+ * $Header$
+ * $Revision$
+ * $Date$
+ * 
+ *
+ *  Copyright 2002-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the License);
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an AS IS BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * http://www.apache.org/.
+ */
+
+import java.io.File;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.FileRequestEntity;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.RequestEntity;
+
+/**
+ *
+ * This is a sample application that demonstrates
+ * how to use the Jakarta HttpClient API.
+ *
+ * This application sends an XML document
+ * to a remote web server using HTTP POST
+ *
+ * @author Sean C. Sullivan
+ * @author Ortwin Glueck
+ * @author Oleg Kalnichevski
+ * @author Paul King
+ */
+public class PostSOAP {
+
+/**
+ *
+ * Usage:
+ *  java PostSOAP http://mywebserver:80/ SOAPAction c:\foo.xml
+ *
+ *  @param args command line arguments
+ * Argument 0 is a URL to a web server
+ * Argument 1 is the SOAP Action
+ * Argument 2 is a local filename
+ *
+ */
+public static void main(String[] args) throws Exception {
+if (args.length != 3) {
+System.out.println(Usage: java -classpath classpath 
[-Dorg.apache.commons.logging.simplelog.defaultlog=loglevel] PostSOAP url 
soapaction filename]);
+System.out.println(classpath - must contain the 
commons-httpclient.jar and commons-logging.jar);
+System.out.println(loglevel - one of error, warn, info, debug, 
trace);
+System.out.println(url - the URL to post the file to);
+System.out.println(soapaction - the SOAP action header value);
+System.out.println(filename - file to post to the URL);
+System.out.println();
+System.exit(1);
+}
+// Get target URL
+String strURL = args[0];
+// Get SOAP action
+String strSoapAction = args[1];
+// Get file to be posted
+String strXMLFilename = args[2];
+File input = new File(strXMLFilename);
+// Prepare HTTP post
+PostMethod post = new PostMethod(strURL);
+// Request content will be retrieved directly
+// from the input stream
+RequestEntity entity = new FileRequestEntity(input, text/xml; 
charset=ISO-8859-1);
+post.setRequestEntity(entity);
+// consult documentation for your web service
+post.setRequestHeader(SOAPAction, strSoapAction);
+// Get HTTP client
+HttpClient httpclient = new HttpClient();
+// Execute request
+try {
+int result = httpclient.executeMethod(post);
+// Display status code
+System.out.println(Response status code:  + result);
+// Display response
+System.out.println(Response body: );
+System.out.println(post.getResponseBodyAsString());
+} finally {
+// Release current connection to the connection pool once you are 
done
+post.releaseConnection();
+}
+}
+}

Propchange: jakarta/commons/proper/httpclient/trunk/src/examples/PostSOAP.java
--
svn:eol-style = native

Propchange: jakarta/commons/proper

svn commit: r410848 - /jakarta/commons/proper/httpclient/trunk/src/examples/PostXML.java

2006-06-01 Thread olegk
Author: olegk
Date: Thu Jun  1 04:57:39 2006
New Revision: 410848

URL: http://svn.apache.org/viewvc?rev=410848view=rev
Log:
Replaced InputStreamRequestEntity with repeatable FileRequestEntity

Modified:
jakarta/commons/proper/httpclient/trunk/src/examples/PostXML.java

Modified: jakarta/commons/proper/httpclient/trunk/src/examples/PostXML.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/examples/PostXML.java?rev=410848r1=410847r2=410848view=diff
==
--- jakarta/commons/proper/httpclient/trunk/src/examples/PostXML.java (original)
+++ jakarta/commons/proper/httpclient/trunk/src/examples/PostXML.java Thu Jun  
1 04:57:39 2006
@@ -29,11 +29,11 @@
  */
 
 import java.io.File;
-import java.io.FileInputStream;
 
 import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
+import org.apache.commons.httpclient.methods.FileRequestEntity;
 import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.RequestEntity;
 
 /**
  *
@@ -44,7 +44,7 @@
  * to a remote web server using HTTP POST
  *
  * @author Sean C. Sullivan
- * @author Ortwin Glück
+ * @author Ortwin Glueck
  * @author Oleg Kalnichevski
  */
 public class PostXML {
@@ -76,18 +76,10 @@
 File input = new File(strXMLFilename);
 // Prepare HTTP post
 PostMethod post = new PostMethod(strURL);
-// Request content will be retrieved directly 
+// Request content will be retrieved directly
 // from the input stream
-// Per default, the request content needs to be buffered
-// in order to determine its length.
-// Request body buffering can be avoided when
-// content length is explicitly specified
-post.setRequestEntity(new InputStreamRequestEntity(
-new FileInputStream(input), input.length()));
-// Specify content type and encoding
-// If content encoding is not explicitly specified
-// ISO-8859-1 is assumed
-post.setRequestHeader(Content-type, text/xml; charset=ISO-8859-1);
+RequestEntity entity = new FileRequestEntity(input, text/xml; 
charset=ISO-8859-1);
+post.setRequestEntity(entity);
 // Get HTTP client
 HttpClient httpclient = new HttpClient();
 // Execute request



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r410364 - /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java

2006-05-30 Thread olegk
Author: olegk
Date: Tue May 30 13:23:59 2006
New Revision: 410364

URL: http://svn.apache.org/viewvc?rev=410364view=rev
Log:
Removed superfluous log message

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java?rev=410364r1=410363r2=410364view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
 Tue May 30 13:23:59 2006
@@ -815,8 +815,6 @@
 if (method.getFollowRedirects()) {
 return true;
 } else {
-LOG.info(Redirect requested but followRedirects is 
-+ disabled);
 return false;
 }
default:



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r410367 - in /jakarta/commons/proper/httpclient/trunk/src: java/org/apache/commons/httpclient/URI.java test/org/apache/commons/httpclient/TestURI.java

2006-05-30 Thread olegk
Author: olegk
Date: Tue May 30 13:40:11 2006
New Revision: 410367

URL: http://svn.apache.org/viewvc?rev=410367view=rev
Log:
Fix for HTTPCLIENT-578: literal plus (+) character in path components of 
HttpURL is not preserved

Contributed by Jeremy Norris jnorris10 at gmail.com

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java?rev=410367r1=410366r2=410367view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
 Tue May 30 13:40:11 2006
@@ -1552,6 +1552,7 @@
 allowed_abs_path.or(abs_path);
 // allowed_abs_path.set('/');  // aleady included
 allowed_abs_path.andNot(percent);
+allowed_abs_path.clear('+');
 }
 
 
@@ -1563,6 +1564,7 @@
 static {
 allowed_rel_path.or(rel_path);
 allowed_rel_path.clear('%');
+allowed_rel_path.clear('+');
 }
 
 

Modified: 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java?rev=410367r1=410366r2=410367view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java
 Tue May 30 13:40:11 2006
@@ -252,5 +252,10 @@
 assertEquals(escaped, new String(u2.getRawURI()));
 assertEquals(unescaped, u2.getURI());
 }
+
+public void testBug578() throws Exception {
+HttpURL url = new HttpURL(http://localhost/test+test;);
+assertEquals(/test+test, url.getPath());
+}
 
 }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r410372 - /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java

2006-05-30 Thread olegk
Author: olegk
Date: Tue May 30 13:59:24 2006
New Revision: 410372

URL: http://svn.apache.org/viewvc?rev=410372view=rev
Log:
Fix for HTTPCLIENT-533: CookiePolicy.registerCookieSpec(CookiePolicy.DEFAULT, 
Some CookieSpec); does not work as documented

Contributed by Ortwin Glück
Reviewed by Oleg Kalnichevski

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java?rev=410372r1=410371r2=410372view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
 Tue May 30 13:59:24 2006
@@ -69,7 +69,7 @@
 params.setParameter(HttpMethodParams.USER_AGENT, Jakarta 
Commons-HttpClient/3.0);
 params.setVersion(HttpVersion.HTTP_1_1);
 params.setConnectionManagerClass(SimpleHttpConnectionManager.class);
-params.setCookiePolicy(CookiePolicy.RFC_2109);
+params.setCookiePolicy(CookiePolicy.DEFAULT);
 params.setHttpElementCharset(US-ASCII);
 params.setContentCharset(ISO-8859-1);
 params.setParameter(HttpMethodParams.RETRY_HANDLER, new 
DefaultHttpMethodRetryHandler());



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r406658 - in /jakarta/commons/proper/httpclient/trunk: project.xml xdocs/news.xml

2006-05-15 Thread olegk
Author: olegk
Date: Mon May 15 08:41:23 2006
New Revision: 406658

URL: http://svn.apache.org/viewcvs?rev=406658view=rev
Log:
Issue management migrated to Jira

Modified:
jakarta/commons/proper/httpclient/trunk/project.xml
jakarta/commons/proper/httpclient/trunk/xdocs/news.xml

Modified: jakarta/commons/proper/httpclient/trunk/project.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/project.xml?rev=406658r1=406657r2=406658view=diff
==
--- jakarta/commons/proper/httpclient/trunk/project.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/project.xml Mon May 15 08:41:23 2006
@@ -24,7 +24,7 @@
 
   logo/images/httpclient_logo.png/logo
   urlhttp://jakarta.apache.org/commons/httpclient//url
-  
issueTrackingUrl![CDATA[http://issues.apache.org/bugzilla/buglist.cgi?query_format=advancedshort_desc_type=allwordssubstrshort_desc=product=HttpClientcomponent=Commons+HttpClientlong_desc_type=allwordssubstrlong_desc=bug_file_loc_type=allwordssubstrbug_file_loc=keywords_type=anywordskeywords=bug_status=UNCONFIRMEDbug_status=NEWbug_status=ASSIGNEDbug_status=REOPENEDbug_status=NEEDINFOemailassigned_to1=1emailtype1=substringemail1=emailreporter2=1emailtype2=substringemail2=bugidtype=includebug_id=votes=chfieldfrom=chfieldto=Nowchfieldvalue=cmdtype=doitorder=Reuse+same+sort+as+last+timefield0-0-0=nooptype0-0-0=noopvalue0-0-0=]]/issueTrackingUrl
+  
issueTrackingUrlhttp://issues.apache.org/jira/browse/HTTPCLIENT/issueTrackingUrl
 
   siteAddresspeople.apache.org/siteAddress
   siteDirectory/www/jakarta.apache.org/commons/httpclient//siteDirectory

Modified: jakarta/commons/proper/httpclient/trunk/xdocs/news.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/xdocs/news.xml?rev=406658r1=406657r2=406658view=diff
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/news.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/news.xml Mon May 15 08:41:23 
2006
@@ -10,6 +10,22 @@
   /properties
 
   body
+section name=12 May 2006 - HttpClient issue tracking migrated to 
Jira
+p
+  HttpClient issue tracking has migrated from Bugzilla to Jira. 
Please do not enter new bug reports 
+  and update exiting ones in Bugzilla. HttpComponents project will 
be using 
+  a href=http://issues.apache.org/jira/;Jira/a to manage 
HttpClient related issues as of today. 
+  Please use  a 
href=http://issues.apache.org/jira/browse/HTTPCLIENT;this project/a in Jira 
to 
+  report new issues against HttpClient and search for reported 
ones. All existing issue reports can 
+  be accessed in Jira by their original Bugzilla bug id.
+/p
+/section
+section name=08 May 2006 - HttpClient 3.0.1 released
+p
+  HttpClient 3.0.1 has been released. This version fixes a number 
of bugs found since the release of 3.0. 
+  All HttpClient users are encouraged to upgrade.
+/p
+/section
 section name=27 February 2006 - HttpClient 2.x codebase declared 
'End of Life'
 p
 HttpClient 2.x will no longer be supported. There will be no 
more HttpClient 2.x releases



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r406662 - /jakarta/commons/proper/httpclient/trunk/project.xml

2006-05-15 Thread olegk
Author: olegk
Date: Mon May 15 09:08:33 2006
New Revision: 406662

URL: http://svn.apache.org/viewcvs?rev=406662view=rev
Log:
Added 3.0.1 release version

Modified:
jakarta/commons/proper/httpclient/trunk/project.xml

Modified: jakarta/commons/proper/httpclient/trunk/project.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/project.xml?rev=406662r1=406661r2=406662view=diff
==
--- jakarta/commons/proper/httpclient/trunk/project.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/project.xml Mon May 15 09:08:33 2006
@@ -34,6 +34,11 @@
   /repository
   versions
 version
+  id3.0.1/id
+  name3.0.1/name
+  tagHTTPCLIENT_3_0_1/tag
+/version
+version
   id3.0/id
   name3.0/name
   tagHTTPCLIENT_3_0/tag



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r406665 - /jakarta/commons/proper/httpclient/branches/HTTPCLIENT_3_0_BRANCH/project.xml

2006-05-15 Thread olegk
Author: olegk
Date: Mon May 15 09:18:12 2006
New Revision: 406665

URL: http://svn.apache.org/viewcvs?rev=406665view=rev
Log:
Issue management migrated to Jira

Modified:
jakarta/commons/proper/httpclient/branches/HTTPCLIENT_3_0_BRANCH/project.xml

Modified: 
jakarta/commons/proper/httpclient/branches/HTTPCLIENT_3_0_BRANCH/project.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/HTTPCLIENT_3_0_BRANCH/project.xml?rev=406665r1=406664r2=406665view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/HTTPCLIENT_3_0_BRANCH/project.xml 
(original)
+++ 
jakarta/commons/proper/httpclient/branches/HTTPCLIENT_3_0_BRANCH/project.xml 
Mon May 15 09:18:12 2006
@@ -24,7 +24,7 @@
 
   logo/images/httpclient_logo.png/logo
   urlhttp://jakarta.apache.org/commons/httpclient//url
-  
issueTrackingUrl![CDATA[http://issues.apache.org/bugzilla/buglist.cgi?query_format=advancedshort_desc_type=allwordssubstrshort_desc=product=HttpClientcomponent=Commons+HttpClientlong_desc_type=allwordssubstrlong_desc=bug_file_loc_type=allwordssubstrbug_file_loc=keywords_type=anywordskeywords=bug_status=UNCONFIRMEDbug_status=NEWbug_status=ASSIGNEDbug_status=REOPENEDbug_status=NEEDINFOemailassigned_to1=1emailtype1=substringemail1=emailreporter2=1emailtype2=substringemail2=bugidtype=includebug_id=votes=chfieldfrom=chfieldto=Nowchfieldvalue=cmdtype=doitorder=Reuse+same+sort+as+last+timefield0-0-0=nooptype0-0-0=noopvalue0-0-0=]]/issueTrackingUrl
+  
issueTrackingUrlhttp://issues.apache.org/jira/browse/HTTPCLIENT/issueTrackingUrl
 
   siteAddresspeople.apache.org/siteAddress
   siteDirectory/www/jakarta.apache.org/commons/httpclient//siteDirectory



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r406667 - /jakarta/commons/proper/httpclient/trunk/project.xml

2006-05-15 Thread olegk
Author: olegk
Date: Mon May 15 09:27:32 2006
New Revision: 406667

URL: http://svn.apache.org/viewcvs?rev=406667view=rev
Log:
Set current version to 3.0.1

Modified:
jakarta/commons/proper/httpclient/trunk/project.xml

Modified: jakarta/commons/proper/httpclient/trunk/project.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/project.xml?rev=406667r1=40r2=406667view=diff
==
--- jakarta/commons/proper/httpclient/trunk/project.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/project.xml Mon May 15 09:27:32 2006
@@ -7,7 +7,7 @@
   artifactIdcommons-httpclient/artifactId
   gumpRepositoryIdjakarta-commons-httpclient/gumpRepositoryId
   inceptionYear2001/inceptionYear
-  currentVersion3.0/currentVersion
+  currentVersion3.0.1/currentVersion
   packageorg.apache.commons.httpclient/package
 
   organization



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r405769 - in /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie: Cookie2.java CookieAttributeHandler.java CookieOrigin.java CookiePathComparator.java

2006-05-10 Thread olegk
Author: olegk
Date: Wed May 10 08:12:04 2006
New Revision: 405769

URL: http://svn.apache.org/viewcvs?rev=405769view=rev
Log:
Some javadoc tweaks

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/Cookie2.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieOrigin.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookiePathComparator.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/Cookie2.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/Cookie2.java?rev=405769r1=405768r2=405769view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/Cookie2.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/Cookie2.java
 Wed May 10 08:12:04 2006
@@ -1,7 +1,7 @@
 /*
  * $Header: 
/cvsroot/httpc-cookie2/httpc-cookie2/httpcookie2SVN-patch.082805-2100.diff,v 
1.1 2005/08/29 05:01:58 sjain700 Exp $
- * $Revision$
- * $Date$
+ * $Revision:400312 $
+ * $Date:2006-05-06 14:49:41 +0200 (Sat, 06 May 2006) $
  *
  * 
  *
@@ -41,6 +41,8 @@
  * /p
  *
  * @author Samit Jain ([EMAIL PROTECTED])
+ * 
+ * @since 3.1
  */
 public class Cookie2 extends Cookie {
 

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java?rev=405769r1=405768r2=405769view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java
 Wed May 10 08:12:04 2006
@@ -1,7 +1,7 @@
 /*
- * $HeadURL$
- * $Revision$
- * $Date$
+ * 
$HeadURL:https://svn.apache.org/repos/asf/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java
 $
+ * $Revision:400312 $
+ * $Date:2006-05-06 14:49:41 +0200 (Sat, 06 May 2006) $
  *
  * 
  *
@@ -32,14 +32,16 @@
 
 /**
  * Ths interface represents a cookie attribute handler responsible
- * for parsing, validating, matching and formatting a specific
- * cookie attribute, such as path, domain, port, etc.
+ * for parsing, validating, and matching a specific cookie attribute, 
+ * such as path, domain, port, etc.
  *
  * Different cookie specifications can provide a specific
  * implementation for this class based on their cookie handling
  * rules.
  *
  * @author [EMAIL PROTECTED] (Samit Jain)
+ * 
+ * @since 3.1
  */
 public interface CookieAttributeHandler {
 

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieOrigin.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieOrigin.java?rev=405769r1=405768r2=405769view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieOrigin.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieOrigin.java
 Wed May 10 08:12:04 2006
@@ -1,7 +1,7 @@
 /*
- * $HeadURL$
- * $Revision$
- * $Date$
+ * 
$HeadURL:https://svn.apache.org/repos/asf/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieOrigin.java
 $
+ * $Revision:400312 $
+ * $Date:2006-05-06 14:49:41 +0200 (Sat, 06 May 2006) $
  *
  * 
  *
@@ -28,6 +28,14 @@
  */
 package org.apache.commons.httpclient.cookie;
 
+/**
+ * CookieOrigin class incapsulates details of an origin server that 
+ * are relevant when parsing, validating or matching HTTP cookies.
+ * 
+ * @author a href=mailto:oleg at ural.ruOleg Kalnichevski/a
+ * 
+ * @since 3.1
+ */
 public final class CookieOrigin {
 
private final String host;

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookiePathComparator.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookiePathComparator.java?rev=405769r1

svn commit: r405007 - /jakarta/commons/proper/httpclient/trunk/release_notes.txt

2006-05-08 Thread olegk
Author: olegk
Date: Mon May  8 03:36:22 2006
New Revision: 405007

URL: http://svn.apache.org/viewcvs?rev=405007view=rev
Log:
PR #19102 and #10813

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/release_notes.txt?rev=405007r1=405006r2=405007view=diff
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Mon May  8 
03:36:22 2006
@@ -1,13 +1,20 @@
 Changes toward 3.1 
 
+ * 19102 - Added support for Set-Cookie2 response headers
+   Contributed by Samit Jain jain.samit at gmail.com
+
+ * 10813 - Implemented RFC 2965 cookie spec (Cookie2); Added support for port 
+   sensitive cookies
+   Contributed by Samit Jain jain.samit at gmail.com
+
  * 36918 - Digest auth scheme now uses correct digest uri in HTTP CONNECT 
requests
Contributed by Oleg Kalnichevski olegk at apache.org
 
-Changes since Release 3.0:
-
  * 38818 - Failed CONNECT no longer leaves connection in an inconsistent state
Contributed by Oleg Kalnichevski olegk at apache.org
+
+Changes since Release 3.0:
 
  * 38636 - Calling HttpState.clearCookies() is now safe from a different 
thread.
Contributed by Peter Dolberg observewisdom at yahoo.com



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r400307 - /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java

2006-05-06 Thread olegk
Author: olegk
Date: Sat May  6 05:39:52 2006
New Revision: 400307

URL: http://svn.apache.org/viewcvs?rev=400307view=rev
Log:
Process Set-Cookie2 response headers ONLY if the actual cookie spec stands a 
chance of understanding them

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java?rev=400307r1=400306r2=400307view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 Sat May  6 05:39:52 2006
@@ -1475,18 +1475,22 @@
 LOG.trace(enter HttpMethodBase.processResponseHeaders(HttpState, 
 + HttpConnection));
 
-// process cookie headers
+CookieSpec parser = getCookieSpec(state);
 
 // process set-cookie headers
 Header[] headers = getResponseHeaderGroup().getHeaders(set-cookie);
-processCookieHeaders(headers, state, conn);
+processCookieHeaders(parser, headers, state, conn);
 
-// process set-cookie2 headers. Older cookie specs will ignore this
-// header. For newer specs (like RFC 2965), set-cookie2 header will
-// replace set-cookie header (obtained in the same response) for the
-// same cookie.
-headers = getResponseHeaderGroup().getHeaders(set-cookie2);
-processCookieHeaders(headers, state, conn);
+// see if the cookie spec supports cookie versioning.
+if (parser instanceof CookieVersionSupport) {
+CookieVersionSupport versupport = (CookieVersionSupport) parser;
+if (versupport.getVersion()  0) {
+// process set-cookie2 headers.
+// Cookie2 will replace equivalent Cookie instances
+headers = getResponseHeaderGroup().getHeaders(set-cookie2);
+processCookieHeaders(parser, headers, state, conn);
+}
+}
 }
 
 /**
@@ -1499,11 +1503,14 @@
  * @param conn the [EMAIL PROTECTED] HttpConnection connection} used to 
execute
  *this HTTP method
  */
-protected void processCookieHeaders(Header[] headers, HttpState state, 
HttpConnection conn) {
+protected void processCookieHeaders(
+final CookieSpec parser, 
+final Header[] headers, 
+final HttpState state, 
+final HttpConnection conn) {
 LOG.trace(enter HttpMethodBase.processCookieHeaders(Header[], 
HttpState, 
   + HttpConnection));
 
-CookieSpec parser = getCookieSpec(state);
 String host = this.params.getVirtualHost();
 if (host == null) {
 host = conn.getHost();



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r400312 - in /jakarta/commons/proper/httpclient/trunk/src: java/org/apache/commons/httpclient/ java/org/apache/commons/httpclient/cookie/ test/org/apache/commons/httpclient/cookie/

2006-05-06 Thread olegk
Author: olegk
Date: Sat May  6 05:49:41 2006
New Revision: 400312

URL: http://svn.apache.org/viewcvs?rev=400312view=rev
Log:
Merged down the diff from the COOKIE_2_BRANCH

Added:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/Cookie2.java
  - copied unchanged from r399747, 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/Cookie2.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java
  - copied unchanged from r399747, 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieOrigin.java
  - copied unchanged from r399747, 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieOrigin.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookiePathComparator.java
  - copied unchanged from r399747, 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookiePathComparator.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieVersionSupport.java
  - copied unchanged from r399747, 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieVersionSupport.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
  - copied unchanged from r399747, 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/cookie/TestCookie2.java
  - copied unchanged from r399747, 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookie2.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/cookie/TestCookiePathComparator.java
  - copied unchanged from r399747, 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookiePathComparator.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/cookie/TestCookieRFC2965Spec.java
  - copied unchanged from r399747, 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieRFC2965Spec.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java
  - copied unchanged from r399747, 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java
Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookiePolicy.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2109Spec.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/cookie/TestCookieAll.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java?rev=400312r1=400311r2=400312view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 Sat May  6 05:49:41 2006
@@ -39,6 +39,7 @@
 import org.apache.commons.httpclient.auth.AuthState;
 import org.apache.commons.httpclient.cookie.CookiePolicy;
 import org.apache.commons.httpclient.cookie.CookieSpec;
+import org.apache.commons.httpclient.cookie.CookieVersionSupport;
 import org.apache.commons.httpclient.cookie.MalformedCookieException;
 import org.apache.commons.httpclient.params.HttpMethodParams;
 import org.apache.commons.httpclient.protocol.Protocol;
@@ -1190,6 +1191,20 @@
 getRequestHeaderGroup().addHeader(new Header(Cookie, s, 
true));
 }
 }
+if (matcher instanceof CookieVersionSupport) {
+CookieVersionSupport versupport = (CookieVersionSupport) 
matcher;
+int ver = versupport.getVersion();
+boolean needVersionHeader = false;
+for (int i = 0; i  cookies.length; i++) {
+if (ver != cookies[i

svn commit: r399651 - /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

2006-05-04 Thread olegk
Author: olegk
Date: Thu May  4 03:29:08 2006
New Revision: 399651

URL: http://svn.apache.org/viewcvs?rev=399651view=rev
Log:
Checked compliance with the spec

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?rev=399651r1=399650r2=399651view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 Thu May  4 03:29:08 2006
@@ -540,7 +540,7 @@
  * @param host host name where cookie is received from or being sent to.
  * @return
  */
-private String getEffectiveHost(String host) {
+private static String getEffectiveHost(final String host) {
 String effectiveHost = host;
 if (host.indexOf('.')  0) {
 effectiveHost += .local;
@@ -689,7 +689,6 @@
 if (cookie == null) {
 throw new IllegalArgumentException(Cookie may not be null);
 }
-//TODO (jain): how do we handle the case when domain is specified 
and equals host?
 if (domain == null) {
 throw new MalformedCookieException(
 Missing value for domain attribute);
@@ -699,9 +698,14 @@
 Blank value for domain attribute);
 }
 domain = domain.toLowerCase();
-// put a leading dot if domain does not start with a dot
-if (!domain.startsWith(.))
+if (!domain.startsWith(.)) {
+// Per RFC 2965 section 3.2.2
+// ... If an explicitly specified value does not start with
+// a dot, the user agent supplies a leading dot ...
+// That effectively implies that the domain attribute 
+// MAY NOT be an IP address of a host name
 domain = . + domain;
+}
 cookie.setDomain(domain);
 cookie.setDomainAttributeSpecified(true);
 }
@@ -1077,12 +1081,6 @@
 if (!cookie2.isVersionAttributeSpecified()) {
 throw new MalformedCookieException(
 Violates RFC 2965. Version attribute is 
required.);
-}
-//TODO (jain): other versions for set-cookie2 ?
-if (cookie2.getVersion() != 1) {
-throw new MalformedCookieException(
-Violates RFC 2965. Invalid value for Version 
attribute. +
-Must be \1\.);
 }
 }
 }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r399679 - in /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src: java/org/apache/commons/httpclient/cookie/ test/org/apache/commons/httpclient/cookie/

2006-05-04 Thread olegk
Author: olegk
Date: Thu May  4 04:45:16 2006
New Revision: 399679

URL: http://svn.apache.org/viewcvs?rev=399679view=rev
Log:
Improved compliance with the section 3.3.4 of the RFC 2965

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/Cookie2.java

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieRFC2965Spec.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/Cookie2.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/Cookie2.java?rev=399679r1=399678r2=399679view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/Cookie2.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/Cookie2.java
 Thu May  4 04:45:16 2006
@@ -187,54 +187,8 @@
 }
 
 /**
- * Indicates whether the cookie had a domain attribute specified in the
- * ttSet-Cookie2/tt response header. This property
- * has two uses:
- * ul
- * liThis value is important for generating the ttCookie/tt request 
header
- * because the specification requires that the ttCookie/tt header
- * should only include a domain attribute if the domain was specified in 
the
- * ttSet-Cookie2/tt header.
- * /li
- * liThis also ensures that if domain attribute appears more than once in
- * the ttSet-Cookie2/tt header, only the first appearance of domain
- * attribute is used.
- * /li
- * /ul
- * @param value tttrue/tt if the cookie's domain is specified
- * in response header.
- *
- * @see #isDomainAttributeSpecified
- */
-public void setDomainAttributeSpecified(boolean value) {
-hasDomainAttribute = value;
-}
-
-/**
- * @return tttrue/tt if cookie domain attribute was specified in the
- * ttSet-Cookie2/tt header.
- *
- * @see #setDomainAttributeSpecified
- */
-public boolean isDomainAttributeSpecified() {
-return hasDomainAttribute;
-}
-
-/**
  * Indicates whether the cookie had a port attribute specified in the
- * ttSet-Cookie2/tt response header. This property
- * has two uses:
- * ul
- * liThis value is important for generating the ttCookie/tt request 
header
- * because the specification requires that the ttCookie/tt header
- * should only include a port attribute if the port was specified in the
- * ttSet-Cookie2/tt header.
- * /li
- * liThis also ensures that if port attribute appears more than once in
- * the ttSet-Cookie2/tt header, only the first appearance of the port
- * attribute is used.
- * /li
- * /ul
+ * ttSet-Cookie2/tt response header. 
  *
  * @param value tttrue/tt if port attribute is specified in response
  * header.
@@ -285,13 +239,7 @@
 
 /**
  * Indicates whether the cookie had a version attribute specified in the
- * ttSet-Cookie2/tt response header. This property has two uses:
- * ul
- * liOnly the first occurence of the version attribute in 
ttSet-Cookie2/tt
- * header is used, others ignored./li
- * liSince version attribute is required for valid cookies, this property
- * helps in checking this condition./li
- * /ul
+ * ttSet-Cookie2/tt response header. 
  *
  * @param value tttrue/tt if version attribute is specified in response
  * header.
@@ -336,12 +284,6 @@
  * Discard attribute.
  */
 private boolean discard = false;
-
-/**
- * Indicates if the set-cookie header included a Domain attribute for this
- * cookie
- */
-private boolean hasDomainAttribute = false;
 
 /**
  * Indicates if the set-cookie2 header included a Port attribute for this

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?rev=399679r1=399678r2=399679view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 Thu May  4 04:45:16 2006
@@ -434,8 +434,9 @@
 if (cookie instanceof Cookie2

svn commit: r399709 - in /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src: java/org/apache/commons/httpclient/cookie/ test/org/apache/commons/httpclient/cookie/

2006-05-04 Thread olegk
Author: olegk
Date: Thu May  4 07:18:27 2006
New Revision: 399709

URL: http://svn.apache.org/viewcvs?rev=399709view=rev
Log:
Improved compliance with the section 3.3.4 of the RFC 2965. Arrange cookies by 
value of the path attribute (cookies with a more specific path attribute take 
precedence) 

Added:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookiePathComparator.java
   (with props)

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookiePathComparator.java
   (with props)
Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieAll.java

Added: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookiePathComparator.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookiePathComparator.java?rev=399709view=auto
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookiePathComparator.java
 (added)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookiePathComparator.java
 Thu May  4 07:18:27 2006
@@ -0,0 +1,80 @@
+/*
+ * $Header$
+ * $Revision$
+ * $Date$
+ *
+ * 
+ *
+ *  Copyright 1999-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the License);
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an AS IS BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * http://www.apache.org/.
+ *
+ */
+
+package org.apache.commons.httpclient.cookie;
+
+import java.util.Comparator;
+
+import org.apache.commons.httpclient.Cookie;
+
+/**
+ * This cookie comparator ensures that multiple cookies satisfying 
+ * a common criteria are ordered in the ttCookie/tt header such
+ * that those with more specific Path attributes precede those with
+ * less specific.
+ *  
+ * p
+ * This comparator assumes that Path attributes of two cookies 
+ * path-match a commmon request-URI. Otherwise, the result of the
+ * comparison is undefined.
+ * /p
+ * 
+ * @author a href=mailto:oleg at ural.ruOleg Kalnichevski/a
+ */
+public class CookiePathComparator implements Comparator {
+
+private String normalizePath(final Cookie cookie) {
+String path = cookie.getPath();
+if (path == null) {
+path = /;
+}
+if (!path.endsWith(/)) {
+path = path + /;
+}
+return path;
+}
+
+public int compare(final Object o1, final Object o2) {
+Cookie c1 = (Cookie) o1;
+Cookie c2 = (Cookie) o2;
+String path1 = normalizePath(c1);
+String path2 = normalizePath(c2);
+if (path1.equals(path2)) {
+return 0;
+} else if (path1.startsWith(path2)) {
+return -1;
+} else if (path2.startsWith(path1)) {
+return 1;
+} else {
+// Does not really matter
+return 0;
+}
+}
+
+}

Propchange: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookiePathComparator.java
--
svn:eol-style = native

Propchange: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookiePathComparator.java
--
svn:keywords = Date Author Id Revision HeadURL

Propchange: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookiePathComparator.java
--
svn:mime-type = text/plain

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java

svn commit: r399711 - /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

2006-05-04 Thread olegk
Author: olegk
Date: Thu May  4 07:22:51 2006
New Revision: 399711

URL: http://svn.apache.org/viewcvs?rev=399711view=rev
Log:
Oopsie

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?rev=399711r1=399710r2=399711view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 Thu May  4 07:22:51 2006
@@ -177,7 +177,7 @@
  * portnum =   1*DIGIT
  * /PRE
  *
- * @param host the host from whichPATH_COMPOARATOR the 
ttSet-Cookie2/tt value was
+ * @param host the host from which the ttSet-Cookie2/tt value was
  * received
  * @param port the port from which the ttSet-Cookie2/tt value was
  * received



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r399735 - /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

2006-05-04 Thread olegk
Author: olegk
Date: Thu May  4 08:31:12 2006
New Revision: 399735

URL: http://svn.apache.org/viewcvs?rev=399735view=rev
Log:
Fixed inconsistencies in usage of the effective host name

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?rev=399735r1=399734r2=399735view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 Thu May  4 08:31:12 2006
@@ -247,7 +247,7 @@
 if (path.trim().equals()) {
 path = PATH_DELIM;
 }
-host = host.toLowerCase();
+host = getEffectiveHost(host);
 
 HeaderElement[] headerElements =
 HeaderElement.parseElements(header.toCharArray());
@@ -348,7 +348,7 @@
 if (cookie.getName().startsWith($)) {
 throw new MalformedCookieException(Cookie name may not start 
with $);
 }
-CookieOrigin origin = new CookieOrigin(host, port, path, secure); 
+CookieOrigin origin = new CookieOrigin(getEffectiveHost(host), 
port, path, secure); 
 for (Iterator i = getAttribHandlerIterator(); i.hasNext(); ) {
   CookieAttributeHandler handler = (CookieAttributeHandler) 
i.next();
   handler.validate(cookie, origin);
@@ -381,7 +381,7 @@
 if (cookie.isPersistent()  cookie.isExpired()) {
 return false;
 }
-CookieOrigin origin = new CookieOrigin(host, port, path, secure); 
+CookieOrigin origin = new CookieOrigin(getEffectiveHost(host), 
port, path, secure); 
 for (Iterator i = getAttribHandlerIterator(); i.hasNext(); ) {
 CookieAttributeHandler handler = (CookieAttributeHandler) 
i.next();
 if (!handler.match(cookie, origin)) {
@@ -555,7 +555,7 @@
  * @return
  */
 private static String getEffectiveHost(final String host) {
-String effectiveHost = host;
+String effectiveHost = host.toLowerCase();
 if (host.indexOf('.')  0) {
 effectiveHost += .local;
 }
@@ -761,8 +761,7 @@
 }
 
 // The effective host name must domain-match domain attribute.
-String effectiveHost = getEffectiveHost(host);
-if (!domainMatch(effectiveHost, cookieDomain)) {
+if (!domainMatch(host, cookieDomain)) {
 throw new MalformedCookieException(
 Domain attribute \ + cookie.getDomain()
 + \ violates RFC 2965: effective host name does 
not 
@@ -770,9 +769,8 @@
 }
 
 // effective host name minus domain must not contain any dots
-String effectiveHostWithoutDomain =
-effectiveHost.substring(0, effectiveHost.length()
-   - cookieDomain.length());
+String effectiveHostWithoutDomain = host.substring(
+0, host.length() - cookieDomain.length());
 if (effectiveHostWithoutDomain.indexOf('.') != -1) {
 throw new MalformedCookieException(Domain attribute \
+ cookie.getDomain() + 
\ violates RFC 2965: 
@@ -802,17 +800,15 @@
 }
 String host = origin.getHost().toLowerCase();
 String cookieDomain = cookie.getDomain();
-String effectiveHost = getEffectiveHost(host);
 
 // The effective host name MUST domain-match the Domain
 // attribute of the cookie.
-if (!domainMatch(effectiveHost, cookieDomain)) {
+if (!domainMatch(host, cookieDomain)) {
 return false;
 }
 // effective host name minus domain must not contain any dots
-String effectiveHostWithoutDomain =
-effectiveHost.substring(0, effectiveHost.length()
-   - cookieDomain.length());
+String effectiveHostWithoutDomain = host.substring(
+0, host.length() - cookieDomain.length());
 if (effectiveHostWithoutDomain.indexOf('.') != -1) {
 return false;
 }



-
To unsubscribe, e

svn commit: r399737 - in /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src: java/org/apache/commons/httpclient/ test/org/apache/commons/httpclient/cookie/

2006-05-04 Thread olegk
Author: olegk
Date: Thu May  4 08:34:01 2006
New Revision: 399737

URL: http://svn.apache.org/viewcvs?rev=399737view=rev
Log:
Improved compliance with the sections 3.3.5 amd 9.1 of the RFC 2965. More test 
coverage

Added:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java
   (with props)
Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieAll.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java?rev=399737r1=399736r2=399737view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 Thu May  4 08:34:01 2006
@@ -1192,8 +1192,18 @@
 }
 }
 if (matcher instanceof CookieVersionSupport) {
-Header ver = 
((CookieVersionSupport)matcher).getVersionHeader();
-getRequestHeaderGroup().addHeader(ver);
+CookieVersionSupport versupport = (CookieVersionSupport) 
matcher;
+int ver = versupport.getVersion();
+boolean needVersionHeader = false;
+for (int i = 0; i  cookies.length; i++) {
+if (ver != cookies[i].getVersion()) {
+needVersionHeader = true;
+}
+}
+if (needVersionHeader) {
+// Advertise cookie version support
+
getRequestHeaderGroup().addHeader(versupport.getVersionHeader());
+}
 }
 }
 }

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieAll.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieAll.java?rev=399737r1=399736r2=399737view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieAll.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieAll.java
 Thu May  4 08:34:01 2006
@@ -52,6 +52,7 @@
 suite.addTest(TestCookiePolicy.suite());
 suite.addTest(TestDateParser.suite());
 suite.addTest(TestCookiePathComparator.suite());
+suite.addTest(TestCookieVersionSupport.suite());
 return suite;
 }
 

Added: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java?rev=399737view=auto
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java
 (added)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java
 Thu May  4 08:34:01 2006
@@ -0,0 +1,184 @@
+/*
+ * $HeaderURL$
+ * $Revision$
+ * $Date$
+ * 
+ *
+ *  Copyright 1999-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the License);
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an AS IS BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * http://www.apache.org

svn commit: r399740 - /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java

2006-05-04 Thread olegk
Author: olegk
Date: Thu May  4 08:37:31 2006
New Revision: 399740

URL: http://svn.apache.org/viewcvs?rev=399740view=rev
Log:
Damn it

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java?rev=399740r1=399739r2=399740view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java
 Thu May  4 08:37:31 2006
@@ -1,5 +1,5 @@
 /*
- * $HeaderURL$
+ * $HeadURL$
  * $Revision$
  * $Date$
  * 
@@ -67,81 +67,81 @@
 return new TestSuite(TestCookieVersionSupport.class);
 }
 
-//private static class CookieVer0Service implements HttpService {
-//
-//public CookieVer0Service() {
-//super();
-//}
-//
-//public boolean process(final SimpleRequest request, final 
SimpleResponse response)
-//throws IOException
-//{
-//HttpVersion httpversion = 
request.getRequestLine().getHttpVersion();
-//response.setStatusLine(httpversion, HttpStatus.SC_OK);
-//response.addHeader(new Header(Set-Cookie, name1=value1; 
path=/test));
-//response.setBodyString(whatever);
-//return true;
-//}
-//}
-//
-//
-//public void testCookieVersionSupportHeader1() throws IOException {
-//this.server.setHttpService(new CookieVer0Service());
-//this.client.getParams().setCookiePolicy(CookiePolicy.RFC_2965);
-//GetMethod httpget1 = new GetMethod(/test/);
-//try {
-//this.client.executeMethod(httpget1);
-//} finally {
-//httpget1.releaseConnection();
-//}
-//GetMethod httpget2 = new GetMethod(/test/);
-//try {
-//this.client.executeMethod(httpget2);
-//} finally {
-//httpget2.releaseConnection();
-//}
-//Header cookiesupport = httpget2.getRequestHeader(Cookie2);
-//assertNotNull(cookiesupport);
-//assertEquals($Version=\1\, cookiesupport.getValue());
-//}
-//
-//private static class CookieVer1Service implements HttpService {
-//
-//public CookieVer1Service() {
-//super();
-//}
-//
-//public boolean process(final SimpleRequest request, final 
SimpleResponse response)
-//throws IOException
-//{
-//HttpVersion httpversion = 
request.getRequestLine().getHttpVersion();
-//response.setStatusLine(httpversion, HttpStatus.SC_OK);
-//response.addHeader(new Header(Set-Cookie, name1=value1; 
Path=\/test\; Version=\1\));
-//response.addHeader(new Header(Set-Cookie2, name2=value2; 
Path=\/test\; Version=\1\));
-//response.setBodyString(whatever);
-//return true;
-//}
-//}
-//
-//
-//public void testCookieVersionSupportHeader2() throws IOException {
-//this.server.setHttpService(new CookieVer1Service());
-//this.client.getParams().setCookiePolicy(CookiePolicy.RFC_2965);
-//GetMethod httpget1 = new GetMethod(/test/);
-//try {
-//this.client.executeMethod(httpget1);
-//} finally {
-//httpget1.releaseConnection();
-//}
-//GetMethod httpget2 = new GetMethod(/test/);
-//try {
-//this.client.executeMethod(httpget2);
-//} finally {
-//httpget2.releaseConnection();
-//}
-//Header cookiesupport = httpget2.getRequestHeader(Cookie2);
-//assertNull(cookiesupport);
-//}
+private static class CookieVer0Service implements HttpService {
+
+public CookieVer0Service() {
+super();
+}
+
+public boolean process(final SimpleRequest request, final 
SimpleResponse response)
+throws IOException
+{
+HttpVersion httpversion = 
request.getRequestLine().getHttpVersion();
+response.setStatusLine(httpversion, HttpStatus.SC_OK);
+response.addHeader(new Header(Set-Cookie, name1=value1; 
path=/test));
+response.setBodyString(whatever);
+return true;
+}
+}
+
+
+public void testCookieVersionSupportHeader1() throws IOException {
+this.server.setHttpService(new

svn commit: r399747 - /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java

2006-05-04 Thread olegk
Author: olegk
Date: Thu May  4 09:12:04 2006
New Revision: 399747

URL: http://svn.apache.org/viewcvs?rev=399747view=rev
Log:
Provided a test case for a section 9.1 requirement to discard Set-Cookie cookie 
if equivalent Set-Cookie2 cookie is present

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java?rev=399747r1=399746r2=399747view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieVersionSupport.java
 Thu May  4 09:12:04 2006
@@ -32,8 +32,10 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
+import org.apache.commons.httpclient.Cookie;
 import org.apache.commons.httpclient.Header;
 import org.apache.commons.httpclient.HttpClientTestBase;
+import org.apache.commons.httpclient.HttpState;
 import org.apache.commons.httpclient.HttpStatus;
 import org.apache.commons.httpclient.HttpVersion;
 import org.apache.commons.httpclient.methods.GetMethod;
@@ -180,5 +182,53 @@
 assertNotNull(cookiesupport);
 assertEquals($Version=\1\, cookiesupport.getValue());
 }
+
+private static class SetCookieVersionMixService implements HttpService {
+
+public SetCookieVersionMixService() {
+super();
+}
+
+public boolean process(final SimpleRequest request, final 
SimpleResponse response)
+throws IOException
+{
+HttpVersion httpversion = 
request.getRequestLine().getHttpVersion();
+response.setStatusLine(httpversion, HttpStatus.SC_OK);
+response.addHeader(new Header(Set-Cookie, name=wrong; 
Path=/test));
+response.addHeader(new Header(Set-Cookie2, name=right; 
Path=\/test\; Version=\1\));
+response.setBodyString(whatever);
+return true;
+}
+}
+
+public static class TestHttpState extends HttpState {
+
+public synchronized void addCookie(Cookie cookie) {
+if (cookie != null) {
+if (localhost.local.equals(cookie.getDomain())) {
+cookie.setDomain(localhost);
+}
+super.addCookie(cookie);
+}
+}
+}
+
+public void testSetCookieVersionMix() throws IOException {
+this.server.setHttpService(new SetCookieVersionMixService());
+this.client.setState(new TestHttpState());
+this.client.getParams().setCookiePolicy(CookiePolicy.RFC_2965);
+GetMethod httpget1 = new GetMethod(/test/);
+try {
+this.client.executeMethod(httpget1);
+} finally {
+httpget1.releaseConnection();
+}
+Cookie[] cookies = this.client.getState().getCookies();
+assertNotNull(cookies);
+assertEquals(1, cookies.length);
+assertEquals(right, cookies[0].getValue());
+assertTrue(cookies[0] instanceof Cookie2);
+}
+
 
 }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r398315 - in /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src: java/org/apache/commons/httpclient/cookie/RFC2965Spec.java test/org/apache/commons/httpclient/cookie/TestCooki

2006-04-30 Thread olegk
Author: olegk
Date: Sun Apr 30 04:25:07 2006
New Revision: 398315

URL: http://svn.apache.org/viewcvs?rev=398315view=rev
Log:
Refactored handling of the 'Secure' cookie attribute

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieRFC2965Spec.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?rev=398315r1=398314r2=398315view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 Sun Apr 30 04:25:07 2006
@@ -93,8 +93,9 @@
 registerAttribHandler(Cookie2.PATH, new Cookie2PathAttributeHandler());
 registerAttribHandler(Cookie2.DOMAIN, new 
Cookie2DomainAttributeHandler());
 registerAttribHandler(Cookie2.PORT, new Cookie2PortAttributeHandler());
-registerAttribHandler(Cookie2.VERSION, new 
Cookie2VersionAttributeHandler());
 registerAttribHandler(Cookie2.MAXAGE, new 
Cookie2MaxageAttributeHandler());
+registerAttribHandler(Cookie2.SECURE, new 
CookieSecureAttributeHandler());
+registerAttribHandler(Cookie2.VERSION, new 
Cookie2VersionAttributeHandler());
 }
 
 protected void registerAttribHandler(
@@ -309,8 +310,6 @@
 if (paramName.equals(Cookie2.COMMENT)) {
 if (cookie.getComment() == null)
 cookie.setComment(paramValue);
-} else if (paramName.equals(Cookie2.SECURE)) {
-cookie.setSecure(true);
 } else if (paramName.equals(Cookie2.COMMENTURL)) {
 if (cookie.getCommentURL() == null)
 cookie.setCommentURL(paramValue);
@@ -336,7 +335,7 @@
  * @throws MalformedCookieException if an exception occurs during
  * validation
  */
-public void validate(String host, int port, String path,
+public void validate(final String host, int port, final String path,
  boolean secure, final Cookie cookie)
 throws MalformedCookieException {
 
@@ -380,6 +379,10 @@
 throw new IllegalArgumentException(Cookie may not be null);
 }
 if (cookie instanceof Cookie2) {
+// check if cookie has expired
+if (cookie.isPersistent()  cookie.isExpired()) {
+return false;
+}
 CookieSource cookiesource = new CookieSource(host, port, path, 
secure); 
 for (Iterator i = getAttribHandlerIterator(); i.hasNext(); ) {
 CookieAttributeHandler handler = (CookieAttributeHandler) 
i.next();
@@ -387,16 +390,6 @@
 return false;
 }
 }
-// check if cookie has expired
-if (cookie.isPersistent()  cookie.isExpired()) {
-return false;
-}
-// finally make sure that if cookie Secure attribute is set, then 
this
-// request is made using a secure connection
-if (cookie.getSecure()) {
-return secure;
-}
-// if we get to this stage, we have a match
 return true;
 } else {
 // old-style cookies are matched according to the old rules
@@ -965,6 +958,36 @@
   return true;
   }
 
+  }
+
+  /**
+   * ttSecure/tt cookie attribute handler for RFC 2965 cookie spec.
+   */
+  private class CookieSecureAttributeHandler
+  implements CookieAttributeHandler {
+
+  public void parse(final Cookie cookie, final String secure)
+  throws MalformedCookieException {
+  cookie.setSecure(true);
+  }
+
+  public void validate(final Cookie cookie, final CookieSource source)
+  throws MalformedCookieException {
+  }
+
+  /**
+   * @see 
CookieAttributeHandler#match(org.apache.commons.httpclient.Cookie, String)
+   */
+  public boolean match(final Cookie cookie, final CookieSource source) {
+  if (cookie == null) {
+  throw new IllegalArgumentException(Cookie may not be null);
+  }
+  if (source == null) {
+  throw new IllegalArgumentException(Cookie source may not be 
null);
+  }
+  return cookie.getSecure() == source.isSecure();
+  }
+  
   }
 
 /**

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie

svn commit: r398319 - in /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie: CookieAttributeHandler.java CookieOrigin.java CookieSource.java RFC2

2006-04-30 Thread olegk
Author: olegk
Date: Sun Apr 30 04:58:30 2006
New Revision: 398319

URL: http://svn.apache.org/viewcvs?rev=398319view=rev
Log:
Renamed CookieSource to CookieOrigin

Added:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieOrigin.java
  - copied, changed from r396994, 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieSource.java
Removed:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieSource.java
Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java?rev=398319r1=398318r2=398319view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java
 Sun Apr 30 04:58:30 2006
@@ -57,10 +57,10 @@
* Peforms cookie validation for the given attribute value.
*
* @param cookie [EMAIL PROTECTED] org.apache.commons.httpclient.Cookie} to 
validate
-   * @param source the cookie source to validate against
+   * @param origin the cookie source to validate against
* @throws MalformedCookieException if cookie validation fails for this 
attribute
*/
-  void validate(Cookie cookie, CookieSource source)
+  void validate(Cookie cookie, CookieOrigin origin)
   throws MalformedCookieException;
 
   /**
@@ -68,9 +68,9 @@
* submitted) with the corresponding cookie attribute.
*
* @param cookie [EMAIL PROTECTED] org.apache.commons.httpclient.Cookie} to 
match
-   * @param source the cookie source to match against
+   * @param origin the cookie source to match against
* @return tttrue/tt if the match is successful; ttfalse/tt otherwise
*/
-  boolean match(Cookie cookie, CookieSource source);
+  boolean match(Cookie cookie, CookieOrigin origin);
 
 }

Copied: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieOrigin.java
 (from r396994, 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieSource.java)
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieOrigin.java?p2=jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieOrigin.javap1=jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieSource.javar1=396994r2=398319rev=398319view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieSource.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieOrigin.java
 Sun Apr 30 04:58:30 2006
@@ -28,14 +28,14 @@
  */
 package org.apache.commons.httpclient.cookie;
 
-public final class CookieSource {
+public final class CookieOrigin {
 
private final String host;
private final int port;
private final String path;
private final boolean secure;

-   public CookieSource(final String host, int port, final String path, 
boolean secure) {
+   public CookieOrigin(final String host, int port, final String path, 
boolean secure) {
super();
 if (host == null) {
 throw new IllegalArgumentException(

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?rev=398319r1=398318r2=398319view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 Sun

svn commit: r398327 - in /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src: java/org/apache/commons/httpclient/cookie/RFC2965Spec.java test/org/apache/commons/httpclient/cookie/TestCooki

2006-04-30 Thread olegk
Author: olegk
Date: Sun Apr 30 05:39:51 2006
New Revision: 398327

URL: http://svn.apache.org/viewcvs?rev=398327view=rev
Log:
Refactored handling of the 'Discard', 'Comment', and 'CommentURL' cookie 
attributes

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieRFC2965Spec.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?rev=398327r1=398326r2=398327view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 Sun Apr 30 05:39:51 2006
@@ -95,6 +95,9 @@
 registerAttribHandler(Cookie2.PORT, new Cookie2PortAttributeHandler());
 registerAttribHandler(Cookie2.MAXAGE, new 
Cookie2MaxageAttributeHandler());
 registerAttribHandler(Cookie2.SECURE, new 
CookieSecureAttributeHandler());
+registerAttribHandler(Cookie2.COMMENT, new 
CookieCommentAttributeHandler());
+registerAttribHandler(Cookie2.COMMENTURL, new 
CookieCommentUrlAttributeHandler());
+registerAttribHandler(Cookie2.DISCARD, new 
CookieDiscardAttributeHandler());
 registerAttribHandler(Cookie2.VERSION, new 
Cookie2VersionAttributeHandler());
 }
 
@@ -279,11 +282,11 @@
  *
  * @param attribute [EMAIL PROTECTED] 
org.apache.commons.httpclient.NameValuePair} cookie attribute from the
  * ttSet-Cookie2/tt header.
- * @param cookieParam [EMAIL PROTECTED] 
org.apache.commons.httpclient.Cookie} to be updated
+ * @param cookie [EMAIL PROTECTED] org.apache.commons.httpclient.Cookie} 
to be updated
  * @throws MalformedCookieException if an exception occurs during parsing
  */
 public void parseAttribute(
-final NameValuePair attribute, final Cookie cookieParam)
+final NameValuePair attribute, final Cookie cookie)
 throws MalformedCookieException {
 if (attribute == null) {
 throw new IllegalArgumentException(Attribute may not be null.);
@@ -291,35 +294,20 @@
 if (attribute.getName() == null) {
 throw new IllegalArgumentException(Attribute Name may not be 
null.);
 }
-if (cookieParam == null) {
+if (cookie == null) {
 throw new IllegalArgumentException(Cookie may not be null.);
 }
-if (!(cookieParam instanceof Cookie2)) {
-throw new IllegalArgumentException(Expected Cookie2 cookies.);
-}
-Cookie2 cookie = (Cookie2) cookieParam;
 final String paramName = attribute.getName().toLowerCase();
 final String paramValue = attribute.getValue();
 
 CookieAttributeHandler handler = findAttribHandler(paramName);
-if (handler != null) {
-handler.parse(cookie, paramValue);
-}
-
-// handle other cookie attributes
-if (paramName.equals(Cookie2.COMMENT)) {
-if (cookie.getComment() == null)
-cookie.setComment(paramValue);
-} else if (paramName.equals(Cookie2.COMMENTURL)) {
-if (cookie.getCommentURL() == null)
-cookie.setCommentURL(paramValue);
-} else if (paramName.equals(Cookie2.DISCARD)) {
-cookie.setDiscard(true);
-} else {
+if (handler == null) {
 // ignore unknown attribute-value pairs
 if (LOG.isDebugEnabled())
 LOG.debug(Unrecognized cookie attribute:  +
   attribute.toString());
+} else {
+handler.parse(cookie, paramValue);
 }
 }
 
@@ -331,7 +319,7 @@
  * @param path the path from which the [EMAIL PROTECTED] 
org.apache.commons.httpclient.Cookie} was received
  * @param secure tttrue/tt when the [EMAIL PROTECTED] 
org.apache.commons.httpclient.Cookie} was received using a
  * secure connection
- * @param cookieParam The cookie to validate
+ * @param cookie The cookie to validate
  * @throws MalformedCookieException if an exception occurs during
  * validation
  */
@@ -367,7 +355,6 @@
  * @param port the port to which the request is being submitted (ignored)
  * @param path the path to which the request is being submitted
  * @param secure tttrue/tt if the request is using a secure connection
- * @param cookieParam [EMAIL PROTECTED] Cookie} to be matched
  * @return true if the cookie

svn commit: r398339 - /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

2006-04-30 Thread olegk
Author: olegk
Date: Sun Apr 30 06:29:00 2006
New Revision: 398339

URL: http://svn.apache.org/viewcvs?rev=398339view=rev
Log:
Handle the requirement of the section 3.2.2 postulating that the first 
occurrence of an attribute must take precedence a little more elegantly

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?rev=398339r1=398338r2=398339view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 Sun Apr 30 06:29:00 2006
@@ -266,8 +266,15 @@
 NameValuePair[] parameters = headerelement.getParameters();
 // could be null. In case only a header element and no parameters.
 if (parameters != null) {
-for (int j = 0; j  parameters.length; j++) {
-parseAttribute(parameters[j], cookie);
+// Eliminate duplicate attribues. The first occurence takes 
precedence
+Map attribmap = new HashMap(parameters.length); 
+for (int j = parameters.length - 1; j = 0; j--) {
+NameValuePair param = parameters[j];
+attribmap.put(param.getName().toLowerCase(), param);
+}
+for (Iterator it = attribmap.entrySet().iterator(); 
it.hasNext(); ) {
+Map.Entry entry = (Map.Entry) it.next();
+parseAttribute((NameValuePair) entry.getValue(), cookie);
 }
 }
 cookies.add(cookie);
@@ -597,18 +604,16 @@
 if (cookie == null) {
 throw new IllegalArgumentException(Cookie may not be null);
 }
-if (!cookie.isPathAttributeSpecified()) {
-if (path == null) {
-throw new MalformedCookieException(
-Missing value for path attribute);
-}
-if (path.trim().equals()) {
-throw new MalformedCookieException(
-Blank value for path attribute);
-}
-cookie.setPath(path);
-cookie.setPathAttributeSpecified(true);
+if (path == null) {
+throw new MalformedCookieException(
+Missing value for path attribute);
 }
+if (path.trim().equals()) {
+throw new MalformedCookieException(
+Blank value for path attribute);
+}
+cookie.setPath(path);
+cookie.setPathAttributeSpecified(true);
 }
 
 /**
@@ -684,23 +689,21 @@
 if (cookie == null) {
 throw new IllegalArgumentException(Cookie may not be null);
 }
-if (!cookie.isDomainAttributeSpecified()) {
-//TODO (jain): how do we handle the case when domain is 
specified and equals host?
-if (domain == null) {
-throw new MalformedCookieException(
-Missing value for domain attribute);
-}
-if (domain.trim().equals()) {
-throw new MalformedCookieException(
-Blank value for domain attribute);
-}
-domain = domain.toLowerCase();
-// put a leading dot if domain does not start with a dot
-if (!domain.startsWith(.))
-domain = . + domain;
-cookie.setDomain(domain);
-cookie.setDomainAttributeSpecified(true);
+//TODO (jain): how do we handle the case when domain is specified 
and equals host?
+if (domain == null) {
+throw new MalformedCookieException(
+Missing value for domain attribute);
 }
+if (domain.trim().equals()) {
+throw new MalformedCookieException(
+Blank value for domain attribute);
+}
+domain = domain.toLowerCase();
+// put a leading dot if domain does not start with a dot
+if (!domain.startsWith(.))
+domain = . + domain;
+cookie.setDomain(domain);
+cookie.setDomainAttributeSpecified(true);
 }
 
 /**
@@ -816,19 +819,17

svn commit: r397879 - /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

2006-04-28 Thread olegk
Author: olegk
Date: Fri Apr 28 05:22:17 2006
New Revision: 397879

URL: http://svn.apache.org/viewcvs?rev=397879view=rev
Log:
Use RFC 2109 cookie spec as a fallback cookie policy when dealing with older 
cookies. 

It is not a very good idea to look up the fallback spec by id using 
CookiePolicy.getCookieSpec, as (at least in theory) one can register any 
arbitrary cookie policy for that id, whereas we definitely want specific 
behaviour from a specific cookie spec

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?rev=397879r1=397878r2=397879view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 Fri Apr 28 05:22:17 2006
@@ -67,6 +67,11 @@
 */
 private final Map attribHandlerMap;
 
+/**
+ * Fallback cookie spec (RFC 2109)
+ */
+private final CookieSpec rfc2109;
+
 /** 
  * Default constructor 
  * */
@@ -76,6 +81,7 @@
 this.formatter.setAlwaysUseQuotes(true);
 this.attribHandlerMap = new HashMap(10);
 this.attribHandlerList = new ArrayList(10);
+this.rfc2109 = new RFC2109Spec();
 
 registerAttribHandler(Cookie2.COOKIE_NAME_KEY, new 
Cookie2NameAttributeHandler());
 registerAttribHandler(Cookie2.PATH, new Cookie2PathAttributeHandler());
@@ -187,8 +193,7 @@
 return parse(host, port, path, secure, header.getValue());
 } else if 
(header.getName().equalsIgnoreCase(RFC2109Spec.SET_COOKIE_KEY)) {
 // delegate parsing of old-style cookies to rfc2109Spec
-CookieSpec rfc2109Spec = 
CookiePolicy.getCookieSpec(CookiePolicy.RFC_2109);
-return rfc2109Spec.parse(host, port, path, secure, 
header.getValue());
+return this.rfc2109.parse(host, port, path, secure, 
header.getValue());
 } else {
 throw new MalformedCookieException(Header name is not valid.  +
RFC 2965 supports 
\set-cookie\  +
@@ -341,8 +346,7 @@
 
 if (!(cookie instanceof Cookie2)) {
 // old-style cookies are validated according to the old rules
-CookieSpec rfc2109Spec = 
CookiePolicy.getCookieSpec(CookiePolicy.RFC_2109);
-rfc2109Spec.validate(host, port, path, secure, cookie);
+this.rfc2109.validate(host, port, path, secure, cookie);
 return;
 }
 CookieSource cookiesource = new CookieSource(host, port, path, 
secure); 
@@ -374,8 +378,7 @@
 
 if (!(cookie instanceof Cookie2)) {
 // old-style cookies are matched according to the old rules
-CookieSpec rfc2109Spec = 
CookiePolicy.getCookieSpec(CookiePolicy.RFC_2109);
-return rfc2109Spec.match(host, port, path, secure, cookie);
+return this.rfc2109.match(host, port, path, secure, cookie);
 }
 CookieSource cookiesource = new CookieSource(host, port, path, 
secure); 
 for (Iterator i = getAttribHandlerIterator(); i.hasNext(); ) {
@@ -411,8 +414,7 @@
 }
 if (!(cookieParam instanceof Cookie2)) {
 // old-style cookies are formatted according to the old rules
-CookieSpec rfc2109Spec = 
CookiePolicy.getCookieSpec(CookiePolicy.RFC_2109);
-return rfc2109Spec.formatCookie(cookieParam);
+return this.rfc2109.formatCookie(cookieParam);
 }
 
 /* format cookie2 cookie */
@@ -450,8 +452,7 @@
 // TODO(jain): check this logic?
 if (hasOldStyleCookie) {
 // delegate old-style cookie formatting to rfc2109Spec
-CookieSpec rfc2109Spec = 
CookiePolicy.getCookieSpec(CookiePolicy.RFC_2109);
-return rfc2109Spec.formatCookies(cookies);
+return this.rfc2109.formatCookies(cookies);
 }
 
 /* format cookie2 cookies */



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r397917 - in /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src: java/org/apache/commons/httpclient/ java/org/apache/commons/httpclient/cookie/ test/org/apache/commons/httpcli

2006-04-28 Thread olegk
Author: olegk
Date: Fri Apr 28 08:13:27 2006
New Revision: 397917

URL: http://svn.apache.org/viewcvs?rev=397917view=rev
Log:
Throw a MalformedCookieException and discard all cookies in the Set-Cookie2 if 
a single invalid header element is encountered. 

(1) This behavior is consistent with that of other cookie specs
(2) Generally it is a very bad idea to silently swallow exceptions

Fundamentally the problem is caused by a design flaw in the existing cookie 
API. Namely, the tokanization of header elements should not be a concern of a 
cookie spec. Cookie specs should be dealing with one cookie at a time. We will 
provide a proper solution to this problem in HttpComponents

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieRFC2965Spec.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java?rev=397917r1=397916r2=397917view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/HttpMethodBase.java
 Fri Apr 28 08:13:27 2006
@@ -45,7 +45,6 @@
 import org.apache.commons.httpclient.protocol.Protocol;
 import org.apache.commons.httpclient.util.EncodingUtil;
 import org.apache.commons.httpclient.util.ExceptionUtil;
-import org.apache.commons.httpclient.util.ParameterFormatter;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?rev=397917r1=397916r2=397917view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 Fri Apr 28 08:13:27 2006
@@ -29,14 +29,21 @@
 
 package org.apache.commons.httpclient.cookie;
 
-import org.apache.commons.httpclient.NameValuePair;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
 import org.apache.commons.httpclient.Cookie;
-import org.apache.commons.httpclient.HeaderElement;
 import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.HeaderElement;
+import org.apache.commons.httpclient.NameValuePair;
 import org.apache.commons.httpclient.util.ParameterFormatter;
 
-import java.util.*;
-
 /**
  * pRFC 2965 specific cookie management functions./p
  * 
@@ -250,26 +257,19 @@
 null,
 false,
 new int[] {port});
-
-// cycle through the parameters
-NameValuePair[] parameters = headerelement.getParameters();
-// could be null. In case only a header element and no 
parameters.
-if (parameters != null) {
-for (int j = 0; j  parameters.length; j++) {
-parseAttribute(parameters[j], cookie);
-}
+} catch (IllegalArgumentException ex) {
+throw new MalformedCookieException(ex.getMessage());
+}
+NameValuePair[] parameters = headerelement.getParameters();
+// could be null. In case only a header element and no parameters.
+if (parameters != null) {
+for (int j = 0; j  parameters.length; j++) {
+parseAttribute(parameters[j], cookie);
 }
-cookies.add(cookie);
-} catch (Exception e) {
-//TODO(jain): when do we consider the header malformed and 
stop processing it?
-// throw this cookie, continue processing other cookies in 
header
-if (LOG.isDebugEnabled())
-LOG.debug(Error occured while parsing cookie

svn commit: r397920 - /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieRFC2965Spec.java

2006-04-28 Thread olegk
Author: olegk
Date: Fri Apr 28 08:23:18 2006
New Revision: 397920

URL: http://svn.apache.org/viewcvs?rev=397920view=rev
Log:
Got rid of superfluous helper methods

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieRFC2965Spec.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieRFC2965Spec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieRFC2965Spec.java?rev=397920r1=397919r2=397920view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieRFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/test/org/apache/commons/httpclient/cookie/TestCookieRFC2965Spec.java
 Fri Apr 28 08:23:18 2006
@@ -35,7 +35,6 @@
 import org.apache.commons.httpclient.Header;
 
 import java.util.Date;
-import java.util.Arrays;
 
 /**
  * Test cases for RFC2965 cookie spec
@@ -205,7 +204,12 @@
 assertEquals(1, parsed.length);
 // only the first occurence of port attribute is considered, others 
ignored
 Cookie2 cookie = (Cookie2) parsed[0];
-assertEquals(new int[] {80,800,8000}, cookie.getPorts());
+int[] ports = cookie.getPorts();
+assertNotNull(ports);
+assertEquals(3, ports.length);
+assertEquals(80, ports[0]);
+assertEquals(800, ports[1]);
+assertEquals(8000, ports[2]);
 assertTrue(cookie.isPortAttributeSpecified());
 }
 
@@ -228,7 +232,10 @@
 assertNotNull(parsed);
 assertEquals(1, parsed.length);
 Cookie2 cookie = (Cookie2) parsed[0];
-assertEquals(new int[] {80}, cookie.getPorts());
+int[] ports = cookie.getPorts();
+assertNotNull(ports);
+assertEquals(1, ports.length);
+assertEquals(80, ports[0]);
 assertTrue(cookie.isPortAttributeSpecified()  
cookie.isPortAttributeBlank());
 }
 
@@ -240,7 +247,10 @@
 assertNotNull(parsed);
 assertEquals(1, parsed.length);
 Cookie2 cookie = (Cookie2) parsed[0];
-assertEquals(new int[] {80}, cookie.getPorts());
+int[] ports = cookie.getPorts();
+assertNotNull(ports);
+assertEquals(1, ports.length);
+assertEquals(80, ports[0]);
 assertTrue(cookie.isPortAttributeSpecified()  
cookie.isPortAttributeBlank());
 }
 
@@ -603,7 +613,11 @@
 assertNotNull(parsed);
 assertEquals(1, parsed.length);
 Cookie2 cookie = (Cookie2) parsed[0];
-assertEquals(new int[] {80, 800}, cookie.getPorts());
+int[] ports = cookie.getPorts();
+assertNotNull(ports);
+assertEquals(2, ports.length);
+assertEquals(80, ports[0]);
+assertEquals(800, ports[1]);
 }
 
 /**
@@ -799,42 +813,6 @@
 assertEquals(value, parsed[0].getValue());
 assertEquals(.domain.com, parsed[0].getDomain());
 assertEquals(/, parsed[0].getPath());
-}
-
-// --- Helper Methods
-
-/**
- * Asserts that two arrays are equal (deep equality).
- * @param expected expected array
- * @param actual actual array
- */
-public static void assertEquals(int[] expected, int[] actual) {
-if (Arrays.equals(expected, actual))
-return;
-failNotEquals(null, intarrayToString(expected), 
intarrayToString(actual));
-}
-
-public static void failNotEquals(String message, Object expected, Object 
actual) {
-fail(format(message, expected, actual));
-}
-
-public static String format(String message, Object expected, Object 
actual) {
-String formatted= ;
-if (message != null)
-formatted = message +  ;
-return formatted + expected: + expected +  but was: + actual + 
;
-}
-
-static private String intarrayToString(int[] arr) {
-StringBuffer buffer = new StringBuffer();
-buffer.append([);
-for (int i = 0, len = arr.length; i  len; i++) {
-buffer.append(arr[i]);
-if (i  (len - 1))
-buffer.append(, );
-}
-buffer.append(]);
-return buffer.toString();
 }
 
 }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r397988 - in /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie: CookieAttributeHandler.java RFC2965Spec.java

2006-04-28 Thread olegk
Author: olegk
Date: Fri Apr 28 12:27:19 2006
New Revision: 397988

URL: http://svn.apache.org/viewcvs?rev=397988view=rev
Log:
Simplied cookie formatting. CookieAttributeHandler#format() provided no real 
benefit 

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java?rev=397988r1=397987r2=397988view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/CookieAttributeHandler.java
 Fri Apr 28 12:27:19 2006
@@ -73,14 +73,4 @@
*/
   boolean match(Cookie cookie, CookieSource source);
 
-  /**
-   * Format the cookie attribute suitable for sending in a cookie request 
header and
-   * append it to the given buffer.
-   *
-   * @param buffer the string buffer to use for output
-   * @param cookie [EMAIL PROTECTED] org.apache.commons.httpclient.Cookie} to 
get the attribute
-   *from.
-   */
-  void format(StringBuffer buffer, Cookie cookie);
-  
 }

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?rev=397988r1=397987r2=397988view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 Fri Apr 28 12:27:19 2006
@@ -400,6 +400,34 @@
 return true;
 }
 
+private void doFormatCookie2(final Cookie2 cookie, final StringBuffer 
buffer) {
+String name = cookie.getName();
+String value = cookie.getValue();
+if (value == null) {
+value = ;
+}
+this.formatter.format(buffer, new NameValuePair(name, value));
+// format domain attribute
+if (cookie.getDomain() != null  cookie.isDomainAttributeSpecified()) 
{
+buffer.append(; );
+this.formatter.format(buffer, new NameValuePair($Domain, 
cookie.getDomain()));
+}
+// format path attribute
+if ((cookie.getPath() != null)  (cookie.isPathAttributeSpecified())) 
{
+buffer.append(; );
+this.formatter.format(buffer, new NameValuePair($Path, 
cookie.getPath()));
+}
+// format port attribute
+if (cookie.isPortAttributeSpecified()) {
+String portValue = ;
+if (!cookie.isPortAttributeBlank()) {
+portValue = createPortAttribute(cookie.getPorts());
+}
+buffer.append(; );
+this.formatter.format(buffer, new NameValuePair($Port, 
portValue));
+}
+}
+
 /**
  * Return a string suitable for sending in a ttCookie/tt header as
  * defined in RFC 2965
@@ -412,20 +440,18 @@
 if (cookieParam == null) {
 throw new IllegalArgumentException(Cookie may not be null);
 }
-if (!(cookieParam instanceof Cookie2)) {
+if (cookieParam instanceof Cookie2) {
+/* format cookie2 cookie */
+Cookie2 cookie = (Cookie2) cookieParam;
+final StringBuffer buffer = new StringBuffer();
+this.formatter.format(buffer, new NameValuePair($Version, 1));
+buffer.append(; );
+doFormatCookie2(cookie, buffer);
+return buffer.toString();
+} else {
 // old-style cookies are formatted according to the old rules
 return this.rfc2109.formatCookie(cookieParam);
 }
-
-/* format cookie2 cookie */
-Cookie2 cookie = (Cookie2) cookieParam;
-final StringBuffer buffer = new StringBuffer();
-// format cookie version
-CookieAttributeHandler handler = getAttribHandler(Cookie2.VERSION);
-handler.format(buffer, cookie);
-// format cookie attributes
-formatCookieAttributes(buffer, cookie);
-return buffer.toString();
 }
 
 /**
@@ -449,48 +475,24 @@
 break

svn commit: r398025 - in /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie: Cookie2.java RFC2965Spec.java

2006-04-28 Thread olegk
Author: olegk
Date: Fri Apr 28 14:46:53 2006
New Revision: 398025

URL: http://svn.apache.org/viewcvs?rev=398025view=rev
Log:
Various (rather minor but numerous) code cleaups

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/Cookie2.java

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/Cookie2.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/Cookie2.java?rev=398025r1=398024r2=398025view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/Cookie2.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/Cookie2.java
 Fri Apr 28 14:46:53 2006
@@ -55,8 +55,6 @@
 public static final String COMMENTURL = commenturl;
 public static final String DISCARD = discard;
 
-public static final String COOKIE_NAME_KEY = cookieName;
-
 /**
  * Default constructor. Creates a blank cookie
  */

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?rev=398025r1=398024r2=398025view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 Fri Apr 28 14:46:53 2006
@@ -90,7 +90,6 @@
 this.attribHandlerList = new ArrayList(10);
 this.rfc2109 = new RFC2109Spec();
 
-registerAttribHandler(Cookie2.COOKIE_NAME_KEY, new 
Cookie2NameAttributeHandler());
 registerAttribHandler(Cookie2.PATH, new Cookie2PathAttributeHandler());
 registerAttribHandler(Cookie2.DOMAIN, new 
Cookie2DomainAttributeHandler());
 registerAttribHandler(Cookie2.PORT, new Cookie2PortAttributeHandler());
@@ -344,15 +343,21 @@
 LOG.trace(enter RFC2965Spec.validate(String, int, String, 
   + boolean, Cookie));
 
-if (!(cookie instanceof Cookie2)) {
+if (cookie instanceof Cookie2) {
+if (cookie.getName().indexOf(' ') != -1) {
+throw new MalformedCookieException(Cookie name may not 
contain blanks);
+}
+if (cookie.getName().startsWith($)) {
+throw new MalformedCookieException(Cookie name may not start 
with $);
+}
+CookieSource cookiesource = new CookieSource(host, port, path, 
secure); 
+for (Iterator i = getAttribHandlerIterator(); i.hasNext(); ) {
+  CookieAttributeHandler handler = (CookieAttributeHandler) 
i.next();
+  handler.validate(cookie, cookiesource);
+}
+} else {
 // old-style cookies are validated according to the old rules
 this.rfc2109.validate(host, port, path, secure, cookie);
-return;
-}
-CookieSource cookiesource = new CookieSource(host, port, path, 
secure); 
-for (Iterator i = getAttribHandlerIterator(); i.hasNext(); ) {
-   CookieAttributeHandler handler = (CookieAttributeHandler) 
i.next();
-   handler.validate(cookie, cookiesource);
 }
 }
 
@@ -371,33 +376,32 @@
 
 LOG.trace(enter RFC2965.match(
   + String, int, String, boolean, Cookie);
-
 if (cookie == null) {
 throw new IllegalArgumentException(Cookie may not be null);
 }
-
-if (!(cookie instanceof Cookie2)) {
+if (cookie instanceof Cookie2) {
+CookieSource cookiesource = new CookieSource(host, port, path, 
secure); 
+for (Iterator i = getAttribHandlerIterator(); i.hasNext(); ) {
+CookieAttributeHandler handler = (CookieAttributeHandler) 
i.next();
+if (!handler.match(cookie, cookiesource)) {
+return false;
+}
+}
+// check if cookie has expired
+if (cookie.isPersistent()  cookie.isExpired()) {
+return false;
+}
+// finally make sure that if cookie Secure attribute is set, then 
this
+// request is made using a secure connection
+if (cookie.getSecure()) {
+return secure

svn commit: r397155 - /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

2006-04-26 Thread olegk
Author: olegk
Date: Wed Apr 26 02:26:13 2006
New Revision: 397155

URL: http://svn.apache.org/viewcvs?rev=397155view=rev
Log:
Refactored the internal management of the cookie attribute handlers

Modified:

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?rev=397155r1=397154r2=397155view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 Wed Apr 26 02:26:13 2006
@@ -58,10 +58,15 @@
 private final ParameterFormatter formatter;
  
 /**
+ * Stores the list of attribute handlers
+ */
+private final List attribHandlerList;
+
+/**
 * Stores attribute name - attribute handler mappings
 */
-private static Map attributeHandlerMap = null;
-
+private final Map attribHandlerMap;
+
 /** 
  * Default constructor 
  * */
@@ -69,24 +74,64 @@
 super();
 this.formatter = new ParameterFormatter();
 this.formatter.setAlwaysUseQuotes(true);
-initializeAttributeHandlerMap();
+this.attribHandlerMap = new HashMap(10);
+this.attribHandlerList = new ArrayList(10);
+
+registerAttribHandler(Cookie2.COOKIE_NAME_KEY, new 
Cookie2NameAttributeHandler());
+registerAttribHandler(Cookie2.PATH, new Cookie2PathAttributeHandler());
+registerAttribHandler(Cookie2.DOMAIN, new 
Cookie2DomainAttributeHandler());
+registerAttribHandler(Cookie2.PORT, new Cookie2PortAttributeHandler());
+registerAttribHandler(Cookie2.VERSION, new 
Cookie2VersionAttributeHandler());
+registerAttribHandler(Cookie2.MAXAGE, new 
Cookie2MaxageAttributeHandler());
 }
 
+protected void registerAttribHandler(
+final String name, final CookieAttributeHandler handler) {
+if (name == null) {
+throw new IllegalArgumentException(Attribute name may not be 
null);
+}
+if (handler == null) {
+throw new IllegalArgumentException(Attribute handler may not be 
null);
+}
+if (!this.attribHandlerList.contains(handler)) {
+this.attribHandlerList.add(handler);
+}
+this.attribHandlerMap.put(name, handler);
+}
+
 /**
-* initializes attribute name - attribute handler mappings.
-* Called from constructor.
-*/
-private void initializeAttributeHandlerMap() {
-if (attributeHandlerMap == null) {
-attributeHandlerMap = new HashMap();
-attributeHandlerMap.put(Cookie2.COOKIE_NAME_KEY, new 
Cookie2NameAttributeHandler());
-attributeHandlerMap.put(Cookie2.PATH, new 
Cookie2PathAttributeHandler());
-attributeHandlerMap.put(Cookie2.DOMAIN, new 
Cookie2DomainAttributeHandler());
-attributeHandlerMap.put(Cookie2.PORT, new 
Cookie2PortAttributeHandler());
-attributeHandlerMap.put(Cookie2.VERSION, new 
Cookie2VersionAttributeHandler());
-attributeHandlerMap.put(Cookie2.MAXAGE, new 
Cookie2MaxageAttributeHandler());
+ * Finds an attribute handler [EMAIL PROTECTED] CookieAttributeHandler} 
for the
+ * given attribute. Returns ttnull/tt if no attribute handler is
+ * found for the specified attribute.
+ *
+ * @param name attribute name. e.g. Domain, Path, etc.
+ * @return an attribute handler or ttnull/tt
+ */
+protected CookieAttributeHandler findAttribHandler(final String name) {
+return (CookieAttributeHandler) this.attribHandlerMap.get(name);
+}
+
+/**
+ * Gets attribute handler [EMAIL PROTECTED] CookieAttributeHandler} for the
+ * given attribute.
+ *
+ * @param name attribute name. e.g. Domain, Path, etc.
+ * @throws IllegalStateException if handler not found for the
+ *  specified attribute.
+ */
+protected CookieAttributeHandler getAttribHandler(final String name) {
+CookieAttributeHandler handler = findAttribHandler(name);
+if (handler == null) {
+throw new IllegalStateException(Handler not registered for  +
+name +  attribute.);
+} else {
+return handler;
 }
 }
+
+protected Iterator getAttribHandlerIterator() {
+return this.attribHandlerList.iterator();
+}
 
 /**
  * Parses the Set-Cookie2 value into an array

svn commit: r396995 - in /jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH: ./ src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

2006-04-25 Thread olegk
Author: olegk
Date: Tue Apr 25 14:56:51 2006
New Revision: 396995

URL: http://svn.apache.org/viewcvs?rev=396995view=rev
Log:
Minor javadoc cleanup

Modified:
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/   (props 
changed)

jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java

Propchange: jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/
--
--- svn:ignore (original)
+++ svn:ignore Tue Apr 25 14:56:51 2006
@@ -1,3 +1,4 @@
+
 dist
 build.properties
 target
@@ -8,3 +9,4 @@
 bin
 classes
 log4j-tests.properties
+.settings

Modified: 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?rev=396995r1=396994r2=396995view=diff
==
--- 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/branches/COOKIE_2_BRANCH/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
 Tue Apr 25 14:56:51 2006
@@ -38,12 +38,12 @@
 import java.util.*;
 
 /**
- * pRFC 2965 specific cookie management functions. *
- * @author @author [EMAIL PROTECTED] (Samit Jain)
+ * pRFC 2965 specific cookie management functions./p
+ * 
+ * @author [EMAIL PROTECTED] (Samit Jain)
  *
- * @since 3.0
+ * @since 3.1
  */
-
 public class RFC2965Spec extends CookieSpecBase implements 
CookieVersionSupport {
 
 /**



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r390048 - /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java

2006-03-30 Thread olegk
Author: olegk
Date: Thu Mar 30 01:51:02 2006
New Revision: 390048

URL: http://svn.apache.org/viewcvs?rev=390048view=rev
Log:
PR #39047 (Disallow the use of SecureProtocolSocketFactory with ProxyClient)

Contributed by Oleg Kalnichevski
Reviewed by Roland Weber and Ortwin Glück

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java?rev=390048r1=390047r2=390048view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java
 Thu Mar 30 01:51:02 2006
@@ -36,7 +36,6 @@
 import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
 import org.apache.commons.httpclient.params.HttpParams;
 
-
 /**
  * A client that provides [EMAIL PROTECTED] java.net.Socket sockets} for 
communicating through HTTP proxies
  * via the HTTP CONNECT method.  This is primarily needed for non-HTTP 
protocols that wish to 
@@ -179,12 +178,16 @@
  */
 public ConnectResponse connect() throws IOException, HttpException {
 
-if (getHostConfiguration().getProxyHost() == null) {
+HostConfiguration hostconf = getHostConfiguration();
+if (hostconf.getProxyHost() == null) {
 throw new IllegalStateException(proxy host must be configured);
 }
-if (getHostConfiguration().getHost() == null) {
+if (hostconf.getHost() == null) {
 throw new IllegalStateException(destination host must be 
configured);
 }
+if (hostconf.getProtocol().isSecure()) {
+throw new IllegalStateException(secure protocol socket factory 
may not be used);
+}
 
 ConnectMethod method = new ConnectMethod();
 method.getParams().setDefaults(getParams());
@@ -194,7 +197,7 @@
 
 HttpMethodDirector director = new HttpMethodDirector(
 connectionManager,
-getHostConfiguration(),
+hostconf,
 getParams(),
 getState()
 );



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r390058 - in /jakarta/commons/proper/httpclient/trunk: ./ src/java/org/apache/commons/httpclient/

2006-03-30 Thread olegk
Author: olegk
Date: Thu Mar 30 02:09:57 2006
New Revision: 390058

URL: http://svn.apache.org/viewcvs?rev=390058view=rev
Log:
PR #36918 (Digest auth uses wrong uri in proxy authentication)

Changelog:
Digest auth scheme fixed to generate correct digest uri in HTTP CONNECT requests

Contributed by Oleg Kalnichevski
Reviewed by Ortwin Glück

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ConnectMethod.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/release_notes.txt?rev=390058r1=390057r2=390058view=diff
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Thu Mar 30 
02:09:57 2006
@@ -1,3 +1,9 @@
+Changes toward 3.1 
+
+ * 36918 - Digest auth scheme now uses correct digest uri in HTTP CONNECT 
+   requests
+   Contributed by Oleg Kalnichevski olegk at apache.org
+
 Changes since Release 3.0:
 
  * 38818 - Failed CONNECT no longer leaves connection in an inconsistent state

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ConnectMethod.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ConnectMethod.java?rev=390058r1=390057r2=390058view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ConnectMethod.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ConnectMethod.java
 Thu Mar 30 02:09:57 2006
@@ -49,13 +49,18 @@
 /** the name of this method */
 public static final String NAME = CONNECT;
 
+private final HostConfiguration targethost;
+
 /**
+ * @deprecated use #ConnectMethod(HttpHost);
+ * 
  * Create a connect method.
  * 
  * @since 3.0
  */
 public ConnectMethod() {
-LOG.trace(enter ConnectMethod());
+super();
+this.targethost = null;
 }
 
 /**
@@ -67,7 +72,21 @@
  *  to the server
  */
 public ConnectMethod(HttpMethod method) {
-LOG.trace(enter ConnectMethod(HttpMethod));
+super();
+this.targethost = null;
+}
+
+/**
+ * Create a connect method.
+ * 
+ * @since 3.0
+ */
+public ConnectMethod(final HostConfiguration targethost) {
+super();
+if (targethost == null) {
+throw new IllegalArgumentException(Target host may not be null);
+}
+this.targethost = targethost;
 }
 
 /**
@@ -78,6 +97,26 @@
 public String getName() {
 return NAME;
 }
+
+public String getPath() {
+if (this.targethost != null) {
+StringBuffer buffer = new StringBuffer();
+buffer.append(this.targethost.getHost()); 
+int port = this.targethost.getPort();
+if (port == -1) {
+port = this.targethost.getProtocol().getDefaultPort();  
+}
+buffer.append(':'); 
+buffer.append(port);
+return buffer.toString();
+} else {
+return /;
+}
+}
+
+public URI getURI() throws URIException {
+return new URI(getPath(), true);
+}
 
 /**
  * This method does nothing. ttCONNECT/tt request is not supposed 
@@ -158,15 +197,17 @@
  */
 protected void writeRequestLine(HttpState state, HttpConnection conn)
 throws IOException, HttpException {
-int port = conn.getPort();
-if (port == -1) {
-port = conn.getProtocol().getDefaultPort();  
-}
 StringBuffer buffer = new StringBuffer();
 buffer.append(getName()); 
 buffer.append(' '); 
-buffer.append(conn.getHost()); 
-if (port  -1) {
+if (this.targethost != null) {
+buffer.append(getPath()); 
+} else {
+int port = conn.getPort();
+if (port == -1) {
+port = conn.getProtocol().getDefaultPort();  
+}
+buffer.append(conn.getHost()); 
 buffer.append(':'); 
 buffer.append(port); 
 }

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java?rev=390058r1=390057r2=390058view=diff

svn commit: r388628 - in /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark: ./ BenchmarkWorker.java FileRequestEntity.java HttpBenchmark.java Stats.j

2006-03-24 Thread olegk
Author: olegk
Date: Fri Mar 24 12:36:22 2006
New Revision: 388628

URL: http://svn.apache.org/viewcvs?rev=388628view=rev
Log:
A simple HTTP benchmark tool based on HttpClient, which implements a subset of 
AB (Apache Benchmark) interface
Backported from Jakarta HttpComponents HttpCore

Added:

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/
  - copied from r388545, 
jakarta/httpcomponents/trunk/http-core/src/contrib/org/apache/http/contrib/benchmark/

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/FileRequestEntity.java
   (with props)
Modified:

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/BenchmarkWorker.java

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/HttpBenchmark.java

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/Stats.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/BenchmarkWorker.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/BenchmarkWorker.java?rev=388628r1=388545r2=388628view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/BenchmarkWorker.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/BenchmarkWorker.java
 Fri Mar 24 12:36:22 2006
@@ -26,87 +26,75 @@
  * http://www.apache.org/.
  *
  */
-package org.apache.http.contrib.benchmark;
+package org.apache.commons.httpclient.contrib.benchmark;
 
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.apache.http.ConnectionReuseStrategy;
-import org.apache.http.Header;
-import org.apache.http.HttpClientConnection;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpException;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpResponse;
-import org.apache.http.impl.DefaultConnectionReuseStrategy;
-import org.apache.http.protocol.HttpRequestExecutor;
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.HostConfiguration;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.HttpMethod;
 
 /**
- * p
- * /p
+ * pBenchmark worker that can execute an HTTP method given number of 
times/p
+ * 
  * @author a href=mailto:oleg at ural.ruOleg Kalnichevski/a
  *
  * @version $Revision$
- * 
- * @since 4.0
  */
 public class BenchmarkWorker {
 
 private byte[] buffer = new byte[4096];
 private final int verbosity;
-private final HttpRequestExecutor httpexecutor;
-private final ConnectionReuseStrategy connstrategy;
+private final HttpClient httpexecutor;
 
-public BenchmarkWorker(final HttpRequestExecutor httpexecutor, int 
verbosity) {
+public BenchmarkWorker(final HttpClient httpexecutor, int verbosity) {
 super();
 this.httpexecutor = httpexecutor;
-this.connstrategy = new DefaultConnectionReuseStrategy();
 this.verbosity = verbosity;
 }
 
 public Stats execute(
-final HttpRequest request, 
-final HttpClientConnection conn, 
+final HostConfiguration hostconf,
+final HttpMethod method, 
 int count,
 boolean keepalive) throws HttpException {
-HttpResponse response = null;
 Stats stats = new Stats();
 stats.start();
 for (int i = 0; i  count; i++) {
 try {
-response = this.httpexecutor.execute(request, conn);
+this.httpexecutor.executeMethod(hostconf, method);
 if (this.verbosity = 4) {
-System.out.println(  + 
request.getRequestLine().toString());
-Header[] headers = request.getAllHeaders();
+System.out.println(  + method.getName() +   + 
+method.getURI() +   + 
method.getParams().getVersion());
+Header[] headers = method.getRequestHeaders();
 for (int h = 0; h  headers.length; h++) {
-System.out.println(  + headers[h].toString());
+System.out.print(  + headers[h].toString());
 }
 System.out.println();
 }
 if (this.verbosity = 3) {
-
System.out.println(response.getStatusLine().getStatusCode());
+System.out.println(method.getStatusLine().getStatusCode());
 }
 if (this.verbosity = 4

svn commit: r386156 - in /jakarta/commons/proper/httpclient/trunk: maven.xml project.properties xdocs/navigation.xml xdocs/style/ xdocs/style/project.css xdocs/stylesheets/

2006-03-15 Thread olegk
Author: olegk
Date: Wed Mar 15 12:32:28 2006
New Revision: 386156

URL: http://svn.apache.org/viewcvs?rev=386156view=rev
Log:
Removed dependency on common-build

Added:
jakarta/commons/proper/httpclient/trunk/xdocs/style/
jakarta/commons/proper/httpclient/trunk/xdocs/style/project.css   (with 
props)
Removed:
jakarta/commons/proper/httpclient/trunk/xdocs/stylesheets/
Modified:
jakarta/commons/proper/httpclient/trunk/maven.xml
jakarta/commons/proper/httpclient/trunk/project.properties
jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml

Modified: jakarta/commons/proper/httpclient/trunk/maven.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/maven.xml?rev=386156r1=386155r2=386156view=diff
==
--- jakarta/commons/proper/httpclient/trunk/maven.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/maven.xml Wed Mar 15 12:32:28 2006
@@ -3,23 +3,6 @@
 
 project xmlns:ant=jelly:ant
 
-  !-- == --
-  !-- START : C O M M O N S - B U I L D  --
-  !-- == --
-  !-- Required: Look and Feel for documentation within distributions --
-  !-- == --
-  postGoal name=xdoc:copy-resources  
-ant:copy todir=${basedir}/target/docs/style/ failonerror=false
-  fileset dir=${basedir}/../commons-build/xdocs/style
-   include name='**/*'/
-   exclude name='**/CVS/**'/
-  /fileset
-/ant:copy
-  /postGoal
-  !-- == --
-  !-- END: C O M M O N S - B U I L D --
-  !-- == --
-
   !-- 
 Builds the HttpClient distribution.  Ensures that the site docs are 
included 
 in the dist. 

Modified: jakarta/commons/proper/httpclient/trunk/project.properties
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/project.properties?rev=386156r1=386155r2=386156view=diff
==
--- jakarta/commons/proper/httpclient/trunk/project.properties (original)
+++ jakarta/commons/proper/httpclient/trunk/project.properties Wed Mar 15 
12:32:28 2006
@@ -1,6 +1,5 @@
 # Maven specific project properties
 
-maven.xdoc.jsl=../commons-build/commons-site.jsl
 maven.xdoc.date=left
 maven.xdoc.version=${pom.currentVersion}
 maven.checkstyle.properties=checkstyle.xml.properties

Modified: jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml?rev=386156r1=386155r2=386156view=diff
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml Wed Mar 15 
12:32:28 2006
@@ -1,5 +1,5 @@
 ?xml version=1.0 encoding=ISO-8859-1?
-!DOCTYPE org.apache.commons.menus SYSTEM 
'../../commons-build/menus/menus.dtd'
+!DOCTYPE org.apache.commons.menus SYSTEM 
'http://jakarta.apache.org/commons/build/maven-build.dtd'
 project name=HttpClient
 
   properties
@@ -38,7 +38,7 @@
   /item
 /menu
 
-common-menus;
+commons;
 
   /body
 /project

Added: jakarta/commons/proper/httpclient/trunk/xdocs/style/project.css
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/xdocs/style/project.css?rev=386156view=auto
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/style/project.css (added)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/style/project.css Wed Mar 15 
12:32:28 2006
@@ -0,0 +1 @@
[EMAIL PROTECTED] url(http://jakarta.apache.org/style/jakarta-maven.css;);

Propchange: jakarta/commons/proper/httpclient/trunk/xdocs/style/project.css
--
svn:eol-style = native

Propchange: jakarta/commons/proper/httpclient/trunk/xdocs/style/project.css
--
svn:keywords = Date Author Id Revision HeadURL

Propchange: jakarta/commons/proper/httpclient/trunk/xdocs/style/project.css
--
svn:mime-type = text/css



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r386159 - /jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml

2006-03-15 Thread olegk
Author: olegk
Date: Wed Mar 15 12:52:48 2006
New Revision: 386159

URL: http://svn.apache.org/viewcvs?rev=386159view=rev
Log:
Removed link to the HttpClient 2.0 docs

Modified:
jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml

Modified: jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml?rev=386159r1=386158r2=386159view=diff
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/navigation.xml Wed Mar 15 
12:52:48 2006
@@ -11,7 +11,6 @@
 
   body
 menu name=Overview
-  item name=HttpClient 2.0 href=2.0/index.html/
   item name=Features href=/features.html/
   item name=News href=/news.html/
   item name=Status href=/status.html/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r383501 - /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java

2006-03-06 Thread olegk
Author: olegk
Date: Mon Mar  6 01:41:35 2006
New Revision: 383501

URL: http://svn.apache.org/viewcvs?rev=383501view=rev
Log:
PR #38818 (Failed CONNECT leaves connection in an inconsistent state)

Contributed by Oleg Kalnichevski
Reviewed by Roland Weber, Michael Becke, Ortwin Glück

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java?rev=383501r1=383500r2=383501view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
 Mon Mar  6 01:41:35 2006
@@ -515,6 +515,7 @@
 this.connectMethod = null;
 return true;
 } else {
+this.conn.close();
 return false;
 }
 }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r383502 - /jakarta/commons/proper/httpclient/trunk/release_notes.txt

2006-03-06 Thread olegk
Author: olegk
Date: Mon Mar  6 01:43:34 2006
New Revision: 383502

URL: http://svn.apache.org/viewcvs?rev=383502view=rev
Log:
PR #38818

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/release_notes.txt?rev=383502r1=383501r2=383502view=diff
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Mon Mar  6 
01:43:34 2006
@@ -1,5 +1,8 @@
 Changes since Release 3.0:
 
+ * 38818 - Failed CONNECT no longer leaves connection in an inconsistent state
+   Contributed by Oleg Kalnichevski olegk at apache.org
+
  * 38636 - Calling HttpState.clearCookies() is now safe from a different 
thread.
Contributed by Peter Dolberg observewisdom at yahoo.com
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r381320 - in /jakarta/commons/proper/httpclient/trunk/xdocs: news.xml status.xml

2006-02-27 Thread olegk
Author: olegk
Date: Mon Feb 27 03:33:25 2006
New Revision: 381320

URL: http://svn.apache.org/viewcvs?rev=381320view=rev
Log:
HttpClient 2.0 declared End of Life

Modified:
jakarta/commons/proper/httpclient/trunk/xdocs/news.xml
jakarta/commons/proper/httpclient/trunk/xdocs/status.xml

Modified: jakarta/commons/proper/httpclient/trunk/xdocs/news.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/xdocs/news.xml?rev=381320r1=381319r2=381320view=diff
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/news.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/news.xml Mon Feb 27 03:33:25 
2006
@@ -10,6 +10,11 @@
   /properties
 
   body
+section name=27 February 2006 - HttpClient 2.x codebase declared 
'End of Life'
+p
+HttpClient 2.x will no longer be supported. There will be no 
more HttpClient 2.x releases
+/p
+/section
 section name=19 December 2005 - HttpClient 3.0 released
 p
 The Jakarta Commons HttpClient project is pleased to announce 
the release of HttpClient 3.0.  

Modified: jakarta/commons/proper/httpclient/trunk/xdocs/status.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/xdocs/status.xml?rev=381320r1=381319r2=381320view=diff
==
--- jakarta/commons/proper/httpclient/trunk/xdocs/status.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/xdocs/status.xml Mon Feb 27 
03:33:25 2006
@@ -17,13 +17,7 @@
 pHttpClient 3.0 has arrived! We strongly encourage all current 
HttpClient 
users to migrate./p
 
-pHttpClient 2.0 is no longer being actively developed, with the 
exception of 
-bug fixes and minor enhancements.  2.0.2 is the latest stable 
release./p
-
-pIt is important to note that HttpClient 3.0 is no longer fully 
compatible 
-with the 2.0.x APIs. API incompatibilities with HttpClient 2.0.x are 
described 
-a 
href=http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/httpclient/trunk/API_CHANGES_3_0.txt?view=markup;here/a.
-/p
+pHttpClient 2.0 is no longer being actively developed and 
supported./p
 
 pBug reports targeted for the next release can be found
  a 
href=http://issues.apache.org/bugzilla/buglist.cgi?query_format=advancedamp;short_desc_type=allwordssubstramp;short_desc=amp;product=HttpClientamp;component=Commons+HttpClientamp;target_milestone=3.0.1amp;long_desc_type=allwordssubstramp;long_desc=amp;bug_file_loc_type=allwordssubstramp;bug_file_loc=amp;keywords_type=anywordsamp;keywords=amp;bug_status=NEWamp;bug_status=ASSIGNEDamp;bug_status=REOPENEDamp;emailassigned_to1=1amp;emailtype1=substringamp;email1=amp;emailreporter2=1amp;emailtype2=substringamp;email2=amp;bugidtype=includeamp;bug_id=amp;votes=amp;chfieldfrom=amp;chfieldto=Nowamp;chfieldvalue=amp;cmdtype=doitamp;order=Reuse+same+sort+as+last+timeamp;field0-0-0=noopamp;type0-0-0=noopamp;value0-0-0=;here/a.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r376971 - in /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl: AuthSSLProtocolSocketFactory.java EasySSLProtocolSocketFactory.java StrictSSLPr

2006-02-11 Thread olegk
Author: olegk
Date: Sat Feb 11 03:57:16 2006
New Revision: 376971

URL: http://svn.apache.org/viewcvs?rev=376971view=rev
Log:
Changed 'contrib' SSL protocol socket factories to make use of Java 1.4 
detached socket support

Contributed by Oleg Kalnichevski

Modified:

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/StrictSSLProtocolSocketFactory.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java?rev=376971r1=376970r2=376971view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java
 Sat Feb 11 03:57:16 2006
@@ -31,7 +31,9 @@
 
 import java.io.IOException;
 import java.net.InetAddress;
+import java.net.InetSocketAddress;
 import java.net.Socket;
+import java.net.SocketAddress;
 import java.net.URL;
 import java.net.UnknownHostException;
 import java.security.GeneralSecurityException;
@@ -46,11 +48,11 @@
 
 import org.apache.commons.httpclient.ConnectTimeoutException;
 import org.apache.commons.httpclient.params.HttpConnectionParams;
-import org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory;
 import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory;
 import org.apache.commons.logging.Log; 
 import org.apache.commons.logging.LogFactory;
 
+import javax.net.SocketFactory;
 import javax.net.ssl.KeyManager;
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLContext;
@@ -355,12 +357,16 @@
 throw new IllegalArgumentException(Parameters may not be null);
 }
 int timeout = params.getConnectionTimeout();
+SocketFactory socketfactory = getSSLContext().getSocketFactory();
 if (timeout == 0) {
-return createSocket(host, port, localAddress, localPort);
+return socketfactory.createSocket(host, port, localAddress, 
localPort);
 } else {
-// To be eventually deprecated when migrated to Java 1.4 or above
-return ControllerThreadSocketFactory.createSocket(
-this, host, port, localAddress, localPort, timeout);
+Socket socket = socketfactory.createSocket();
+SocketAddress localaddr = new InetSocketAddress(localAddress, 
localPort);
+SocketAddress remoteaddr = new InetSocketAddress(host, port);
+socket.bind(localaddr);
+socket.connect(remoteaddr, timeout);
+return socket;
 }
 }
 

Modified: 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java?rev=376971r1=376970r2=376971view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java
 Sat Feb 11 03:57:16 2006
@@ -31,17 +31,19 @@
 
 import java.io.IOException;
 import java.net.InetAddress;
+import java.net.InetSocketAddress;
 import java.net.Socket;
+import java.net.SocketAddress;
 import java.net.UnknownHostException;
 
 import org.apache.commons.httpclient.ConnectTimeoutException;
 import org.apache.commons.httpclient.HttpClientError;
 import org.apache.commons.httpclient.params.HttpConnectionParams;
-import org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory;
 import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory;
 import org.apache.commons.logging.Log; 
 import org.apache.commons.logging.LogFactory;
 
+import javax.net.SocketFactory;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.TrustManager;
 
@@ -175,12 +177,16 @@
 throw new IllegalArgumentException(Parameters may not be null);
 }
 int timeout = params.getConnectionTimeout();
+SocketFactory socketfactory = getSSLContext().getSocketFactory();
 if (timeout == 0) {
-return

svn commit: r376972 - /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java

2006-02-11 Thread olegk
Author: olegk
Date: Sat Feb 11 04:09:19 2006
New Revision: 376972

URL: http://svn.apache.org/viewcvs?rev=376972view=rev
Log:
PR #38612 (EasyX509TrustManager no longer checks cert expiry)

Contributed by Julius Davies juliusdavies at hotmail.com
Reviewed by Oleg Kalnichevski

Modified:

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java?rev=376972r1=376971r2=376972view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java
 Sat Feb 11 04:09:19 2006
@@ -98,13 +98,7 @@
 }
 }
 if ((certificates != null)  (certificates.length == 1)) {
-X509Certificate certificate = certificates[0];
-try {
-certificate.checkValidity(); 
-}
-catch (CertificateException e) {
-LOG.error(e.toString());
-}
+certificates[0].checkValidity();
 } else {
 standardTrustManager.checkServerTrusted(certificates,authType);
 }



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r376695 - in /jakarta/commons/proper/httpclient/trunk: ./ src/contrib/org/apache/commons/httpclient/contrib/auth/

2006-02-10 Thread olegk
Author: olegk
Date: Fri Feb 10 06:11:06 2006
New Revision: 376695

URL: http://svn.apache.org/viewcvs?rev=376695view=rev
Log:
SPNEGO contrib for httpclient 3.x
http://devel.it.su.se/pub/jsp/polopoly.jsp?d=1026a=3329

Contributed by Mikael Wikström mikael.wikstrom at it.su.se

Added:

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/auth/

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/auth/CustomAuthenticationNegotiateExample.java
   (with props)

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/auth/NegotiateScheme.java
   (with props)
Modified:
jakarta/commons/proper/httpclient/trunk/project.xml

Modified: jakarta/commons/proper/httpclient/trunk/project.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/project.xml?rev=376695r1=376694r2=376695view=diff
==
--- jakarta/commons/proper/httpclient/trunk/project.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/project.xml Fri Feb 10 06:11:06 2006
@@ -124,6 +124,9 @@
 branch
   tagHTTPCLIENT_2_0_BRANCH/tag
 /branch
+branch
+  tagHTTPCLIENT_3_0_BRANCH/tag
+/branch
   /branches
 
   mailingLists
@@ -283,6 +286,10 @@
 contributor
   nameLaura Werner/name
   emaillaura -at- lwerner.org/email
+/contributor
+contributor
+  nameMikael Wilstrom/name
+  emailmikael.wikstrom -at- it.su.se/email
 /contributor
   /contributors
 

Added: 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/auth/CustomAuthenticationNegotiateExample.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/auth/CustomAuthenticationNegotiateExample.java?rev=376695view=auto
==
--- 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/auth/CustomAuthenticationNegotiateExample.java
 (added)
+++ 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/auth/CustomAuthenticationNegotiateExample.java
 Fri Feb 10 06:11:06 2006
@@ -0,0 +1,116 @@
+/*
+ * $Header: $
+ * $Revision: $
+ * $Date: $
+ *
+ * 
+ *
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the License);
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an AS IS BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * http://www.apache.org/.
+ *
+ */
+package org.apache.commons.httpclient.contrib.auth;
+
+import java.util.ArrayList;
+
+import org.apache.commons.httpclient.Credentials;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.auth.AuthPolicy;
+import org.apache.commons.httpclient.auth.AuthScope;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.params.DefaultHttpParams;
+import org.apache.commons.httpclient.params.HttpParams;
+
+/**
+ * A simple custom AuthScheme example.  The included auth scheme is meant 
+ * for demonstration purposes only.  It does not actually implement a usable
+ * authentication method.
+ *
+ * pre
+ Login Configuration file bcsLogin.conf for JAAS.
+ ---
+   com.sun.security.jgss.initiate {
+ com.sun.security.auth.module.Krb5LoginModule 
+ required 
+ client=TRUE 
+ useTicketCache=true 
+ ticketCache=${user.krb5cc} 
+ debug=true;
+   };
+
+   com.sun.security.jgss.accept {
+ com.sun.security.auth.module.Krb5LoginModule 
+ required 
+ client=TRUE 
+ useTicketCache=true 
+ ticketCache=${user.krb5cc} 
+ debug=true;
+   };
+ ---
+ 
+   java  -Djava.security.krb5.realm=REALM \
+  -Djava.security.krb5.kdc=kdc.domain \
+  -Djavax.security.auth.useSubjectCredsOnly=false \
+  -Djava.security.auth.login.config=src/conf/bcsLogin.conf \
+  -Duser.krb5cc=$KRB5CCNAME \
+  -classpath $CP

svn commit: r376759 - /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/

2006-02-10 Thread olegk
Author: olegk
Date: Fri Feb 10 08:45:54 2006
New Revision: 376759

URL: http://svn.apache.org/viewcvs?rev=376759view=rev
Log:
PR #38425 (SSL contrib files do not use standard javax.net.ssl package provided 
from JDK 1.4.2)

Contributed by Christian BOITEL cboitel at lfdj.com
Reviewed by Oleg Kalnichevski

Modified:

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLInitializationError.java

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLX509TrustManager.java

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java

jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLInitializationError.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLInitializationError.java?rev=376759r1=376758r2=376759view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLInitializationError.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLInitializationError.java
 Fri Feb 10 08:45:54 2006
@@ -24,9 +24,6 @@
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * http://www.apache.org/.
- *
- * [Additional notices, if required by prior licensing conditions]
- *
  */
 
 package org.apache.commons.httpclient.contrib.ssl;

Modified: 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java?rev=376759r1=376758r2=376759view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java
 Fri Feb 10 08:45:54 2006
@@ -51,12 +51,12 @@
 import org.apache.commons.logging.Log; 
 import org.apache.commons.logging.LogFactory;
 
-import com.sun.net.ssl.KeyManager;
-import com.sun.net.ssl.KeyManagerFactory;
-import com.sun.net.ssl.SSLContext;
-import com.sun.net.ssl.TrustManager;
-import com.sun.net.ssl.TrustManagerFactory;
-import com.sun.net.ssl.X509TrustManager;
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.X509TrustManager;
 
 /**
  * p
@@ -166,7 +166,7 @@
  * p
  * DISCLAIMER: HttpClient developers DO NOT actively support this component.
  * The component is provided as a reference material, which may be 
inappropriate
- * to be used without additional customization.
+ * for use without additional customization.
  * /p
  */
 

Modified: 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLX509TrustManager.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLX509TrustManager.java?rev=376759r1=376758r2=376759view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLX509TrustManager.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLX509TrustManager.java
 Fri Feb 10 08:45:54 2006
@@ -31,7 +31,8 @@
 
 import java.security.cert.X509Certificate;
 
-import com.sun.net.ssl.X509TrustManager;
+import javax.net.ssl.X509TrustManager;
+import java.security.cert.CertificateException;
 import org.apache.commons.logging.Log; 
 import org.apache.commons.logging.LogFactory;
 
@@ -69,9 +70,9 @@
 }
 
 /**
- * @see com.sun.net.ssl.X509TrustManager#isClientTrusted(X509Certificate[])
+ * @see 
javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[],String 
authType)
  */
-public boolean isClientTrusted(X509Certificate[] certificates) {
+public void checkClientTrusted(X509Certificate[] certificates,String 
authType) throws

svn commit: r373774 - /jakarta/commons/proper/httpclient/branches/HTTPCLIENT_3_0_BRANCH/

2006-01-31 Thread olegk
Author: olegk
Date: Tue Jan 31 01:28:56 2006
New Revision: 373774

URL: http://svn.apache.org/viewcvs?rev=373774view=rev
Log:
Created HttpClient 3.0 stable branch. Trunk will be used to develop HttpClient 
3.1 and may contain unstable code


Added:
jakarta/commons/proper/httpclient/branches/HTTPCLIENT_3_0_BRANCH/
  - copied from r373773, jakarta/commons/proper/httpclient/trunk/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r372560 - in /jakarta/commons/proper/httpclient/trunk: release_notes.txt src/java/org/apache/commons/httpclient/URI.java

2006-01-26 Thread olegk
Author: olegk
Date: Thu Jan 26 08:07:06 2006
New Revision: 372560

URL: http://svn.apache.org/viewcvs?rev=372560view=rev
Log:
PR #38385 (Nullpointer when creating URI from scheme specific part with null 
fragment)

Contributed by Michele Vivoda vivodamichele at hotmail.com
Reviewed by Oleg Kalnichevski

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/release_notes.txt?rev=372560r1=372559r2=372560view=diff
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Thu Jan 26 
08:07:06 2006
@@ -1,5 +1,8 @@
 Changes since Release 3.0:
 
+ * 38385 - Fixed NPE when creating URI from scheme specific part with null 
fragment
+   Contributed by Michele Vivoda vivodamichele at hotmail.com
+
  * 38043 - Digest URI changed to include query parameters
Contributed by Oleg Kalnichevski olegk at apache.org
 

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java?rev=372560r1=372559r2=372560view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
 Thu Jan 26 08:07:06 2006
@@ -272,8 +272,7 @@
 getProtocolCharset());
 // Set flag
 _is_opaque_part = true;
-_fragment = fragment.toCharArray(); 
-
+_fragment = fragment == null ? null : fragment.toCharArray(); 
 setURI();
 }
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r368699 - in /jakarta/commons/proper/httpclient/trunk: release_notes.txt src/java/org/apache/commons/httpclient/auth/DigestScheme.java src/test/org/apache/commons/httpclient/auth/TestDiges

2006-01-13 Thread olegk
Author: olegk
Date: Fri Jan 13 04:24:45 2006
New Revision: 368699

URL: http://svn.apache.org/viewcvs?rev=368699view=rev
Log:
PR #38043 (Digest auth uses incorrect URI)

Changelog:
* Digest URI changed to include query parameters

Contributed by Oleg Kalnichevski
Reviewed by Michael Becke and Ortwin Glück

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/DigestScheme.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/auth/TestDigestAuth.java

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/release_notes.txt?rev=368699r1=368698r2=368699view=diff
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Fri Jan 13 
04:24:45 2006
@@ -1,5 +1,8 @@
 Changes since Release 3.0:
 
+ * 38043 - Digest URI changed to include query parameters
+   Contributed by Oleg Kalnichevski olegk at apache.org
+
  * 38004 - Fixed bug causing cyclic redirects when virtual host is set
Contributed by Oleg Kalnichevski olegk at apache.org
 

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/DigestScheme.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/DigestScheme.java?rev=368699r1=368698r2=368699view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/DigestScheme.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/DigestScheme.java
 Fri Jan 13 04:24:45 2006
@@ -304,7 +304,15 @@
 + credentials.getClass().getName());
 }
 getParameters().put(methodname, method.getName());
-getParameters().put(uri, method.getPath());
+StringBuffer buffer = new StringBuffer(method.getPath());
+String query = method.getQueryString();
+if (query != null) {
+if (query.indexOf(?) != 0) {
+buffer.append(?);
+}
+buffer.append(method.getQueryString());
+}
+getParameters().put(uri, buffer.toString());
 String charset = getParameter(charset);
 if (charset == null) {
 getParameters().put(charset, 
method.getParams().getCredentialCharset());

Modified: 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/auth/TestDigestAuth.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/auth/TestDigestAuth.java?rev=368699r1=368698r2=368699view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/auth/TestDigestAuth.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/auth/TestDigestAuth.java
 Fri Jan 13 04:24:45 2006
@@ -126,6 +126,22 @@
 assertEquals(e95a7ddf37c2eab009568b1ed134f89a, 
table.get(response));
 }
 
+public void testDigestAuthenticationWithQueryStringInDigestURI() throws 
Exception {
+String challenge = Digest realm=\realm1\, 
nonce=\f2a3f18799759d4f1a1c068b92b573cb\;
+UsernamePasswordCredentials cred = new 
UsernamePasswordCredentials(username,password);
+FakeHttpMethod method = new FakeHttpMethod(/);
+method.setQueryString(param=value);
+AuthScheme authscheme = new DigestScheme();
+authscheme.processChallenge(challenge);
+String response = authscheme.authenticate(cred, method);
+Map table = AuthChallengeParser.extractParams(response);
+assertEquals(username, table.get(username));
+assertEquals(realm1, table.get(realm));
+assertEquals(/?param=value, table.get(uri));
+assertEquals(f2a3f18799759d4f1a1c068b92b573cb, table.get(nonce));
+assertEquals(a847f58f5fef0bc087bcb9c3eb30e042, 
table.get(response));
+}
+
 public void testDigestAuthenticationWithMultipleRealms() throws Exception {
 String challenge1 = Digest realm=\realm1\, nonce=\abcde\;
 String challenge2 = Digest realm=\realm2\, nonce=\123546\;



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r366870 - in /jakarta/commons/proper/httpclient/trunk: release_notes.txt src/java/org/apache/commons/httpclient/HttpMethodDirector.java src/test/org/apache/commons/httpclient/TestVirtualHo

2006-01-07 Thread olegk
Author: olegk
Date: Sat Jan  7 10:12:55 2006
New Revision: 366870

URL: http://svn.apache.org/viewcvs?rev=366870view=rev
Log:
PR #38004 (Explicit VirtualHosts Can Cause Issues On Redirects)

Contributed by Oleg Kalnichevski
Reviewed by Ortwin Glück and Michael Becke


Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestVirtualHost.java

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/release_notes.txt?rev=366870r1=366869r2=366870view=diff
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Sat Jan  7 
10:12:55 2006
@@ -1,9 +1,15 @@
 Changes since Release 3.0:
 
- * 38139 - Calling 
MultiThreadedHttpConnectionManager.setMaxTotalConnections(int) had no effect
+ * 38004 - Fixed bug causing cyclic redirects when virtual host is set
+   Contributed by Oleg Kalnichevski olegk at apache.org
+
+ * 38139 - Calling deprecated 
MultiThreadedHttpConnectionManager.setMaxTotalConnections(int) 
+   had no effect
+   Contributed by Ortwin Glueck oglueck at apache.org
 
  * 37988 - Fixed bug in URI#toString() causing user name / password to 
stripped from the resultant String
+   Contributed by Oleg Kalnichevski olegk at apache.org
 
 Release 3.0 
 ---

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java?rev=366870r1=366869r2=366870view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpMethodDirector.java
 Sat Jan  7 10:12:55 2006
@@ -604,7 +604,10 @@
LOG.debug(Redirect URI is not absolute 
- parsing as relative);
redirectUri = new URI(currentUri, 
redirectUri);
}
-   }
+   } else {
+// Reset the default params
+method.getParams().setDefaults(this.params);
+}
 method.setURI(redirectUri);
 hostConfiguration.setHost(redirectUri);
} catch (URIException e) {

Modified: 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestVirtualHost.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestVirtualHost.java?rev=366870r1=366869r2=366870view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestVirtualHost.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestVirtualHost.java
 Sat Jan  7 10:12:55 2006
@@ -31,12 +31,19 @@
 package org.apache.commons.httpclient;
 
 import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.net.UnknownHostException;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
 import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.params.HttpConnectionParams;
+import org.apache.commons.httpclient.protocol.Protocol;
+import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
 import org.apache.commons.httpclient.server.HttpService;
+import org.apache.commons.httpclient.server.RequestLine;
 import org.apache.commons.httpclient.server.SimpleRequest;
 import org.apache.commons.httpclient.server.SimpleResponse;
 
@@ -121,4 +128,94 @@
 httpget.releaseConnection();
 }
 }
+
+private class VirtualHostService implements HttpService {
+
+public VirtualHostService() {
+super();
+}
+
+public boolean process(final SimpleRequest request, final 
SimpleResponse response)
+throws IOException {
+RequestLine reqline = request.getRequestLine();
+HttpVersion ver = reqline.getHttpVersion();
+Header header =  request.getFirstHeader(Host);
+if (header == null) {
+response.setStatusLine(ver, HttpStatus.SC_BAD_REQUEST);
+return true;
+}
+String host = header.getValue

svn commit: r358634 - in /jakarta/commons/proper/httpclient/trunk/src: java/org/apache/commons/httpclient/HttpURL.java java/org/apache/commons/httpclient/URI.java test/org/apache/commons/httpclient/Te

2005-12-22 Thread olegk
Author: olegk
Date: Thu Dec 22 13:23:15 2005
New Revision: 358634

URL: http://svn.apache.org/viewcvs?rev=358634view=rev
Log:
PR #37988 (UserInfo disapears after creating URI)

Contributed by Oleg Kalnichevski
Reviewed by Ortwin Glück

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpURL.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java

jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpURL.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpURL.java?rev=358634r1=358633r2=358634view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpURL.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpURL.java
 Thu Dec 22 13:23:15 2005
@@ -828,5 +828,51 @@
 }
 }
 
+/**
+ * Once it's parsed successfully, set this URI.
+ *
+ * @see #getRawURI
+ */
+protected void setURI() {
+// set _uri
+StringBuffer buf = new StringBuffer();
+// ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?
+if (_scheme != null) {
+buf.append(_scheme);
+buf.append(':');
+}
+if (_is_net_path) {
+buf.append(//);
+if (_authority != null) { // has_authority
+if (_userinfo != null) { // by default, remove userinfo part
+if (_host != null) {
+buf.append(_host);
+if (_port != -1) {
+buf.append(':');
+buf.append(_port);
+}
+}
+} else {
+buf.append(_authority);
+}
+}
+}
+if (_opaque != null  _is_opaque_part) {
+buf.append(_opaque);
+} else if (_path != null) {
+// _is_hier_part or _is_relativeURI
+if (_path.length != 0) {
+buf.append(_path);
+}
+}
+if (_query != null) { // has_query
+buf.append('?');
+buf.append(_query);
+}
+// ignore the fragment identifier
+_uri = buf.toString().toCharArray();
+hash = 0;
+}
+
 }
 

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java?rev=358634r1=358633r2=358634view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
 Thu Dec 22 13:23:15 2005
@@ -2263,17 +2263,7 @@
 if (_is_net_path) {
 buf.append(//);
 if (_authority != null) { // has_authority
-if (_userinfo != null) { // by default, remove userinfo part
-if (_host != null) {
-buf.append(_host);
-if (_port != -1) {
-buf.append(':');
-buf.append(_port);
-}
-}
-} else {
-buf.append(_authority);
-}
+buf.append(_authority);
 }
 }
 if (_opaque != null  _is_opaque_part) {

Modified: 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java?rev=358634r1=358633r2=358634view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestURI.java
 Thu Dec 22 13:23:15 2005
@@ -181,6 +181,12 @@
 
 }
 
+public void testTestURIAuthorityString() throws Exception {
+URI url = new URI(ftp, user:password, localhost, -1, /);
+assertEquals(ftp://user:[EMAIL PROTECTED]/, url.toString());
+assertEquals(user:[EMAIL PROTECTED], url.getAuthority());
+}
+
 public void testTestHttpUrlAuthorityString() throws Exception {
 HttpURL url = new HttpURL(localhost, -1, /);
 assertEquals(http://localhost/;, url.toString

svn commit: r358639 - /jakarta/commons/proper/httpclient/trunk/release_notes.txt

2005-12-22 Thread olegk
Author: olegk
Date: Thu Dec 22 13:33:10 2005
New Revision: 358639

URL: http://svn.apache.org/viewcvs?rev=358639view=rev
Log:
PR #37988

Modified:
jakarta/commons/proper/httpclient/trunk/release_notes.txt

Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/release_notes.txt?rev=358639r1=358638r2=358639view=diff
==
--- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Thu Dec 22 
13:33:10 2005
@@ -1,3 +1,8 @@
+Changes since Release 3.0:
+
+ * 37988 - Fixed bug in URI#toString() causing user name / password to 
+   stripped from the resultant String
+
 Release 3.0 
 ---
 Changes since Release Candidate 4:



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r358339 - /jakarta/commons/proper/httpclient/trunk/API_CHANGES_3_0.txt

2005-12-21 Thread olegk
Author: olegk
Date: Wed Dec 21 10:41:38 2005
New Revision: 358339

URL: http://svn.apache.org/viewcvs?rev=358339view=rev
Log:
PR #37994 (Typo in API_CHANGES_3_0.txt)

Modified:
jakarta/commons/proper/httpclient/trunk/API_CHANGES_3_0.txt

Modified: jakarta/commons/proper/httpclient/trunk/API_CHANGES_3_0.txt
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/API_CHANGES_3_0.txt?rev=358339r1=358338r2=358339view=diff
==
--- jakarta/commons/proper/httpclient/trunk/API_CHANGES_3_0.txt (original)
+++ jakarta/commons/proper/httpclient/trunk/API_CHANGES_3_0.txt Wed Dec 21 
10:41:38 2005
@@ -22,7 +22,7 @@
 
 * NTLM classes moved to org.apache.commons.httpclient.auth package amd made 
private
 
-* DigestSheme:
+* DigestScheme:
 the following public methods were removed, as they were only public for 
testing
 - authenticate(UsernamePasswordCredentials, Map)
 - createDigest(String, String, Map)



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r356822 - in /jakarta/commons/proper/httpclient/trunk: src/java/org/apache/commons/httpclient/cookie/ src/java/org/apache/commons/httpclient/methods/ xdocs/

2005-12-14 Thread olegk
Author: olegk
Date: Wed Dec 14 10:08:35 2005
New Revision: 356822

URL: http://svn.apache.org/viewcvs?rev=356822view=rev
Log:
Various javadoc / xdoc fixes (PR #37805, #37208, #37207)

Modified:

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookiePolicy.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieSpec.java

jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java
jakarta/commons/proper/httpclient/trunk/xdocs/cookies.xml

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookiePolicy.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookiePolicy.java?rev=356822r1=356821r2=356822view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookiePolicy.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookiePolicy.java
 Wed Dec 14 10:08:35 2005
@@ -47,6 +47,7 @@
  *   management practices (even if they are not 100% standards compliant)
  *   littNETSCAPE/tt: Netscape cookie draft compliant
  *   littRFC_2109/tt: RFC2109 compliant (default)
+ *   littIGNORE_COOKIES/tt: do not automcatically process cookies
  *  /ul
  * 
  * @author a href=mailto:[EMAIL PROTECTED]Oleg Kalnichevski/a
@@ -206,10 +207,10 @@
 
 /**
  * @return default cookie policy
- *  tt(COMPATIBILITY | NETSCAPE_DRAFT | RFC2109)/tt
  * 
- * @deprecated Use [EMAIL PROTECTED] CookiePolicy#getCookieSpec(String)}
- * @see #DEFAULT 
+ * @deprecated Use [EMAIL PROTECTED] #getDefaultSpec()}
+ * 
+ * @see #getDefaultSpec()
  */
 public static int getDefaultPolicy() {
 return defaultPolicy;
@@ -218,7 +219,6 @@
 
 /**
  * @param policy new default cookie policy
- *  tt(COMPATIBILITY | NETSCAPE_DRAFT | RFC2109)/tt
  * 
  * @deprecated Use [EMAIL PROTECTED] 
CookiePolicy#registerCookieSpec(String, Class)}
  * @see #DEFAULT 
@@ -230,7 +230,6 @@
 /**
  * @param policy cookie policy to get the CookieSpec for
  * @return cookie specification interface for the given policy
- *  tt(COMPATIBILITY | NETSCAPE_DRAFT | RFC2109)/tt
  * 
  * @deprecated Use [EMAIL PROTECTED] CookiePolicy#getCookieSpec(String)} 
  */

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieSpec.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieSpec.java?rev=356822r1=356821r2=356822view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieSpec.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/cookie/CookieSpec.java
 Wed Dec 14 10:08:35 2005
@@ -60,6 +60,11 @@
 
 /**
   * Parse the ttSet-Cookie/tt header value into Cookie array.
+  * 
+  * pThis method will not perform the validation of the resultant
+  * [EMAIL PROTECTED] Cookie}s/p 
+  *
+  * @see #validate(String, int, String, boolean, Cookie)
   *
   * @param host the host which sent the ttSet-Cookie/tt header
   * @param port the port which sent the ttSet-Cookie/tt header
@@ -77,6 +82,11 @@
 
 /**
   * Parse the ttSet-Cookie/tt Header into an array of Cookies.
+  *
+  * pThis method will not perform the validation of the resultant
+  * [EMAIL PROTECTED] Cookie}s/p 
+  *
+  * @see #validate(String, int, String, boolean, Cookie)
   *
   * @param host the host which sent the ttSet-Cookie/tt header
   * @param port the port which sent the ttSet-Cookie/tt header

Modified: 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java?rev=356822r1=356821r2=356822view=diff
==
--- 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java
 (original)
+++ 
jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java
 Wed Dec 14 10:08:35 2005
@@ -53,10 +53,20 @@
 /** The content type (i.e. text/html; charset=EUC-JP). */
 private String contentType;
 
-
 /**
- * Creates a new entity with the given content
+ * pCreates a new entity with the given content. This constructor 
+ * will use the default platform

svn commit: r356568 - /jakarta/commons/proper/httpclient/trunk/project.xml

2005-12-13 Thread olegk
Author: olegk
Date: Tue Dec 13 10:40:33 2005
New Revision: 356568

URL: http://svn.apache.org/viewcvs?rev=356568view=rev
Log:
Typo

Modified:
jakarta/commons/proper/httpclient/trunk/project.xml

Modified: jakarta/commons/proper/httpclient/trunk/project.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/project.xml?rev=356568r1=356567r2=356568view=diff
==
--- jakarta/commons/proper/httpclient/trunk/project.xml (original)
+++ jakarta/commons/proper/httpclient/trunk/project.xml Tue Dec 13 10:40:33 2005
@@ -241,7 +241,7 @@
 /contributor
 contributor
   nameSamit Jain/name
-  emailjain.samit -at- gmail.com/email
+  emailjain.samit -at- gmail.com/email
 /contributor
 contributor
   nameEric Johnson/name



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  1   2   3   4   5   6   >