This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new 0320f99 Align more closely with 9.0.x to simplify back-ports
0320f99 is described below
commit 0320f996c01ab8d3522106950a551e31c836ee8f
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Mar 1 14:19:50 2021 +0000
Align more closely with 9.0.x to simplify back-ports
---
java/org/apache/catalina/connector/OutputBuffer.java | 4 +---
java/org/apache/catalina/connector/Response.java | 7 +++----
java/org/apache/coyote/Response.java | 12 ++++++------
3 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/java/org/apache/catalina/connector/OutputBuffer.java
b/java/org/apache/catalina/connector/OutputBuffer.java
index df5db81..14c9452 100644
--- a/java/org/apache/catalina/connector/OutputBuffer.java
+++ b/java/org/apache/catalina/connector/OutputBuffer.java
@@ -134,7 +134,6 @@ public class OutputBuffer extends Writer {
// ----------------------------------------------------------- Constructors
-
/**
* Default constructor. Allocate the buffer with the default buffer size.
*/
@@ -146,7 +145,7 @@ public class OutputBuffer extends Writer {
/**
- * Alternate constructor which allows specifying the initial buffer size.
+ * Create the buffer with the specified initial size.
*
* @param size Buffer size to use
*/
@@ -161,7 +160,6 @@ public class OutputBuffer extends Writer {
// ------------------------------------------------------------- Properties
-
/**
* Associated Coyote response.
*
diff --git a/java/org/apache/catalina/connector/Response.java
b/java/org/apache/catalina/connector/Response.java
index d22cfea..860cca9 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -248,7 +248,7 @@ public class Response implements HttpServletResponse {
writer.clear();
writer = null;
}
- } else {
+ } else if (writer != null) {
writer.recycle();
}
@@ -1583,9 +1583,8 @@ public class Response implements HttpServletResponse {
if (!file.startsWith(contextPath)) {
return false;
}
- String tok = ";" +
- SessionConfig.getSessionUriParamName(request.getContext())
+
- "=" + session.getIdInternal();
+ String tok = ";" +
SessionConfig.getSessionUriParamName(request.getContext()) + "=" +
+ session.getIdInternal();
if( file.indexOf(tok, contextPath.length()) >= 0 ) {
return false;
}
diff --git a/java/org/apache/coyote/Response.java
b/java/org/apache/coyote/Response.java
index 1f965bb..be8eb00 100644
--- a/java/org/apache/coyote/Response.java
+++ b/java/org/apache/coyote/Response.java
@@ -437,7 +437,7 @@ public final class Response {
public void setLocale(Locale locale) {
if (locale == null) {
- return; // throw an exception?
+ return;
}
// Save the locale for use by getLocale()
@@ -481,6 +481,11 @@ public final class Response {
}
+ public Charset getCharset() {
+ return charset;
+ }
+
+
/**
* @return The name of the current encoding
*/
@@ -489,11 +494,6 @@ public final class Response {
}
- public Charset getCharset() {
- return charset;
- }
-
-
/**
* Sets the content type.
*
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]