Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5262] Do not set the response buffer size if set to -1. #5268

Merged
merged 1 commit into from
Jul 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,9 @@ public void renderView(FacesContext ctx, UIViewRoot viewToRender) throws IOExcep
getSession(ctx);
}

stateWriter = new WriteBehindStateWriter(extContext.getResponseOutputWriter(), ctx, responseBufferSize);
// If the buffer size is -1, use the default buffer size
final int bufferSize = responseBufferSize != -1 ? responseBufferSize : Integer.parseInt(FaceletsBufferSize.getDefaultValue());
stateWriter = new WriteBehindStateWriter(extContext.getResponseOutputWriter(), ctx, bufferSize);

ResponseWriter writer = origWriter.cloneWithWriter(stateWriter);
ctx.setResponseWriter(writer);
Expand Down Expand Up @@ -888,8 +890,10 @@ protected ResponseWriter createResponseWriter(FacesContext context) throws IOExc
throw new IllegalStateException("No render kit was available for id \"" + id + "\"");
}

// set the buffer for content
extContext.setResponseBufferSize(responseBufferSize);
// set the buffer for content, -1 indicates nothing should be set.
if (responseBufferSize != -1) {
extContext.setResponseBufferSize(responseBufferSize);
}

// get our content type
String contentType = (String) context.getAttributes().get("facelets.ContentType");
Expand Down