More URL -> URI refactoring

2022-12-19 Thread Jan Hauschwitz
Hi,
i got trouble with your *More URL -> URI refactoring* in commit
https://github.com/apache/tomcat/commit/2a03ff1b778e6f4d05a60c3a9597b42ed4176aed

URI doesn't like '$' which are used in Renjin (https://www.renjin.org)
For example calling *URI base = new
URI("org/renjin/utils/$<-.bibentry.RData");* returns URISyntaxException

Is it possible to fix this please?

stacktrace:
Caused by: org.renjin.eval.EvalException: IOException while loading package
org.renjin:utils: java.io.IOException: Could not find $<-.bibentry.RData
(org/renjin/utils/$<-.bibentry.RData)

at
org.renjin.primitives.packaging.NamespaceRegistry.load(NamespaceRegistry.java:191)
at
org.renjin.primitives.packaging.NamespaceRegistry.getNamespace(NamespaceRegistry.java:156)
at
org.renjin.primitives.packaging.NamespaceRegistry.getNamespace(NamespaceRegistry.java:130)
at
org.renjin.serialization.SessionReadContext.findNamespace(SessionReadContext.java:45)
at org.renjin.serialization.RDataReader.readNamespace(RDataReader.java:506)
at org.renjin.serialization.RDataReader.readExp(RDataReader.java:175)
at org.renjin.serialization.RDataReader.readTag(RDataReader.java:418)
at org.renjin.serialization.RDataReader.readClosure(RDataReader.java:250)
at org.renjin.serialization.RDataReader.readExp(RDataReader.java:183)
at org.renjin.serialization.RDataReader.readFile(RDataReader.java:79)
at org.renjin.packaging.LazyLoadFrame.readVersion2(LazyLoadFrame.java:85)
at org.renjin.packaging.LazyLoadFrame.load(LazyLoadFrame.java:46)
at
org.renjin.primitives.packaging.FileBasedPackage.loadSymbols(FileBasedPackage.java:49)
at
org.renjin.primitives.packaging.Namespace.populateNamespace(Namespace.java:174)
at
org.renjin.primitives.packaging.NamespaceRegistry.load(NamespaceRegistry.java:169)
... 78 common frames omitted

Caused by: java.lang.RuntimeException: java.io.IOException: Could not find
$<-.bibentry.RData (org/renjin/utils/$<-.bibentry.RData)

at
org.renjin.primitives.packaging.FileBasedPackage$1.apply(FileBasedPackage.java:56)
at
org.renjin.primitives.packaging.FileBasedPackage$1.apply(FileBasedPackage.java:49)
at org.renjin.packaging.SerializedPromise.doEval(SerializedPromise.java:48)
at org.renjin.sexp.Promise.force(Promise.java:81)
at
org.renjin.primitives.packaging.Namespace.resolveFunction(Namespace.java:475)
at
org.renjin.primitives.packaging.Namespace.registerS3Method(Namespace.java:460)
at
org.renjin.primitives.packaging.Namespace.registerS3Methods(Namespace.java:454)
at
org.renjin.primitives.packaging.NamespaceRegistry.load(NamespaceRegistry.java:185)
... 92 common frames omitted

Caused by: java.io.IOException: Could not find $<-.bibentry.RData
(org/renjin/utils/$<-.bibentry.RData)

at
org.renjin.primitives.packaging.ClasspathPackage.getResource(ClasspathPackage.java:55)
at
org.renjin.primitives.packaging.FileBasedPackage$1.apply(FileBasedPackage.java:54)
... 99 common frames omitted


Re: More URL -> URI refactoring

2022-12-19 Thread Mark Thomas

Should already be fixed:
https://bz.apache.org/bugzilla/show_bug.cgi?id=66388

Nightly builds (not official releases, use at your own risk) available 
for testing at:

https://nightlies.apache.org/

Mark


On 19/12/2022 09:51, Jan Hauschwitz wrote:

Hi,
i got trouble with your *More URL -> URI refactoring* in commit
https://github.com/apache/tomcat/commit/2a03ff1b778e6f4d05a60c3a9597b42ed4176aed

URI doesn't like '$' which are used in Renjin (https://www.renjin.org)
For example calling *URI base = new
URI("org/renjin/utils/$<-.bibentry.RData");* returns URISyntaxException

Is it possible to fix this please?

