commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HttpConnection.java HttpMethodBase.java Wire.java
Date Tue, 13 Apr 2004 18:20:24 GMT
olegk       2004/04/13 11:20:24

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HttpConnection.java HttpMethodBase.java Wire.java
  Log:
  PR #28302 (Wirelog corrections)
  
  * fixes the problem reported by Geir H. Pettersen <geir at cellus.no>. See
  http://marc.theaimsgroup.com/?t=108072355300004&r=1&w=2 for details
  
  * reduces the priority of HTTP request/response content body logging from DEBUG to TRACE
pending a more permanent solution
  
  Contributed by Oleg Kalnichevski
  Reviewed by Michael Becke
  
  Revision  Changes    Path
  1.87      +5 -5      jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpConnection.java
  
  Index: HttpConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpConnection.java,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- HttpConnection.java	13 Apr 2004 02:08:30 -0000	1.86
  +++ HttpConnection.java	13 Apr 2004 18:20:23 -0000	1.87
  @@ -805,7 +805,7 @@
           LOG.trace("enter HttpConnection.getRequestOutputStream()");
           assertOpen();
           OutputStream out = this.outputStream;
  -        if (Wire.enabled()) {
  +        if (Wire.traceEnabled()) {
               out = new WireLogOutputStream(out);
           }
           return out;
  
  
  
  1.203     +5 -5      jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java
  
  Index: HttpMethodBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v
  retrieving revision 1.202
  retrieving revision 1.203
  diff -u -r1.202 -r1.203
  --- HttpMethodBase.java	25 Mar 2004 20:37:19 -0000	1.202
  +++ HttpMethodBase.java	13 Apr 2004 18:20:23 -0000	1.203
  @@ -1595,7 +1595,7 @@
   
           responseBody = null; // is this desired?
           InputStream is = conn.getResponseInputStream();
  -        if (Wire.enabled()) {
  +        if (Wire.traceEnabled()) {
               is = new WireLogInputStream(is);
           }
           InputStream result = null;
  
  
  
  1.7       +8 -13     jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Wire.java
  
  Index: Wire.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Wire.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Wire.java	22 Feb 2004 18:08:46 -0000	1.6
  +++ Wire.java	13 Apr 2004 18:20:23 -0000	1.7
  @@ -34,9 +34,6 @@
   import java.io.IOException;
   import java.io.InputStream;
   import java.io.ByteArrayInputStream;
  -import java.io.Reader;
  -import java.io.InputStreamReader;
  -import java.io.UnsupportedEncodingException;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  @@ -55,15 +52,9 @@
   
       private static void wire(String header, InputStream instream)
         throws IOException {
  -        Reader reader = null;
  -        try {
  -            reader = new InputStreamReader(instream, "US-ASCII");
  -        } catch (UnsupportedEncodingException e) {
  -            reader = new InputStreamReader(instream);
  -        }
           StringBuffer buffer = new StringBuffer();
           int ch;
  -        while ((ch = reader.read()) != -1) {
  +        while ((ch = instream.read()) != -1) {
               if (ch == 13) {
                   buffer.append("[\\r]");
               } else if (ch == 10) {
  @@ -91,6 +82,10 @@
   
       public static final boolean enabled() {
           return WIRE_LOG.isDebugEnabled();
  +    }    
  +    
  +    public static final boolean traceEnabled() {
  +        return WIRE_LOG.isTraceEnabled();
       }    
       
       public static final void output(InputStream outstream)
  
  
  

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


Mime
View raw message