On 8 March 2011 17:18, <[email protected]> wrote:
> Author: rjung
> Date: Tue Mar 8 17:18:16 2011
> New Revision: 1079444
>
> URL: http://svn.apache.org/viewvc?rev=1079444&view=rev
> Log:
> New context attribute "swallowAbortedUploads" allows
> to make request data swallowing configurable for requests
> that are too large.
>
...
> --- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
> +++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Tue Mar
> 8 17:18:16 2011
> @@ -197,6 +197,12 @@ public class StandardContext extends Con
> protected boolean allowCasualMultipartParsing = false;
>
> /**
> + * Control whether remaining request data will be read
> + * (swallowed) even if the request violates a data size constraint.
> + */
> + public boolean swallowAbortedUploads = true;
This should surely be private - there are public [gs]etters already.
> +
> + /**
> * The alternate deployment descriptor name.
> */
> private String altDDName = null;
> @@ -1066,6 +1072,30 @@ public class StandardContext extends Con
> }
>
> /**
> + * Set to <code>false</code> to disable request data swallowing
> + * after an upload was aborted due to size constraints.
> + *
> + * @param swallowAbortedUploads <code>false</code> to disable
> + * swallowing, <code>true</code> otherwise (default).
> + */
> + @Override
> + public void setSwallowAbortedUploads(boolean swallowAbortedUploads) {
> + this.swallowAbortedUploads = swallowAbortedUploads;
> + }
> +
> + /**
> + * Returns <code>true</code> if remaining request data will be read
> + * (swallowed) even the request violates a data size constraint.
> + *
> + * @return <code>true</code> if data will be swallowed (default),
> + * <code>false</code> otherwise.
> + */
> + @Override
> + public boolean getSwallowAbortedUploads() {
> + return this.swallowAbortedUploads;
> + }
> +
> + /**
> * Set cache TTL.
> */
> public void setCacheTTL(int cacheTTL) {
> @@ -6440,4 +6470,4 @@ public class StandardContext extends Con
> return false;
> }
>
> -}
> +}
> \ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]