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:24:04 GMT
olegk       2004/04/13 11:24:04

  Modified:    httpclient/src/java/org/apache/commons/httpclient Tag:
                        HTTPCLIENT_2_0_BRANCH 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
  No                   revision
  No                   revision
  1.67.2.9  +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.67.2.8
  retrieving revision 1.67.2.9
  diff -u -r1.67.2.8 -r1.67.2.9
  --- HttpConnection.java	9 Mar 2004 13:58:23 -0000	1.67.2.8
  +++ HttpConnection.java	13 Apr 2004 18:24:03 -0000	1.67.2.9
  @@ -779,7 +779,7 @@
           LOG.trace("enter HttpConnection.getRequestOutputStream()");
           assertOpen();
           OutputStream out = this.outputStream;
  -        if (Wire.enabled()) {
  +        if (Wire.traceEnabled()) {
               out = new WireLogOutputStream(out);
           }
           return out;
  
  
  
  1.159.2.26 +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.159.2.25
  retrieving revision 1.159.2.26
  diff -u -r1.159.2.25 -r1.159.2.26
  --- HttpMethodBase.java	26 Feb 2004 20:26:45 -0000	1.159.2.25
  +++ HttpMethodBase.java	13 Apr 2004 18:24:03 -0000	1.159.2.26
  @@ -2005,7 +2005,7 @@
   
           responseBody = null; // is this desired?
           InputStream is = conn.getResponseInputStream();
  -        if (Wire.enabled()) {
  +        if (Wire.traceEnabled()) {
               is = new WireLogInputStream(is);
           }
           InputStream result = null;
  
  
  
  1.4.2.3   +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.4.2.2
  retrieving revision 1.4.2.3
  diff -u -r1.4.2.2 -r1.4.2.3
  --- Wire.java	22 Feb 2004 18:21:13 -0000	1.4.2.2
  +++ Wire.java	13 Apr 2004 18:24:04 -0000	1.4.2.3
  @@ -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