stacktrace:
Caused by: org.renjin.eval.EvalException: IOException while loading package
org.renjin:utils: java.io.IOException: Could not find $<-.bibentry.RData
(org/renjin/utils/$<-.bibentry.RData)

at
org.renjin.primitives.packaging.NamespaceRegistry.load(NamespaceRegistry.java:191)
at
org.renjin.primitives.packaging.NamespaceRegistry.getNamespace(NamespaceRegistry.java:156)
at
org.renjin.primitives.packaging.NamespaceRegistry.getNamespace(NamespaceRegistry.java:130)
at
org.renjin.serialization.SessionReadContext.findNamespace(SessionReadContext.java:45)
at org.renjin.serialization.RDataReader.readNamespace(RDataReader.java:506)
at org.renjin.serialization.RDataReader.readExp(RDataReader.java:175)
at org.renjin.serialization.RDataReader.readTag(RDataReader.java:418)
at org.renjin.serialization.RDataReader.readClosure(RDataReader.java:250)
at org.renjin.serialization.RDataReader.readExp(RDataReader.java:183)
at org.renjin.serialization.RDataReader.readFile(RDataReader.java:79)
at org.renjin.packaging.LazyLoadFrame.readVersion2(LazyLoadFrame.java:85)
at org.renjin.packaging.LazyLoadFrame.load(LazyLoadFrame.java:46)
at
org.renjin.primitives.packaging.FileBasedPackage.loadSymbols(FileBasedPackage.java:49)
at
org.renjin.primitives.packaging.Namespace.populateNamespace(Namespace.java:174)
at
org.renjin.primitives.packaging.NamespaceRegistry.load(NamespaceRegistry.java:169)
... 78 common frames omitted

Caused by: java.lang.RuntimeException: java.io.IOException: Could not find
$<-.bibentry.RData (org/renjin/utils/$<-.bibentry.RData)

at
org.renjin.primitives.packaging.FileBasedPackage$1.apply(FileBasedPackage.java:56)
at
org.renjin.primitives.packaging.FileBasedPackage$1.apply(FileBasedPackage.java:49)
at org.renjin.packaging.SerializedPromise.doEval(SerializedPromise.java:48)
at org.renjin.sexp.Promise.force(Promise.java:81)
at
org.renjin.primitives.packaging.Namespace.resolveFunction(Namespace.java:475)
at
org.renjin.primitives.packaging.Namespace.registerS3Method(Namespace.java:460)
at
org.renjin.primitives.packaging.Namespace.registerS3Methods(Namespace.java:454)
at
org.renjin.primitives.packaging.NamespaceRegistry.load(NamespaceRegistry.java:185)
... 92 common frames omitted

Caused by: java.io.IOException: Could not find $<-.bibentry.RData
(org/renjin/utils/$<-.bibentry.RData)

at
org.renjin.primitives.packaging.ClasspathPackage.getResource(ClasspathPackage.java:55)
at
org.renjin.primitives.packaging.FileBasedPackage$1.apply(FileBasedPackage.java:54)
... 99 common frames omitted



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch main updated: Fix BZ 66382 - read timeout bug with HTTP/2 and NIO2

2022-12-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new 2f5bdbad13 Fix BZ 66382 - read timeout bug with HTTP/2 and NIO2
2f5bdbad13 is described below

commit 2f5bdbad1343cfad6b4ae51b682266ae6068cbaa
Author: Mark Thomas 
AuthorDate: Mon Dec 19 14:52:34 2022 +

Fix BZ 66382 - read timeout bug with HTTP/2 and NIO2

https://bz.apache.org/bugzilla/show_bug.cgi?id=66385
---
 java/org/apache/coyote/http2/Http2AsyncParser.java | 6 --
 webapps/docs/changelog.xml | 5 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2AsyncParser.java 
