Java Code Examples for org.apache.catalina.Context#getSwallowAbortedUploads()

The following examples show how to use org.apache.catalina.Context#getSwallowAbortedUploads() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Request.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
/**
 * Check the configuration for aborted uploads and if configured to do so,
 * disable the swallowing of any remaining input and close the connection
 * once the response has been written.
 */
protected void checkSwallowInput() {
    Context context = getContext();
    if (context != null && !context.getSwallowAbortedUploads()) {
        coyoteRequest.action(ActionCode.DISABLE_SWALLOW_INPUT, null);
    }
}
 
Example 2
Source File: Request.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
/**
 * Perform whatever actions are required to flush and close the input
 * stream or reader, in a single operation.
 *
 * @exception IOException if an input/output error occurs
 */
public void finishRequest() throws IOException {
    // Optionally disable swallowing of additional request data.
    Context context = getContext();
    if (context != null &&
            response.getStatus() == HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE &&
            !context.getSwallowAbortedUploads()) {
        coyoteRequest.action(ActionCode.DISABLE_SWALLOW_INPUT, null);
    }
}
 
Example 3
Source File: Request.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
/**
 * Disable swallowing of remaining input if configured
 */
protected void checkSwallowInput() {
    Context context = getContext();
    if (context != null && !context.getSwallowAbortedUploads()) {
        coyoteRequest.action(ActionCode.DISABLE_SWALLOW_INPUT, null);
    }
}
 
Example 4
Source File: Request.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
/**
 * Perform whatever actions are required to flush and close the input
 * stream or reader, in a single operation.
 *
 * @exception IOException if an input/output error occurs
 */
public void finishRequest() throws IOException {
    // Optionally disable swallowing of additional request data.
    Context context = getContext();
    if (context != null &&
            response.getStatus() == HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE &&
            !context.getSwallowAbortedUploads()) {
        coyoteRequest.action(ActionCode.DISABLE_SWALLOW_INPUT, null);
    }
}
 
Example 5
Source File: Request.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
/**
 * Disable swallowing of remaining input if configured
 */
protected void checkSwallowInput() {
    Context context = getContext();
    if (context != null && !context.getSwallowAbortedUploads()) {
        coyoteRequest.action(ActionCode.DISABLE_SWALLOW_INPUT, null);
    }
}