Port fix bug 40860. Additional logging if parameter processing fails.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 20 Nov 2006 00:10:03 +0000 (00:10 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 20 Nov 2006 00:10:03 +0000 (00:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@476988 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/connector/LocalStrings.properties
java/org/apache/catalina/connector/Request.java
java/org/apache/tomcat/util/http/Parameters.java
webapps/docs/changelog.xml

index a85f688..20b3ba3 100644 (file)
@@ -46,6 +46,7 @@ coyoteRequest.setAttribute.namenull=Cannot call setAttribute with a null name
 coyoteRequest.listenerStart=Exception sending context initialized event to listener instance of class {0}
 coyoteRequest.listenerStop=Exception sending context destroyed event to listener instance of class {0}
 coyoteRequest.attributeEvent=Exception thrown by attributes event listener
+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.
 requestFacade.nullRequest=Null request object
 responseFacade.nullResponse=Null response object
index ec35862..2c22bac 100644 (file)
@@ -2444,7 +2444,8 @@ public class Request
                     parameters.processParameters(formData, 0, len);
                 }
             } catch (Throwable t) {
-                ; // Ignore
+                context.getLogger().warn(
+                        sm.getString("coyoteRequest.parseParameters"), t);
             }
         }
 
index 28f5890..6c04445 100644 (file)
@@ -381,9 +381,9 @@ public final class Parameters extends MultiMap {
             pos=valEnd+1;
             
             if( nameEnd<=nameStart ) {
+                log.warn("Parameters: Invalid chunk ignored.");
                 continue;
                 // invalid chunk - it's better to ignore
-                // XXX log it ?
             }
             tmpName.setBytes( bytes, nameStart, nameEnd-nameStart );
             tmpValue.setBytes( bytes, valStart, valEnd-valStart );
@@ -392,6 +392,8 @@ public final class Parameters extends MultiMap {
                 addParam( urlDecode(tmpName, enc), urlDecode(tmpValue, enc) );
             } catch (IOException e) {
                 // Exception during character decoding: skip parameter
+                log.warn("Parameters: Character decoding failed. " + 
+                         "Parameter skipped.", e);
             }
 
             tmpName.recycle();
index b7c7c44..6651e1f 100644 (file)
   </subsection>
   <subsection name="Coyote">
     <changelog>
+      <fix>
+        <bug>40860</bug>: Log exceptions and other problems during parameter
+        processing. (markt)
+      </fix>
     </changelog>
   </subsection> 
 </section>