b/java/org/apache/coyote/http2/Http2AsyncParser.java
index d01497051d..a2043557b7 100644
--- a/java/org/apache/coyote/http2/Http2AsyncParser.java
+++ b/java/org/apache/coyote/http2/Http2AsyncParser.java
@@ -134,8 +134,10 @@ class Http2AsyncParser extends Http2Parser {
 ByteBuffer header = ByteBuffer.allocate(9);
 ByteBuffer framePayload = ByteBuffer.allocate(input.getMaxFrameSize());
 FrameCompletionHandler handler = new FrameCompletionHandler(expected, 
header, framePayload);
-CompletionState state =
-socketWrapper.read(block ? BlockingMode.BLOCK : 
BlockingMode.NON_BLOCK, socketWrapper.getReadTimeout(), TimeUnit.MILLISECONDS, 
null, handler, handler, header, framePayload);
+CompletionState state = socketWrapper.read(
+block ? BlockingMode.BLOCK : BlockingMode.NON_BLOCK,
+block ? socketWrapper.getReadTimeout() : 0,
+TimeUnit.MILLISECONDS, null, handler, handler, header, 
framePayload);
 if (state == CompletionState.ERROR || state == CompletionState.INLINE) 
{
 handleAsyncException();
 return true;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f7685e8a37..189b68b020 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -142,6 +142,11 @@
 code NO_ERROR so that client does not discard the 
response.
 Based on a suggestion by Lorenzo Dalla Vecchia. (markt)
   
+  
+66385: Correct a bug in HTTP/2 where a non-blocking read for
+a new frame with the NIO2 connector was incorrectly made using the read
+timeout leading to unexpected stream closure. (markt)
+  
 
   
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 10.1.x updated: Fix BZ 66382 - read timeout bug with HTTP/2 and NIO2

2022-12-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 31305477d6 Fix BZ 66382 - read timeout bug with HTTP/2 and NIO2
31305477d6 is described below

commit 31305477d62d72fa31593c998e851a69aeb37a0b
Author: Mark Thomas 
AuthorDate: Mon Dec 19 14:52:34 2022 +

Fix BZ 66382 - read timeout bug with HTTP/2 and NIO2

https://bz.apache.org/bugzilla/show_bug.cgi?id=66385
---
 java/org/apache/coyote/http2/Http2AsyncParser.java | 6 --
 webapps/docs/changelog.xml | 5 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2AsyncParser.java 
b/java/org/apache/coyote/http2/Http2AsyncParser.java
index d01497051d..a2043557b7 100644
--- a/java/org/apache/coyote/http2/Http2AsyncParser.java
+++ b/java/org/apache/coyote/http2/Http2AsyncParser.java
@@ -134,8 +134,10 @@ class Http2AsyncParser extends Http2Parser {
 ByteBuffer header = ByteBuffer.allocate(9);
 ByteBuffer framePayload = ByteBuffer.allocate(input.getMaxFrameSize());
 FrameCompletionHandler handler = new FrameCompletionHandler(expected, 
header, framePayload);
-CompletionState state =
-socketWrapper.read(block ? BlockingMode.BLOCK : 
BlockingMode.NON_BLOCK, socketWrapper.getReadTimeout(), TimeUnit.MILLISECONDS, 
null, handler, handler, header, framePayload);
+CompletionState state = socketWrapper.read(
+block ? BlockingMode.BLOCK : BlockingMode.NON_BLOCK,
+block ? socketWrapper.getReadTimeout() : 0,
+TimeUnit.MILLISECONDS, null, handler, handler, header, 
framePayload);
 if (state == CompletionState.ERROR || state == CompletionState.INLINE) 
{
 handleAsyncException();
 return true;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2149041f04..6d5149ebac 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -123,6 +123,11 @@
 code NO_ERROR so that client does not discard the 
response.
 Based on a suggestion by Lorenzo Dalla Vecchia. (markt)
   
+  
+66385: Correct a bug in HTTP/2 where a non-blocking read for
+a new frame with the NIO2 connector was incorrectly made using the read
+timeout leading to unexpected stream closure. (markt)
+  
 
   
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Fix BZ 66382 - read timeout bug with HTTP/2 and NIO2

2022-12-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 662ebf1bf9 Fix BZ 66382 - read timeout bug with HTTP/2 and NIO2
662ebf1bf9 is described below

commit 662ebf1bf9f1a5001d935018e845776bc1b1ffe0
Author: Mark Thomas 
AuthorDate: Mon Dec 19 14:52:34 2022 +

Fix BZ 66382 - read timeout bug with HTTP/2 and NIO2

https://bz.apache.org/bugzilla/show_bug.cgi?id=66385
---
 java/org/apache/coyote/http2/Http2AsyncParser.java | 6 --
 webapps/docs/changelog.xml | 5 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2AsyncParser.java 
b/java/org/apache/coyote/http2/Http2AsyncParser.java
index 4e76b12c0c..305cc5be0d 100644
--- a/java/org/apache/coyote/http2/Http2AsyncParser.java
+++ b/java/org/apache/coyote/http2/Http2AsyncParser.java
@@ -134,8 +134,10 @@ class Http2AsyncParser extends Http2Parser {
 ByteBuffer header = ByteBuffer.allocate(9);
 ByteBuffer framePayload = ByteBuffer.allocate(input.getMaxFrameSize());
 FrameCompletionHandler handler = new FrameCompletionHandler(expected, 
header, framePayload);
-CompletionState state =
-socketWrapper.read(block ? BlockingMode.BLOCK : 
BlockingMode.NON_BLOCK, socketWrapper.getReadTimeout(), TimeUnit.MILLISECONDS, 
null, handler, handler, header, framePayload);
+CompletionState state = socketWrapper.read(
+block ? BlockingMode.BLOCK : BlockingMode.NON_BLOCK,
+block ? socketWrapper.getReadTimeout() : 0,
+TimeUnit.MILLISECONDS, null, handler, handler, header, 
framePayload);
 if (state == CompletionState.ERROR || state == CompletionState.INLINE) 
{
 handleAsyncException();
 return true;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index ab3f798683..fe4271410c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -123,6 +123,11 @@
 code NO_ERROR so that client does not discard the 
response.
 Based on a suggestion by Lorenzo Dalla Vecchia. (markt)
   
+  
+66385: Correct a bug in HTTP/2 where a non-blocking read for
+a new frame with the NIO2 connector was incorrectly made using the read
+timeout leading to unexpected stream closure. (markt)
+  
 
   
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 66385] NIO2 with HTTP/2 wrong Timeout behaviour

2022-12-19 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66385

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #1 from Mark Thomas  ---
Fixed in:
- 11.0.x for 11.0.0-M2 onwards
- 10.1.x for 10.1.5 onwards
-  9.0.x for  9.0.71 onwards

8.5.x is unaffected.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch main updated: Fix BZ 66392 - Change the default value of AccessLogValve's file encoding to UTF-8.

2022-12-19 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new 17d9359b23 Fix BZ 66392 - Change the default value of AccessLogValve's 
file encoding to UTF-8.
17d9359b23 is described below

commit 17d9359b23ed357e84563108d3d90f9cbe65a5fb
Author: lihan 
AuthorDate: Tue Dec 20 13:33:48 2022 +0800

Fix BZ 66392 - Change the default value of AccessLogValve's file encoding 
to UTF-8.

https://bz.apache.org/bugzilla/show_bug.cgi?id=66392
---
 java/org/apache/catalina/valves/AccessLogValve.java | 10 +-
 webapps/docs/changelog.xml  |  4 
 webapps/docs/config/valve.xml   |  3 +--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/catalina/valves/AccessLogValve.java 
b/java/org/apache/catalina/valves/AccessLogValve.java
index 5aa090bd3d..12331ebb28 100644
--- a/java/org/apache/catalina/valves/AccessLogValve.java
+++ b/java/org/apache/catalina/valves/AccessLogValve.java
@@ -150,9 +150,9 @@ public class AccessLogValve extends AbstractAccessLogValve {
 protected String fileDateFormat = ".-MM-dd";
 
 /**
- * Character set used by the log file. If it is null, the
- * system default character set will be used. An empty string will be
- * treated as null when this property is assigned.
+ * Character set used by the log file. If it is null, UTF-8
+ * will be used. An empty string will be treated as null
+ * when this property is assigned.
  */
 protected volatile String encoding = null;
 
@@ -342,7 +342,7 @@ public class AccessLogValve extends AbstractAccessLogValve {
 /**
  * Return the character set name that is used to write the log file.
  *
- * @return Character set name, or null if the system default
+ * @return Character set name, or null if the default
  *  character set is used.
  */
 public String getEncoding() {
@@ -644,7 +644,7 @@ public class AccessLogValve extends AbstractAccessLogValve {
 }
 }
 if (charset == null) {
-charset = StandardCharsets.ISO_8859_1;
+charset = StandardCharsets.UTF_8;
 }
 
 try {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 189b68b020..6475f10adb 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -120,6 +120,10 @@
 lookups for resources that contained one or more characters in their
 name that required escaping when used in a URI path. (markt)
   
+  
+66392: Change the default value of 
AccessLogValue's
+file encoding to UTF-8 and update documentation. (lihan)
+  
 
   
   
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 85272084c9..7ee19c04f4 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -165,8 +165,7 @@
 
   
 Character set used to write the log file. An empty string means
-to use the system default character set. Default value: use the
-system default character set.
+to use the default character set. Default value: UTF-8.
 
   
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 10.1.x updated: Fix BZ 66392 - Change the default value of AccessLogValve's file encoding to UTF-8.

2022-12-19 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 20aba8b39d Fix BZ 66392 - Change the default value of AccessLogValve's 
file encoding to UTF-8.
20aba8b39d is described below

commit 20aba8b39dc5f96b04fdebb7b0445fd88d92c37f
Author: lihan 
AuthorDate: Tue Dec 20 13:33:48 2022 +0800

Fix BZ 66392 - Change the default value of AccessLogValve's file encoding 
to UTF-8.

https://bz.apache.org/bugzilla/show_bug.cgi?id=66392
---
 java/org/apache/catalina/valves/AccessLogValve.java | 10 +-
 webapps/docs/changelog.xml  |  4 
 webapps/docs/config/valve.xml   |  3 +--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/catalina/valves/AccessLogValve.java 
b/java/org/apache/catalina/valves/AccessLogValve.java
index 5aa090bd3d..12331ebb28 100644
--- a/java/org/apache/catalina/valves/AccessLogValve.java
+++ b/java/org/apache/catalina/valves/AccessLogValve.java
@@ -150,9 +150,9 @@ public class AccessLogValve extends AbstractAccessLogValve {
 protected String fileDateFormat = ".-MM-dd";
 
 /**
- * Character set used by the log file. If it is null, the
- * system default character set will be used. An empty string will be
- * treated as null when this property is assigned.
+ * Character set used by the log file. If it is null, UTF-8
+ * will be used. An empty string will be treated as null
+ * when this property is assigned.
  */
 protected volatile String encoding = null;
 
@@ -342,7 +342,7 @@ public class AccessLogValve extends AbstractAccessLogValve {
 /**
  * Return the character set name that is used to write the log file.
  *
- * @return Character set name, or null if the system default
+ * @return Character set name, or null if the default
  *  character set is used.
  */
 public String getEncoding() {
@@ -644,7 +644,7 @@ public class AccessLogValve extends AbstractAccessLogValve {
 }
 }
 if (charset == null) {
-charset = StandardCharsets.ISO_8859_1;
+charset = StandardCharsets.UTF_8;
 }
 
 try {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 6d5149ebac..c5b55fc943 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -113,6 +113,10 @@
 lookups for resources that contained one or more characters in their
 name that required escaping when used in a URI path. (markt)
   
+  
+66392: Change the default value of 
AccessLogValue's
+file encoding to UTF-8 and update documentation. (lihan)
+  
 
   
   
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 4459000821..7aa3d56bf3 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -165,8 +165,7 @@
 
   
 Character set used to write the log file. An empty string means
-to use the system default character set. Default value: use the
-system default character set.
+to use the default character set. Default value: UTF-8.
 
   
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Fix BZ 66392 - Change the default value of AccessLogValve's file encoding to UTF-8.

2022-12-19 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 5ffa858953 Fix BZ 66392 - Change the default value of AccessLogValve's 
file encoding to UTF-8.
5ffa858953 is described below

commit 5ffa8589537dd80ba5304e38646332bb76932c68
Author: lihan 
AuthorDate: Tue Dec 20 13:33:48 2022 +0800

Fix BZ 66392 - Change the default value of AccessLogValve's file encoding 
to UTF-8.

https://bz.apache.org/bugzilla/show_bug.cgi?id=66392
---
 java/org/apache/catalina/valves/AccessLogValve.java | 10 +-
 webapps/docs/changelog.xml  |  4 
 webapps/docs/config/valve.xml   |  3 +--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/catalina/valves/AccessLogValve.java 
b/java/org/apache/catalina/valves/AccessLogValve.java
index 5aa090bd3d..12331ebb28 100644
--- a/java/org/apache/catalina/valves/AccessLogValve.java
+++ b/java/org/apache/catalina/valves/AccessLogValve.java
@@ -150,9 +150,9 @@ public class AccessLogValve extends AbstractAccessLogValve {
 protected String fileDateFormat = ".-MM-dd";
 
 /**
- * Character set used by the log file. If it is null, the
- * system default character set will be used. An empty string will be
- * treated as null when this property is assigned.
+ * Character set used by the log file. If it is null, UTF-8
+ * will be used. An empty string will be treated as null
+ * when this property is assigned.
  */
 protected volatile String encoding = null;
 
@@ -342,7 +342,7 @@ public class AccessLogValve extends AbstractAccessLogValve {
 /**
  * Return the character set name that is used to write the log file.
  *
- * @return Character set name, or null if the system default
+ * @return Character set name, or null if the default
  *  character set is used.
  */
 public String getEncoding() {
@@ -644,7 +644,7 @@ public class AccessLogValve extends AbstractAccessLogValve {
 }
 }
 if (charset == null) {
-charset = StandardCharsets.ISO_8859_1;
+charset = StandardCharsets.UTF_8;
 }
 
 try {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index fe4271410c..07a669dd99 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -113,6 +113,10 @@
 lookups for resources that contained one or more characters in their
 name that required escaping when used in a URI path. (markt)
   
+  
+66392: Change the default value of 
AccessLogValue's
+file encoding to UTF-8 and update documentation. (lihan)
+  
 
   
   
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 0f2a9ed792..24d6038751 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -165,8 +165,7 @@
 
   
 Character set used to write the log file. An empty string means
-to use the system default character set. Default value: use the
-system default character set.
+to use the default character set. Default value: UTF-8.
 
   
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 8.5.x updated: Fix BZ 66392 - Change the default value of AccessLogValve's file encoding to UTF-8.

2022-12-19 Thread lihan
This is an automated email from the ASF dual-hosted git repository.

lihan 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 72c262206e Fix BZ 66392 - Change the default value of AccessLogValve's 
file encoding to UTF-8.
72c262206e is described below

commit 72c262206ec61a29439396ba1e3971455f0d0613
Author: lihan 
AuthorDate: Tue Dec 20 13:33:48 2022 +0800

Fix BZ 66392 - Change the default value of AccessLogValve's file encoding 
to UTF-8.

https://bz.apache.org/bugzilla/show_bug.cgi?id=66392
---
 java/org/apache/catalina/valves/AccessLogValve.java | 10 +-
 webapps/docs/changelog.xml  |  4 
 webapps/docs/config/valve.xml   |  3 +--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/catalina/valves/AccessLogValve.java 
b/java/org/apache/catalina/valves/AccessLogValve.java
index 5aa090bd3d..12331ebb28 100644
--- a/java/org/apache/catalina/valves/AccessLogValve.java
+++ b/java/org/apache/catalina/valves/AccessLogValve.java
@@ -150,9 +150,9 @@ public class AccessLogValve extends AbstractAccessLogValve {
 protected String fileDateFormat = ".-MM-dd";
 
 /**
- * Character set used by the log file. If it is null, the
- * system default character set will be used. An empty string will be
- * treated as null when this property is assigned.
+ * Character set used by the log file. If it is null, UTF-8
+ * will be used. An empty string will be treated as null
+ * when this property is assigned.
  */
 protected volatile String encoding = null;
 
@@ -342,7 +342,7 @@ public class AccessLogValve extends AbstractAccessLogValve {
 /**
  * Return the character set name that is used to write the log file.
  *
- * @return Character set name, or null if the system default
+ * @return Character set name, or null if the default
  *  character set is used.
  */
 public String getEncoding() {
@@ -644,7 +644,7 @@ public class AccessLogValve extends AbstractAccessLogValve {
 }
 }
 if (charset == null) {
-charset = StandardCharsets.ISO_8859_1;
+charset = StandardCharsets.UTF_8;
 }
 
 try {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 484306e1d3..674d599cdc 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -123,6 +123,10 @@
 lookups for resources that contained one or more characters in their
 name that required escaping when used in a URI path. (markt)
   
+  
+66392: Change the default value of 
AccessLogValue's
+file encoding to UTF-8 and update documentation. (lihan)
+  
 
   
   
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index a6f4f571a2..ce72d991b7 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -165,8 +165,7 @@
 
   
 Character set used to write the log file. An empty string means
-to use the system default character set. Default value: use the
-system default character set.
+to use the default character set. Default value: UTF-8.
 
   
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 66392] AccessLogValue's file encoding does not correspond to the documentation

2022-12-19 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66392

Han Li  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Han Li  ---
Fixed in:
- 11.0.x for 11.0.0-M2 onwards
- 10.1.x for 10.1.5 onwards
- 9.0.x for 9.0.71 onwards
- 8.5.x for 8.5.85 onwards

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org