Skip to content

Commit

Permalink
Simplify. Re-use existing method rather than duplicating it.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1750788 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Jun 30, 2016
1 parent 8dfd057 commit 4cab201
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions java/org/apache/catalina/connector/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -775,12 +775,8 @@ public ServletInputStream createInputStream()
* @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);
if (response.getStatus() == HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE) {
checkSwallowInput();
}
}

Expand Down Expand Up @@ -2640,7 +2636,9 @@ public boolean isFinished() {


/**
* Disable swallowing of remaining input if configured
* 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();
Expand Down

0 comments on commit 4cab201

Please sign in to comment.