You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2011/12/27 14:55:41 UTC

svn commit: r1224910 - in /tomcat/trunk/java/org/apache/tomcat/util/http: LocalStrings.properties Parameters.java

Author: kkolinko
Date: Tue Dec 27 13:55:41 2011
New Revision: 1224910

URL: http://svn.apache.org/viewvc?rev=1224910&view=rev
Log:
Further fixing https://issues.apache.org/bugzilla/show_bug.cgi?id=52184
Apply a separate instance of UserDataHelper to the "maxParameterCount reached" message,
so that its threshold is calculated independently of other parameter errors.

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/http/LocalStrings.properties
    tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/LocalStrings.properties?rev=1224910&r1=1224909&r2=1224910&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/LocalStrings.properties Tue Dec 27 13:55:41 2011
@@ -20,6 +20,7 @@ parameters.decodeFail.info=Character dec
 parameters.emptyChunk=Empty parameter chunk ignored
 parameters.invalidChunk=Invalid chunk starting at byte [{0}] and ending at byte [{1}] with a value of [{2}] ignored
 parameters.maxCountFail=More than the maximum number of request parameters (GET plus POST) for a single request ([{0}]) were detected. Any parameters beyond this limit have been ignored. To change this limit, set the maxParameterCount attribute on the Connector.
+parameters.maxCountFail.fallToDebug=\n Note: further occurrences of this error will be logged at DEBUG level.
 parameters.multipleDecodingFail=Character decoding failed. A total of [{0}] failures were detected but only the first was logged. Enable debug level logging for this logger to log all failures.
 parameters.noequal=Parameter starting at position [{0}] and ending at position [{1}] with a value of [{0}] was not followed by an '=' character
 parameters.fallToDebug=\n Note: further occurrences of Parameter errors will be logged at DEBUG level.

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java?rev=1224910&r1=1224909&r2=1224910&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java Tue Dec 27 13:55:41 2011
@@ -44,6 +44,8 @@ public final class Parameters {
 
     private static final UserDataHelper userDataLog = new UserDataHelper(log);
 
+    private static final UserDataHelper maxParamCountLog = new UserDataHelper(log);
+
     protected static final StringManager sm =
         StringManager.getManager("org.apache.tomcat.util.http");
 
@@ -381,7 +383,14 @@ public final class Parameters {
                     // Hitting limit stops processing further params but does
                     // not cause request to fail.
                     parseFailed = true;
-                    log.info(ise.getMessage());
+                    UserDataHelper.Mode logMode = maxParamCountLog.getNextMode();
+                    if (logMode != null) {
+                        String message = ise.getMessage();
+                        if (logMode.fallToDebug()) {
+                            message += sm.getString("parameters.maxCountFail.fallToDebug");
+                        }
+                        maxParamCountLog.log(logMode, message);
+                    }
                     break;
                 }
             } catch (IOException e) {
@@ -398,8 +407,7 @@ public final class Parameters {
                                     "parameters.decodeFail.info",
                                     tmpName.toString(), tmpValue.toString());
                             if (logMode.fallToDebug()) {
-                                message += sm
-                                        .getString("parameters.fallToDebug");
+                                message += sm.getString("parameters.fallToDebug");
                             }
                             userDataLog.log(logMode, message, e);
                         }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org