You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by vm...@apache.org on 2002/10/17 20:31:46 UTC

cvs commit: jakarta-cactus/documentation/docs/xdocs changes.xml

vmassol     2002/10/17 11:31:46

  Modified:    framework/src/java/share/org/apache/cactus/client
                        HttpClientConnectionHelper.java
               documentation/docs/xdocs changes.xml
  Log:
  Fixed bug where Cactus was using the deprecated HttpClient <code>PostMethod.setRequestBody(String)</code> which had some bug related to char to byte encoding. Now using the <code>PostMethod.setRequestBody(InputStream)</code> signature. Thanks to Stephan Merker!
  
  Revision  Changes    Path
  1.5       +2 -15     jakarta-cactus/framework/src/java/share/org/apache/cactus/client/HttpClientConnectionHelper.java
  
  Index: HttpClientConnectionHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/client/HttpClientConnectionHelper.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HttpClientConnectionHelper.java	30 Aug 2002 20:07:35 -0000	1.4
  +++ HttpClientConnectionHelper.java	17 Oct 2002 18:31:45 -0000	1.5
  @@ -56,9 +56,7 @@
    */
   package org.apache.cactus.client;
   
  -import java.io.ByteArrayOutputStream;
   import java.io.IOException;
  -import java.io.InputStream;
   
   import java.net.HttpURLConnection;
   import java.net.URL;
  @@ -244,17 +242,6 @@
               return;
           }
   
  -        InputStream stream = theRequest.getUserData();
  -        ByteArrayOutputStream baos = new ByteArrayOutputStream();
  -
  -        byte[] buffer = new byte[2048];
  -        int length;
  -
  -        while ((length = stream.read(buffer)) != -1)
  -        {
  -            baos.write(buffer, 0, length);
  -        }
  -
  -        ((PostMethod) this.method).setRequestBody(baos.toString());
  +        ((PostMethod) this.method).setRequestBody(theRequest.getUserData());
       }
   }
  
  
  
  1.54      +6 -0      jakarta-cactus/documentation/docs/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/documentation/docs/xdocs/changes.xml,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- changes.xml	14 Oct 2002 10:08:31 -0000	1.53
  +++ changes.xml	17 Oct 2002 18:31:45 -0000	1.54
  @@ -48,6 +48,12 @@
       </devs>
   
       <release version="1.5" date="- in CVS">
  +      <action dev="VMA" type="fix" due-to="Stephan Merker" due-to-email="Stephan.Merker@cegedim.fr">
  +        Fixed bug where Cactus was using the deprecated HttpClient 
  +        <code>PostMethod.setRequestBody(String)</code> which had some bug 
  +        related to char to byte encoding. Now using the
  +        <code>PostMethod.setRequestBody(InputStream)</code> signature.
  +      </action>
         <action dev="VMA" type="add">
           Added links to Japanese and Korean translations of Cactus.
         </action>
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>