geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r567836 - in /geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec: HttpDecoder.java HttpResponseDecoder.java HttpResponseMessage.java protocol/
Date Mon, 20 Aug 2007 21:30:45 GMT
Author: jgenender
Date: Mon Aug 20 14:30:44 2007
New Revision: 567836

URL: http://svn.apache.org/viewvc?rev=567836&view=rev
Log:
Refactor and begin adding chunking

Added:
    geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpDecoder.java
      - copied, changed from r567197, geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/protocol/HttpDecoder.java
Removed:
    geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/protocol/
Modified:
    geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpResponseDecoder.java
    geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpResponseMessage.java

Copied: geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpDecoder.java
(from r567197, geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/protocol/HttpDecoder.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpDecoder.java?p2=geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpDecoder.java&p1=geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/protocol/HttpDecoder.java&r1=567197&r2=567836&rev=567836&view=diff
==============================================================================
--- geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/protocol/HttpDecoder.java
(original)
+++ geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpDecoder.java Mon
Aug 20 14:30:44 2007
@@ -17,7 +17,7 @@
  * under the License.
  *
  */
-package org.apache.ahc.codec.protocol;
+package org.apache.ahc.codec;
 
 import org.apache.ahc.codec.HttpResponseMessage;
 import org.apache.ahc.codec.Cookie;
@@ -41,8 +41,6 @@
      */
     private static final byte LF = 10;
 
-    public final static String SET_COOKIE = "Set-Cookie";
-
     public final static String COOKIE_COMMENT = "comment";
     public final static String COOKIE_DOMAIN = "domain";
     public final static String COOKIE_EXPIRES = "expires";
@@ -51,6 +49,10 @@
     public final static String COOKIE_SECURE = "secure";
     public final static String COOKIE_VERSION = "version";
 
+    public final static String SET_COOKIE = "Set-Cookie";
+    public final static String TRANSFER_ENCODING = "Transfer-Encoding";
+    public final static String CHUNKED = "chunked";
+
     private CharsetDecoder decoder = Charset.defaultCharset().newDecoder();
 
     public String decodeLine(ByteBuffer in) throws Exception {
@@ -115,6 +117,10 @@
 
         if (name.equalsIgnoreCase(HttpMessage.CONTENT_LENGTH)) {
             msg.setContentLength(Integer.parseInt(value));
+        }
+
+        if (name.equalsIgnoreCase(TRANSFER_ENCODING) && value != null &&
value.equalsIgnoreCase(CHUNKED)) {
+            msg.chunked = true;
         }
 
     }

Modified: geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpResponseDecoder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpResponseDecoder.java?rev=567836&r1=567835&r2=567836&view=diff
==============================================================================
--- geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpResponseDecoder.java
(original)
+++ geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpResponseDecoder.java
Mon Aug 20 14:30:44 2007
@@ -19,7 +19,7 @@
  */
 package org.apache.ahc.codec;
 
-import org.apache.ahc.codec.protocol.HttpDecoder;
+import org.apache.ahc.codec.HttpDecoder;
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.filter.codec.CumulativeProtocolDecoder;

Modified: geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpResponseMessage.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpResponseMessage.java?rev=567836&r1=567835&r2=567836&view=diff
==============================================================================
--- geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpResponseMessage.java
(original)
+++ geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/codec/HttpResponseMessage.java
Mon Aug 20 14:30:44 2007
@@ -25,6 +25,7 @@
     private String statusMessage;
 
     boolean headersRead = false;
+    boolean chunked = false;
 
     public int getStatusCode() {
         return statusCode;



Mime
View raw message