commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Hyatt <ahy...@intraspect.com>
Subject [HttpClient] URI request fix and multiple method fix
Date Thu, 19 Sep 2002 16:22:52 GMT

There are two bugs in HttpClient I've noticed.  One is the simple
matter that the HTTP request is escaped.  It should not be.  THe
fix for this:

Index: HttpMethodBase.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v
retrieving revision 1.55
diff -r1.55 HttpMethodBase.java
1205,1206c1205
<         buf.append((null == reqPath)
<                    ? "/" : URIUtil.encode(reqPath, URIUtil.pathSafe()));
---
>         buf.append(null == reqPath ? "/" : reqPath);

The next is that you cannot execute two methods in a row (to the same
url, with different parameters, say), instead you had to close
and create a new HttpClient.  THe solution is simple, we just have to
make sure our session is closed before we open a new one.  The
patch is:

Index: HttpClient.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java,v
retrieving revision 1.54
diff -r1.54 HttpClient.java
192c192
< 
---
>         
196a197,204
>         
>         // Stop the old session before creating a new one
>         try {
>             endSession();
>         } catch (IOException e) {
>             log.error("HttpClient.startSession: error closing the old session before
starting the new one");
>         } 
> 


BTW, for some reason I cannot subscribe to any of the jakarta lists.
So if you want to communicate with me, it would be most reliable to
mail me back at this address.




--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message