Index: tomcat6-6.0.18/apache-tomcat-6.0.18-src/java/org/apache/catalina/connector/LocalStrings.properties
===================================================================
--- tomcat6-6.0.18.orig/apache-tomcat-6.0.18-src/java/org/apache/catalina/connector/LocalStrings.properties	2012-01-06 15:34:04.000000000 +0100
+++ tomcat6-6.0.18/apache-tomcat-6.0.18-src/java/org/apache/catalina/connector/LocalStrings.properties	2012-01-06 15:34:55.015234257 +0100
@@ -60,6 +60,7 @@
 coyoteRequest.parseParameters=Exception thrown whilst processing POSTed parameters
 coyoteRequest.postTooLarge=Parameters were not parsed because the size of the posted data was too big. Use the maxPostSize attribute of the connector to resolve this if the application should accept large POSTs.
 coyoteRequest.sendfileNotCanonical=Unable to determine canonical name of file [{0}] specified for use with sendfile
+coyoteRequest.chunkedPostTooLarge=Parameters were not parsed because the size of the posted data was too big. Because this request was a chunked request, it could not be processed further. Use the maxPostSize attribute of the connector to resolve this if the application should accept large POSTs.
 
 requestFacade.nullRequest=The request object has been recycled and is no longer associated with this facade
 
Index: tomcat6-6.0.18/apache-tomcat-6.0.18-src/java/org/apache/catalina/connector/Request.java
===================================================================
--- tomcat6-6.0.18.orig/apache-tomcat-6.0.18-src/java/org/apache/catalina/connector/Request.java	2012-01-06 15:34:04.000000000 +0100
+++ tomcat6-6.0.18/apache-tomcat-6.0.18-src/java/org/apache/catalina/connector/Request.java	2012-01-06 15:34:27.556272961 +0100
@@ -47,6 +47,7 @@
 import javax.servlet.http.HttpSession;
 
 import org.apache.tomcat.util.buf.B2CConverter;
+import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.buf.StringCache;
 import org.apache.tomcat.util.http.Cookies;
@@ -2481,7 +2482,8 @@
             int maxPostSize = connector.getMaxPostSize();
             if ((maxPostSize > 0) && (len > maxPostSize)) {
                 if (context.getLogger().isDebugEnabled()) {
-                    context.getLogger().debug("Post too large");
+                    context.getLogger().debug(
+                            sm.getString("coyoteRequest.postTooLarge"));
                 }
                 return;
             }
@@ -2506,6 +2508,20 @@
                 return;
             }
             parameters.processParameters(formData, 0, len);
+        } else if ("chunked".equalsIgnoreCase(
+                coyoteRequest.getHeader("transfer-encoding"))) {
+            byte[] formData = null;
+            try {
+                formData = readChunkedPostBody();
+            } catch (IOException e) {
+                // Client disconnect
+                if (context.getLogger().isDebugEnabled()) {
+                    context.getLogger().debug(
+                            sm.getString("coyoteRequest.parseParameters"), e);
+                }
+                return;
+            }
+            parameters.processParameters(formData, 0, formData.length);
         }
 
     }
@@ -2531,6 +2547,38 @@
 
 
     /**
+     * Read chunked post body.
+     */
+    protected byte[] readChunkedPostBody() throws IOException {
+        ByteChunk body = new ByteChunk();
+        
+        byte[] buffer = new byte[CACHED_POST_LEN];
+        
+        int len = 0;
+        while (len > -1) {
+            len = getStream().read(buffer, 0, CACHED_POST_LEN);
+            if (connector.getMaxPostSize() > 0 &&
+                    (body.getLength() + len) > connector.getMaxPostSize()) {
+                // Too much data
+                throw new IllegalArgumentException(
+                        sm.getString("coyoteRequest.chunkedPostTooLarge"));
+            }
+            if (len > 0) {
+                body.append(buffer, 0, len);
+            }
+        }
+        if (body.getLength() < body.getBuffer().length) {
+            int length = body.getLength();
+            byte[] result = new byte[length];
+            System.arraycopy(body.getBuffer(), 0, result, 0, length);
+            return result;
+        } else {
+            return body.getBuffer();
+        }
+    }
+    
+    
+    /**
      * Parse request locales.
      */
     protected void parseLocales() {
Index: tomcat6-6.0.18/apache-tomcat-6.0.18-src/webapps/docs/changelog.xml
===================================================================
--- tomcat6-6.0.18.orig/apache-tomcat-6.0.18-src/webapps/docs/changelog.xml	2012-01-06 15:34:04.000000000 +0100
+++ tomcat6-6.0.18/apache-tomcat-6.0.18-src/webapps/docs/changelog.xml	2012-01-06 15:34:27.557272996 +0100
@@ -44,6 +44,10 @@
       <fix>
         <bug>42722</bug>: Possible NPE in CGI Servlet. (markt)
       </fix>
+      <fix>
+        <bug>37794</bug>: Support the parsing of parameters from chunked POSTs.
+        (markt)
+      </fix>
       <update>
         <bug>45285</bug>: Look for annotations in class hierarchy. (markt)
       </update>
