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/test/org/apache/commons/httpclient SimpleHttpConnection.java
Date Sun, 16 Feb 2003 13:08:35 GMT
olegk       2003/02/16 05:08:34

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        ChunkedInputStream.java HttpConnection.java
                        HttpMethodBase.java
               httpclient/src/test/org/apache/commons/httpclient
                        SimpleHttpConnection.java
  Removed:     httpclient/src/java/org/apache/commons/httpclient/util
                        HeaderParser.java
  Log:
  Changelog:
  
  - Minor big fixes in HttpConnection class
  
  Contributed by Oleg Kalnichevski
  
  Revision  Changes    Path
  1.15      +4 -5      jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/ChunkedInputStream.java
  
  Index: ChunkedInputStream.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/ChunkedInputStream.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ChunkedInputStream.java	13 Feb 2003 21:31:53 -0000	1.14
  +++ ChunkedInputStream.java	16 Feb 2003 13:08:32 -0000	1.15
  @@ -67,7 +67,6 @@
   import java.io.IOException;
   import java.io.InputStream;
   
  -import org.apache.commons.httpclient.util.HeaderParser;
   
   /**
    * <p>Transparently coalesces chunks of a HTTP stream that uses
  @@ -340,7 +339,7 @@
        * @throws IOException If an IO problem occurs
        */
       private void parseTrailerHeaders() throws IOException {
  -        Header[] footers = HeaderParser.parseHeaders(in);
  +        Header[] footers = HttpParser.parseHeaders(in);
           
           for (int i = 0; i < footers.length; i++) {
               method.addResponseFooter(footers[i]);
  
  
  
  1.45      +5 -41     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.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- HttpConnection.java	13 Feb 2003 21:31:53 -0000	1.44
  +++ HttpConnection.java	16 Feb 2003 13:08:32 -0000	1.45
  @@ -110,42 +110,6 @@
    */
   public class HttpConnection {
   
  -    /**
  -     * Read up to <tt>"\r\n"</tt> from an (unchunked) input stream.
  -     * If the stream ends before the line terminator is found,
  -     * the last part of the string will still be returned.
  -     * '\r' and '\n' are allowed to appear individually in the stream.
  -     *
  -     * @param inputStream the stream to read from
  -     *
  -     * @throws IOException if an I/O problem occurs
  -     * @return a line from the stream
  -     * 
  -     * @since 2.0beta1
  -     */
  -    public static String readLine(InputStream inputStream) throws IOException {
  -        LOG.trace("enter HttpConnection.readLine()");
  -
  -        StringBuffer buf = new StringBuffer();
  -        int ch = inputStream.read();
  -        while (ch >= 0) {
  -            if (ch == '\r') {
  -                ch = inputStream.read();
  -                if (ch == '\n') {
  -                    break;
  -                } else {
  -                    buf.append('\r');
  -                }
  -            }
  -            buf.append((char) ch);
  -            ch = inputStream.read();
  -        }
  -        if (WIRE_LOG.isDebugEnabled()) {
  -            WIRE_LOG.debug("<< \"" + buf.toString() + (ch>0 ? "\" [\\r\\n]" :
""));
  -        }
  -        return (buf.toString());
  -    }
  -
       // ----------------------------------------------------------- Constructors
   
       /**
  @@ -911,7 +875,7 @@
           LOG.trace("enter HttpConnection.readLine()");
   
           assertOpen();
  -        return HttpConnection.readLine(inputStream);
  +        return HttpParser.readLine(inputStream);
       }
   
       /**
  
  
  
  1.112     +5 -6      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.111
  retrieving revision 1.112
  diff -u -r1.111 -r1.112
  --- HttpMethodBase.java	11 Feb 2003 03:23:05 -0000	1.111
  +++ HttpMethodBase.java	16 Feb 2003 13:08:32 -0000	1.112
  @@ -75,7 +75,6 @@
   
   import org.apache.commons.httpclient.cookie.CookiePolicy;
   import org.apache.commons.httpclient.cookie.CookieSpec;
  -import org.apache.commons.httpclient.util.HeaderParser;
   import org.apache.commons.httpclient.util.URIUtil;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  @@ -1862,7 +1861,7 @@
               + "HttpConnection)");
   
           getResponseHeaderGroup().clear();
  -        Header[] headers = HeaderParser.parseHeaders(conn.getResponseInputStream());
  +        Header[] headers = HttpParser.parseHeaders(conn.getResponseInputStream());
           getResponseHeaderGroup().setHeaders(headers);
       }
   
  
  
  
  1.10      +4 -4      jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/SimpleHttpConnection.java
  
  Index: SimpleHttpConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/SimpleHttpConnection.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SimpleHttpConnection.java	11 Feb 2003 03:23:05 -0000	1.9
  +++ SimpleHttpConnection.java	16 Feb 2003 13:08:34 -0000	1.10
  @@ -186,7 +186,7 @@
   
       public String readLine()
       throws IOException, IllegalStateException {
  -        String str = HttpConnection.readLine(inputStream);
  +        String str = HttpParser.readLine(inputStream);
           log.debug("read: " + str);
           return str;
       }
  
  
  

---------------------------------------------------------------------
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