(tomcat-connectors) branch main updated: Improve shared memory handling on non-Windows.

2024-08-08 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new d55706e92 Improve shared memory handling on non-Windows.
d55706e92 is described below

commit d55706e92b65018c2e4c7ab14014a996b0174966
Author: Rainer Jung 
AuthorDate: Thu Aug 8 10:00:13 2024 +0200

Improve shared memory handling on non-Windows.
---
 native/common/jk_shm.c| 12 ++--
 xdocs/miscellaneous/changelog.xml |  3 +++
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/native/common/jk_shm.c b/native/common/jk_shm.c
index 857a17ac4..870f8418c 100644
--- a/native/common/jk_shm.c
+++ b/native/common/jk_shm.c
@@ -451,7 +451,7 @@ static int do_shm_open_lock(const char *fname, int 
attached, jk_log_context_t *l
 
 if (attached && jk_shmem.lockname) {
 #ifdef JK_SHM_LOCK_REOPEN
-jk_shmem.fd_lock = open(jk_shmem.lockname, O_RDWR, 0666);
+jk_shmem.fd_lock = open(jk_shmem.lockname, O_RDWR, 0600);
 #else
 errno = EINVAL;
 #endif
@@ -475,7 +475,7 @@ static int do_shm_open_lock(const char *fname, int 
attached, jk_log_context_t *l
 for (i = 0; i < 8; i++) {
 strcpy(flkname, "/tmp/jkshmlock.XX");
 if (mktemp(flkname)) {
-jk_shmem.fd_lock = open(flkname, O_RDWR|O_CREAT|O_TRUNC, 0666);
+jk_shmem.fd_lock = open(flkname, O_RDWR|O_CREAT|O_TRUNC, 0600);
 if (jk_shmem.fd_lock >= 0)
 break;
 }
@@ -487,10 +487,10 @@ static int do_shm_open_lock(const char *fname, int 
attached, jk_log_context_t *l
 #ifdef AS400_UTF8
 wptr = (char *)malloc(strlen(flkname) + 1);
 jk_ascii2ebcdic((char *)flkname, wptr);
-jk_shmem.fd_lock = open(wptr, O_RDWR|O_CREAT|O_TRUNC, 0666);
+jk_shmem.fd_lock = open(wptr, O_RDWR|O_CREAT|O_TRUNC, 0600);
 free(wptr);
 #else
-jk_shmem.fd_lock = open(flkname, O_RDWR|O_CREAT|O_TRUNC, 0666);
+jk_shmem.fd_lock = open(flkname, O_RDWR|O_CREAT|O_TRUNC, 0600);
 #endif
 #endif
 if (jk_shmem.fd_lock == -1) {
@@ -581,10 +581,10 @@ static int do_shm_open(const char *fname, int attached,
 #ifdef AS400_UTF8
 wptr = (char *)malloc(strlen(jk_shmem.filename) + 1);
 jk_ascii2ebcdic((char *)jk_shmem.filename, wptr);
-fd = open(wptr, O_RDWR|O_CREAT|O_TRUNC, 0666);
+fd = open(wptr, O_RDWR|O_CREAT|O_TRUNC, 0600);
 free(wptr);
 #else
-fd = open(jk_shmem.filename, O_RDWR|O_CREAT|O_TRUNC, 0666);
+fd = open(jk_shmem.filename, O_RDWR|O_CREAT|O_TRUNC, 0600);
 #endif
 if (fd == -1) {
 jk_shmem.size = 0;
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index 8e64986aa..026ea6023 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -58,6 +58,9 @@
 to reduce symbol visibility. Also improve escaping of it in the 
Makefile.
 Patch provided by lzs...@freemail.c3.hu. (rjung)
   
+  
+Improve shared memory handling on non-Windows. (rjung)
+  
 
   
   


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



(tomcat-connectors) branch main updated: Remove nested WIN32 checks not longer needed after 385f757697

2024-08-07 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 7c10da834 Remove nested WIN32 checks not longer needed after 385f757697
7c10da834 is described below

commit 7c10da8347518b016c27a039ff271f03cd73f869
Author: Rainer Jung 
AuthorDate: Thu Aug 8 00:54:55 2024 +0200

Remove nested WIN32 checks not longer needed after 385f757697
---
 native/common/jk_shm.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/native/common/jk_shm.c b/native/common/jk_shm.c
index a3c5fb433..857a17ac4 100644
--- a/native/common/jk_shm.c
+++ b/native/common/jk_shm.c
@@ -216,7 +216,6 @@ int jk_shm_open(const char *fname, int sz, jk_log_context_t 
*l)
 return EINVAL;
 }
 jk_shmem.size = JK_SHM_ALIGN(JK_SHM_SLOT_SIZE + sz);
-#if defined (WIN32)
 jk_shm_map   = NULL;
 jk_shm_hlock = NULL;
 if (fname) {
@@ -293,10 +292,8 @@ int jk_shm_open(const char *fname, int sz, 
jk_log_context_t *l)
 shmsz);
 }
 else
-#endif
 jk_shmem.hdr = (jk_shm_header_t *)calloc(1, jk_shmem.size);
 if (!jk_shmem.hdr) {
-#if defined (WIN32)
 rc = GetLastError();
 if (jk_shm_map) {
 CloseHandle(jk_shm_map);
@@ -306,7 +303,6 @@ int jk_shm_open(const char *fname, int sz, jk_log_context_t 
*l)
 CloseHandle(jk_shm_hlock);
 jk_shm_hlock = NULL;
 }
-#endif
 JK_LEAVE_CS(&jk_shmem.cs);
 JK_TRACE_EXIT(l);
 return rc;
@@ -349,12 +345,10 @@ int jk_shm_open(const char *fname, int sz, 
jk_log_context_t *l)
 jk_shmem.hdr->h.data.workers = 0;
 #endif
 }
-#if defined (WIN32)
 if (jk_shm_hlock != NULL) {
 /* Unlock shared memory */
 ReleaseMutex(jk_shm_hlock);
 }
-#endif
 JK_LEAVE_CS(&jk_shmem.cs);
 if (JK_IS_DEBUG_LEVEL(l))
 jk_log(l, JK_LOG_DEBUG,
@@ -403,7 +397,6 @@ void jk_shm_close(jk_log_context_t *l)
"Closed shared memory %s childs=%u",
jk_shm_name(), jk_shmem.hdr->h.data.childs);
 }
-#if defined (WIN32)
 if (jk_shm_hlock) {
 WaitForSingleObject(jk_shm_hlock, 6);
 ReleaseMutex(jk_shm_hlock);
@@ -417,7 +410,6 @@ void jk_shm_close(jk_log_context_t *l)
 jk_shm_map = NULL;
 }
 else
-#endif
 free(jk_shmem.hdr);
 }
 jk_shmem.hdr = NULL;


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



(tomcat-connectors) branch main updated: Add info on 1.2.50 release with estimated release date

2024-08-07 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new b40f4e63a Add info on 1.2.50 release with estimated release date
b40f4e63a is described below

commit b40f4e63a15d54b3d9c4e34d7a087313510b973c
Author: Rainer Jung 
AuthorDate: Wed Aug 7 17:29:16 2024 +0200

Add info on 1.2.50 release with estimated release date
---
 xdocs/ajp/project.xml | 1 +
 xdocs/common_howto/project.xml| 1 +
 xdocs/index.xml   | 6 +++---
 xdocs/miscellaneous/project.xml   | 1 +
 xdocs/news/project.xml| 1 +
 xdocs/project.xml | 1 +
 xdocs/reference/project.xml   | 1 +
 xdocs/webserver_howto/project.xml | 1 +
 8 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/xdocs/ajp/project.xml b/xdocs/ajp/project.xml
index 59da8eaa1..452dbc4fe 100644
--- a/xdocs/ajp/project.xml
+++ b/xdocs/ajp/project.xml
@@ -65,6 +65,7 @@
 
 
 
+
 
 
 
diff --git a/xdocs/common_howto/project.xml b/xdocs/common_howto/project.xml
index 3b4651c11..a1aa0d72c 100644
--- a/xdocs/common_howto/project.xml
+++ b/xdocs/common_howto/project.xml
@@ -65,6 +65,7 @@
 
 
 
+
 
 
 
diff --git a/xdocs/index.xml b/xdocs/index.xml
index 7d159484a..3d3f42216 100644
--- a/xdocs/index.xml
+++ b/xdocs/index.xml
@@ -60,12 +60,12 @@ manual is described in more detail below.
 
 
 
-JK-1.2.49 released
+JK-1.2.50 released
 The Apache Tomcat team is proud to announce the immediate availability
-   of Tomcat Connectors 1.2.49 Stable. This release contains improvements and
+   of Tomcat Connectors 1.2.50 Stable. This release contains improvements and
bug fixes for issues found in previous releases.

-Download the JK 1.2.49
+Download the JK 1.2.50
release.
 
 
diff --git a/xdocs/miscellaneous/project.xml b/xdocs/miscellaneous/project.xml
index 063da08ba..8171f6c97 100644
--- a/xdocs/miscellaneous/project.xml
+++ b/xdocs/miscellaneous/project.xml
@@ -65,6 +65,7 @@
 
 
 
+
 
 
 
diff --git a/xdocs/news/project.xml b/xdocs/news/project.xml
index 6863a13ab..f13938c10 100644
--- a/xdocs/news/project.xml
+++ b/xdocs/news/project.xml
@@ -65,6 +65,7 @@
 
 
 
+
 
 
 
diff --git a/xdocs/project.xml b/xdocs/project.xml
index e867d1894..23cbb6a4a 100644
--- a/xdocs/project.xml
+++ b/xdocs/project.xml
@@ -65,6 +65,7 @@
 
 
 
+
 
 
 
diff --git a/xdocs/reference/project.xml b/xdocs/reference/project.xml
index 510c30891..1cfffa088 100644
--- a/xdocs/reference/project.xml
+++ b/xdocs/reference/project.xml
@@ -65,6 +65,7 @@
 
 
 
+
 
 
 
diff --git a/xdocs/webserver_howto/project.xml 
b/xdocs/webserver_howto/project.xml
index b5f42b64d..bedcaffdd 100644
--- a/xdocs/webserver_howto/project.xml
+++ b/xdocs/webserver_howto/project.xml
@@ -65,6 +65,7 @@
 
 
 
+
 
 
 


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



(tomcat-connectors) branch main updated: Update config.guess and config.sub

2024-08-07 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new b7e40f4fe Update config.guess and config.sub
b7e40f4fe is described below

commit b7e40f4fe795dbaaad035fd7fe4a0a35a9cdbff9
Author: Rainer Jung 
AuthorDate: Wed Aug 7 17:21:49 2024 +0200

Update config.guess and config.sub

Taken from https://git.savannah.gnu.org/cgit/config.git.
---
 native/scripts/build/unix/config.guess | 1272 +++-
 native/scripts/build/unix/config.sub   | 1423 ++--
 xdocs/miscellaneous/changelog.xml  |5 +
 3 files changed, 1707 insertions(+), 993 deletions(-)

diff --git a/native/scripts/build/unix/config.guess 
b/native/scripts/build/unix/config.guess
index 45001cfec..48a684601 100755
--- a/native/scripts/build/unix/config.guess
+++ b/native/scripts/build/unix/config.guess
@@ -1,12 +1,14 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2020 Free Software Foundation, Inc.
+#   Copyright 1992-2024 Free Software Foundation, Inc.
 
-timestamp='2020-01-01'
+# shellcheck disable=SC2006,SC2268 # see below for rationale
+
+timestamp='2024-07-27'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
@@ -27,17 +29,25 @@ timestamp='2020-01-01'
 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
-# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
 #
 # Please send patches to .
 
 
+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX.  However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
+
+
 me=`echo "$0" | sed -e 's,.*/,,'`
 
 usage="\
 Usage: $0 [OPTION]
 
-Output the configuration name of the system \`$me' is run on.
+Output the configuration name of the system '$me' is run on.
 
 Options:
   -h, --help print this help, then exit
@@ -50,13 +60,13 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2020 Free Software Foundation, Inc.
+Copyright 1992-2024 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
 
 help="
-Try \`$me --help' for more information."
+Try '$me --help' for more information."
 
 # Parse command line
 while test $# -gt 0 ; do
@@ -84,13 +94,16 @@ if test $# != 0; then
   exit 1
 fi
 
+# Just in case it came from the environment.
+GUESS=
+
 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
 # compiler to aid in system detection is discouraged as it requires
 # temporary files to be created and, as you can see below, it is a
 # headache to deal with in a portable fashion.
 
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
+# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
+# use 'HOST_CC' if defined, but it is deprecated.
 
 # Portable tmp directory creation inspired by the Autoconf team.
 
@@ -102,7 +115,7 @@ set_cc_for_build() {
 # prevent multiple calls if $tmp is already set
 test "$tmp" && return 0
 : "${TMPDIR=/tmp}"
-# shellcheck disable=SC2039
+# shellcheck disable=SC2039,SC3028
 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXX") 2>/dev/null` && test -n 
"$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir 
"$tmp" 2>/dev/null) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo 
"Warning: creating insecure temp directory" >&2 ; } ||
@@ -110,9 +123,9 @@ set_cc_for_build() {
 dummy=$tmp/dummy
 case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
,,)ec

(tomcat-connectors) branch main updated: Update PCRE bundled with the ISAPI redirector to 8.45.

2024-08-07 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new c1d9e71d6 Update PCRE bundled with the ISAPI redirector to 8.45.
c1d9e71d6 is described below

commit c1d9e71d68d9573728d71b738d683993ba3e5089
Author: Rainer Jung 
AuthorDate: Wed Aug 7 17:16:35 2024 +0200

Update PCRE bundled with the ISAPI redirector to 8.45.
---
 native/iis/pcre/pcre.h| 4 ++--
 native/iis/pcre/pcre_compile.c| 9 ++---
 native/iis/pcre/pcre_exec.c   | 4 ++--
 xdocs/miscellaneous/changelog.xml | 7 +++
 4 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/native/iis/pcre/pcre.h b/native/iis/pcre/pcre.h
index 86e3956c2..bee1fe6ff 100644
--- a/native/iis/pcre/pcre.h
+++ b/native/iis/pcre/pcre.h
@@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
 /* The current PCRE version information. */
 
 #define PCRE_MAJOR  8
-#define PCRE_MINOR  44
+#define PCRE_MINOR  45
 #define PCRE_PRERELEASE 
-#define PCRE_DATE   2020-02-12
+#define PCRE_DATE   2021-06-15
 
 /* When an application links to a PCRE DLL in Windows, the symbols that are
 imported have to be identified as such. When building PCRE, the appropriate
diff --git a/native/iis/pcre/pcre_compile.c b/native/iis/pcre/pcre_compile.c
index 3be0fbfb1..8b80abe03 100644
--- a/native/iis/pcre/pcre_compile.c
+++ b/native/iis/pcre/pcre_compile.c
@@ -6,7 +6,7 @@
 and semantics are as close as possible to those of the Perl 5 language.
 
Written by Philip Hazel
-   Copyright (c) 1997-2020 University of Cambridge
+   Copyright (c) 1997-2021 University of Cambridge
 
 -
 Redistribution and use in source and binary forms, with or without
@@ -9099,6 +9099,8 @@ pcre_uchar cworkspace[COMPILE_WORK_SIZE];
 similar way to cworkspace, it can be expanded using malloc() if necessary. */
 
 named_group named_groups[NAMED_GROUP_LIST_SIZE];
+cd->named_groups = named_groups;
+cd->named_group_list_size = NAMED_GROUP_LIST_SIZE;
 
 /* Set this early so that early errors get offset 0. */
 
@@ -9372,8 +9374,6 @@ cd->hwm = cworkspace;
 cd->iscondassert = FALSE;
 cd->start_workspace = cworkspace;
 cd->workspace_size = COMPILE_WORK_SIZE;
-cd->named_groups = named_groups;
-cd->named_group_list_size = NAMED_GROUP_LIST_SIZE;
 cd->start_pattern = (const pcre_uchar *)pattern;
 cd->end_pattern = (const pcre_uchar *)(pattern + STRLEN_UC((const pcre_uchar 
*)pattern));
 cd->req_varyopt = 0;
@@ -9484,6 +9484,7 @@ if (cd->names_found > 0)
 add_name(cd, ng->name, ng->length, ng->number);
   if (cd->named_group_list_size > NAMED_GROUP_LIST_SIZE)
 (PUBL(free))((void *)cd->named_groups);
+  cd->named_group_list_size = 0;   /* So we don't free it twice */
   }
 
 /* Set up a starting, non-extracting bracket, then compile the expression. On
@@ -9634,6 +9635,8 @@ if (errorcode != 0)
   {
   (PUBL(free))(re);
   PCRE_EARLY_ERROR_RETURN:
+  if (cd->named_group_list_size > NAMED_GROUP_LIST_SIZE)
+(PUBL(free))((void *)cd->named_groups);
   *erroroffset = (int)(ptr - (const pcre_uchar *)pattern);
   PCRE_EARLY_ERROR_RETURN2:
   *errorptr = find_error_text(errorcode);
diff --git a/native/iis/pcre/pcre_exec.c b/native/iis/pcre/pcre_exec.c
index 3fd58cbe3..5b96954fc 100644
--- a/native/iis/pcre/pcre_exec.c
+++ b/native/iis/pcre/pcre_exec.c
@@ -6,7 +6,7 @@
 and semantics are as close as possible to those of the Perl 5 language.
 
Written by Philip Hazel
-   Copyright (c) 1997-2018 University of Cambridge
+   Copyright (c) 1997-2021 University of Cambridge
 
 -
 Redistribution and use in source and binary forms, with or without
@@ -758,7 +758,7 @@ for (;;)
 md->mark = NULL;/* In case previously set by assertion */
 RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md,
   eptrb, RM55);
-if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) &&
+if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT || rrc == MATCH_KETRPOS) &&
  md->mark == NULL) md->mark = ecode + 2;
 
 /* A return of MATCH_SKIP_ARG means that matching failed at SKIP with an
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index af1a24517..6629a59f6 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -60,6 +60,13 @@
   
 
   
+  
+
+  
+Update PCRE bundled with the ISAPI redirector to 8.45. (rjung)
+  
+
+  
   
 
   


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



(tomcat-connectors) 01/01: Merge pull request #8 from ConiKost/main

2024-08-07 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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

commit 84b55ae3d985c02c68e52e04fe965d1d863e50d3
Merge: 6972e9502 479102b94
Author: rainerjung 
AuthorDate: Wed Aug 7 16:01:38 2024 +0200

Merge pull request #8 from ConiKost/main

native/common/jk_global.h: fix compilation on musl



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



(tomcat-connectors) branch main updated (6972e9502 -> 84b55ae3d)

2024-08-07 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-connectors.git


from 6972e9502 Fix compilation on musl (PR 8) Patch provided by 
conrad+git...@kostecki.com.
 add 479102b94 native/common/jk_global.h: fix compilation on musl
 new 84b55ae3d Merge pull request #8 from ConiKost/main

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:


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



(tomcat-connectors) branch main updated (f37c07cb5 -> 6972e9502)

2024-08-07 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-connectors.git


from f37c07cb5 Update version for next development cycle - addition to 
963347be
 add 6972e9502 Fix compilation on musl (PR 8) Patch provided by 
conrad+git...@kostecki.com.

No new revisions were added by this update.

Summary of changes:
 native/common/jk_global.h | 2 +-
 xdocs/miscellaneous/changelog.xml | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)


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



(tomcat-connectors) branch main updated: Update version for next development cycle - addition to 963347be

2024-08-07 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new f37c07cb5 Update version for next development cycle - addition to 
963347be
f37c07cb5 is described below

commit f37c07cb5c699167340bbbd6edff6f0dff06906b
Author: Rainer Jung 
AuthorDate: Wed Aug 7 15:29:28 2024 +0200

Update version for next development cycle - addition to 963347be
---
 native/common/jk_version.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/native/common/jk_version.h b/native/common/jk_version.h
index a4d06f0e0..7f1c91855 100644
--- a/native/common/jk_version.h
+++ b/native/common/jk_version.h
@@ -24,7 +24,7 @@
 
 #define JK_VERMAJOR 1
 #define JK_VERMINOR 2
-#define JK_VERMICRO 49
+#define JK_VERMICRO 50
 
 #if defined(JK_ISAPI)
 #define JK_DISTNAME "isapi_redirector"


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



(tomcat) branch main updated: Add my new code signing key

2024-06-06 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 e69545d70c Add my new code signing key
e69545d70c is described below

commit e69545d70c4e3e7a2a16526278612d05d80cdf74
Author: Rainer Jung 
AuthorDate: Thu Jun 6 18:06:26 2024 +0200

Add my new code signing key
---
 KEYS | 59 +++
 1 file changed, 59 insertions(+)

diff --git a/KEYS b/KEYS
index 9d46a9cfe6..3c2594b5ee 100644
--- a/KEYS
+++ b/KEYS
@@ -510,5 +510,64 @@ 
LucW7f0Lqlbv/mlJpqByz522jmJRNFLVQh87LYz91FgsLAgDkPpi8mzRrEfb2nHD
 =l4Ry
 -END PGP PUBLIC KEY BLOCK-
 
+pub   rsa4096/A981B20F69F31D68 2024-06-06 [SC]
+  Schl.-Fingerabdruck = 7C44 98DF 62F8 9894 21BD  D497 A981 B20F 69F3 1D68
+uid  [ ultimativ ] Rainer Jung (CODE SIGNING KEY) 

+sig 3A981B20F69F31D68 2024-06-06  Rainer Jung (CODE SIGNING KEY) 

+sub   rsa4096/546F779311D347D6 2024-06-06 [E]
+sig  A981B20F69F31D68 2024-06-06  Rainer Jung (CODE SIGNING KEY) 

+
+-BEGIN PGP PUBLIC KEY BLOCK-
+
+mQINBGZhhxYBEACxDg60fvVcUwX4kaoqKCIN9GjwIdLFjRCPG/d72ypjcvrw1/+D
+NoQI7lMb3l3ku67Mu5Zo0DQ6qYMORv6saCZvgU0Vb+VTsD8uudEO9oB2B/LsrnbJ
+BJ8nk5anOEYyFwELb9M4NsDznRboMBzj3KWOpx9cmo9PmMWpsjz7unVRV0EZQHDB
+Ec/Zj+dKVRNkwUgIpIPTQLxOLgC/ukL2Mykjob25ctwV4+uaAkXTb9dHt6ScjAc+
+0G1lDCm8rx7yMhis+cyqj5NRJ+uW3W5GYlHDcUgcBvQ0RlvLN6VaKLOjgEWqZSG/
+KkwbOoLZuDuuoLq33hDipXLL5hJ6a88Hcm8xj7/56m7/kkTYhOjPNF6fX1YrOy98
+MJBQpO0UJR84Aie5+2wZhcJoQZ/8H7V9ltKxxq3zhXRW373SN3BRVp6UHNsgzBBR
+Ze4LpVNG6AG/DAZ3rV4RBxR9d9bkdAeyY30Td3Cj+p9jGHnPQIGnNBLNve/LtzcS
+gnr4E2XTVauqXuksaeWXDPhdiy5GleL+z53OuhnrsHdsAqPRtOkTnICqZ9yldNkh
+jx6L014GA/NVRgbIZ2lz2IwgWrImLcmKty7YM2yQH2TNXZunnNDyFtSeQYcrYOl1
+BJzw0fb7/6n/Q5V6Cd5c+cNrIRJKK7zDaNzmVKr6uB8xVvaC+0e/8mxgAQARAQAB
+tDFSYWluZXIgSnVuZyAoQ09ERSBTSUdOSU5HIEtFWSkgPHJqdW5nQGFwYWNoZS5v
+cmc+iQJNBBMBCgA3FiEEfESY32L4mJQhvdSXqYGyD2nzHWgFAmZhhxYCGwMFCwkI
+BwMFFQoJCAsEFgIBAAIeAQIXgAAKCRCpgbIPafMdaCpgD/90MhxXP/p07BNaGq0N
+INWNkzkU6LwVpCb+08y6KOyJCKF4jXmds+reaCVNKwvxNgtaCezxS/dwfXexnG+B
+QmIChoot4AqIau0nQbmSODbULlLd9k9/ChkcluASIcDCHazQfd8JtmEuIamR0w45
+U8sqfSOQVZGXD4Dyg+meL7Z33j/ir3/wXndzKXWZNLBpNePndU6dLyLAIuJwPv0N
+gUhNkP98U5o99uo9KjL0Q2jEMzdgYqAFyAe/9OdemsHQuvAeaUnVIGxSkVmVpKkB
+rhpNekDYJ7vhDm8YIOzdgAAAxh7DSkJxSFBTqtVs3t5VAXUB4USDlRD0cNzmiXOu
+tnxc13qV1rCfYYxizav5YyI5+Fvs3e3a3BZj7hgvw7ZMgydxYHxdJvjWorszZgOL
+GQR4CPx5BoJM4kvBOlpRu8YyyeGac6cM159Q8KmGKK/kW3tO0/GiS3aYnJ7wMl/L
+vLAqQ99yVx/xfg0geo327cb+d9za0FvKfIjYidRHxlK1ksR3azwl+DmJYKeE15lf
+YrBzwZUGjbvl02tvQpzvdFa+MiRcrNYCt16exA1pWhrluj1hrHXsm6jRBAmVPqG5
+28frwy2A7GOsbQzQwKjwP+A5EkfRW79CwxkHcMtDbO8pwMTl/EV99V33Mu+MgXAp
+Pg5+wJV4IP5Y31UcJTZmudDMtLkCDQRmYYcWARAAxN66fAG0CPf53rIkeIMk4Q7w
+j3XguCIzKweHA6Phl7uQOocvyS2XYz+OvvwygRs9jW5m56hqT4aHjNqjWl+Kqsh2
+xqfC/0u/tY5lzeepJI40I9ImsPAUoUbcwJqFHLtV7F00gGZTMNVNE9mz13arXqQx
+c3GFJmvDt98xoC9CIrEZs6f7j7WKzp46gQLBUty3G01CIAJ+W2zE+RjKrwg2ENh9
+MBXesCHskaj76pTXn5JNDdqou/YC0oUHm9mUwhNIeJ1nQqe27fxFhc/RxdvQ3ww0
+BW0KvtoF+Vm7MdjtTykncN2VE3QZ8YxtRCVZGxX9vUAy0WCqWoXRmbtZNJvExD6m
+mfeJdsRcQVUdrMEgAXA3EQaJrv1HqcdzG5+vhZlEmVzSez5td3h/rN66p1hvojUm
+wL+7w7Szq/k3nB2Z/5tRG1s/bm5CH2jScQvXoQMus4jOc38T3D6ejbdVO18BbWo0
+NvgbvzsAzEtrGEfO3OF1Z8lS4hlwBMxh1dh1dxp5poqJWK4ac6O01Khnj93p3WJ4
+v1jWc1SlXgaPP5w7K9/BfOP/rorAW8yS4wyBgG93pELuq54FJyfkrZYgjfG6H23o
+gIfCgBPkfSajBxiUqrtw1RGpnH8upMjuUtKoN1OOZgJpjQTL3zKyb0zkra5V5rB4
+jebEQpmN+XzsY7NTK0MAEQEAAYkCNgQYAQoAIBYhBHxEmN9i+JiUIb3Ul6mBsg9p
+8x1oBQJmYYcWAhsMAAoJEKmBsg9p8x1oudwQAIGAX+5qD/pYy5gOlGZTVTFYK2ZD
+H9WuLUCVRY4THK1hu5BTgGv0y7klVjFFlADV108smA0BABT4hbLA2MwKN+cbKFk1
+Uh21rGjHGDGC1tQK3xJRKACe11iuLerR8gH+AWtATzsFR6Hcewbt2NrqyAJrdixY
+TLWzCiuh9nYZhWejsXFneXCqWMM/ujDEFyG8+uDFCLBVhbR8LRLOEyrhZpf/pdUg
+0/HJF97+lccIgmfYhB3XphvC/awq5TysdTM2PntR0mwtAs6yCxSM4uVxqXk3PERN
+qNfyhvQjJLT5wtcD2WnH5c4t4SSDAv2c2Hlkb3ND0NIVBih46GWrSlRMbQ/vBfF5
+2zS1063/CWYyoVwT2Qc/KOEWhsyfZ4Eu0RiPp4H7mQU+lrlYNX7vamEuMOns5Ej5
+A3yrwldzLmHupovbqp5JTJfwBZxuvKd56l/gQzBytqB5bsSayAxLHV5UBeU1x6f0
+iEnj8HmaC6qZk0N6IVPieNdm2QG5zsght7AtCatI1KWdzOFMd1/RatEq1VVVqxkz
++xV48o9SJa/eq3H2Aaxa05//orSxnHwaZx1PZhTdYfI2OHom6TN/9WZIwBOIXYDq
+kbYVQ3leJ2E5hegywm3NOaw7N7ofkrhBmG4gaRexEfy3IN/uim5rI45OFurigpnm
+LGAB2VDZc7S9Vntr
+=ILKA
+-END PGP PUBLIC KEY BLOCK-
 
 


-
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: Add openssl ffm testing

2024-04-18 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 1ffc62afa7 Add openssl ffm testing
1ffc62afa7 is described below

commit 1ffc62afa7e61d6570a18abbb94a238fa995d767
Author: Rainer Jung 
AuthorDate: Thu Apr 18 23:11:48 2024 +0200

Add openssl ffm testing
---
 .../catalina/valves/rewrite/TestResolverSSL.java  | 19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java 
b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java
index 2bebd2cbf5..978ab23c25 100644
--- a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java
+++ b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java
@@ -35,6 +35,7 @@ import org.apache.catalina.Container;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
 import org.apache.catalina.core.AprLifecycleListener;
+import org.apache.catalina.core.OpenSSLLifecycleListener;
 import org.apache.catalina.core.StandardServer;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
@@ -42,6 +43,7 @@ import org.apache.catalina.valves.ValveBase;
 import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.net.SSLHostConfig;
 import org.apache.tomcat.util.net.TesterSupport;
+import org.apache.tomcat.util.net.openssl.OpenSSLImplementation;
 
 @RunWith(Parameterized.class)
 public class TestResolverSSL extends TomcatBaseTest {
@@ -52,6 +54,8 @@ public class TestResolverSSL extends TomcatBaseTest {
 parameterSets.add(new Object[] { "JSSE", Boolean.FALSE, 
"org.apache.tomcat.util.net.jsse.JSSEImplementation" });
 parameterSets.add(
 new Object[] { "OpenSSL", Boolean.TRUE, 
"org.apache.tomcat.util.net.openssl.OpenSSLImplementation" });
+parameterSets.add(
+new Object[] { "OpenSSL", Boolean.TRUE, 
"org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation" });
 
 return parameterSets;
 }
@@ -173,10 +177,17 @@ public class TestResolverSSL extends TomcatBaseTest {
 
Assert.assertTrue(tomcat.getConnector().setProperty("sslImplementationName", 
sslImplementationName));
 
 if (useOpenSSL) {
-AprLifecycleListener listener = new AprLifecycleListener();
-Assume.assumeTrue(AprLifecycleListener.isAprAvailable());
-StandardServer server = (StandardServer) tomcat.getServer();
-server.addLifecycleListener(listener);
+if 
(OpenSSLImplementation.class.getName().equals(sslImplementationName)) {
+AprLifecycleListener listener = new AprLifecycleListener();
+Assume.assumeTrue(AprLifecycleListener.isAprAvailable());
+StandardServer server = (StandardServer) tomcat.getServer();
+server.addLifecycleListener(listener);
+} else if 
("org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation".equals(sslImplementationName))
 {
+OpenSSLLifecycleListener listener = new 
OpenSSLLifecycleListener();
+Assume.assumeTrue(OpenSSLLifecycleListener.isAvailable());
+StandardServer server = (StandardServer) tomcat.getServer();
+server.addLifecycleListener(listener);
+}
 }
 }
 }


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



(tomcat) branch main updated: Add openssl ffm testing

2024-04-18 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 17f779bf7b Add openssl ffm testing
 new 899e06a7ba Merge branch 'main' of https://github.com/apache/tomcat
17f779bf7b is described below

commit 17f779bf7bb48e30e77146cee10a0d52194eaa7a
Author: Rainer Jung 
AuthorDate: Thu Apr 18 23:11:48 2024 +0200

Add openssl ffm testing
---
 .../catalina/valves/rewrite/TestResolverSSL.java  | 19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java 
b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java
index 2bebd2cbf5..978ab23c25 100644
--- a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java
+++ b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java
@@ -35,6 +35,7 @@ import org.apache.catalina.Container;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
 import org.apache.catalina.core.AprLifecycleListener;
+import org.apache.catalina.core.OpenSSLLifecycleListener;
 import org.apache.catalina.core.StandardServer;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
@@ -42,6 +43,7 @@ import org.apache.catalina.valves.ValveBase;
 import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.net.SSLHostConfig;
 import org.apache.tomcat.util.net.TesterSupport;
+import org.apache.tomcat.util.net.openssl.OpenSSLImplementation;
 
 @RunWith(Parameterized.class)
 public class TestResolverSSL extends TomcatBaseTest {
@@ -52,6 +54,8 @@ public class TestResolverSSL extends TomcatBaseTest {
 parameterSets.add(new Object[] { "JSSE", Boolean.FALSE, 
"org.apache.tomcat.util.net.jsse.JSSEImplementation" });
 parameterSets.add(
 new Object[] { "OpenSSL", Boolean.TRUE, 
"org.apache.tomcat.util.net.openssl.OpenSSLImplementation" });
+parameterSets.add(
+new Object[] { "OpenSSL", Boolean.TRUE, 
"org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation" });
 
 return parameterSets;
 }
@@ -173,10 +177,17 @@ public class TestResolverSSL extends TomcatBaseTest {
 
Assert.assertTrue(tomcat.getConnector().setProperty("sslImplementationName", 
sslImplementationName));
 
 if (useOpenSSL) {
-AprLifecycleListener listener = new AprLifecycleListener();
-Assume.assumeTrue(AprLifecycleListener.isAprAvailable());
-StandardServer server = (StandardServer) tomcat.getServer();
-server.addLifecycleListener(listener);
+if 
(OpenSSLImplementation.class.getName().equals(sslImplementationName)) {
+AprLifecycleListener listener = new AprLifecycleListener();
+Assume.assumeTrue(AprLifecycleListener.isAprAvailable());
+StandardServer server = (StandardServer) tomcat.getServer();
+server.addLifecycleListener(listener);
+} else if 
("org.apache.tomcat.util.net.openssl.panama.OpenSSLImplementation".equals(sslImplementationName))
 {
+OpenSSLLifecycleListener listener = new 
OpenSSLLifecycleListener();
+Assume.assumeTrue(OpenSSLLifecycleListener.isAvailable());
+StandardServer server = (StandardServer) tomcat.getServer();
+server.addLifecycleListener(listener);
+}
 }
 }
 }


-
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: Now that we have two native OpenSSL implementation, use a somewhat less misleading variable name in unit tests.

2024-04-18 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 c6a5b445b0 Now that we have two native OpenSSL implementation, use a 
somewhat less misleading variable name in unit tests.
c6a5b445b0 is described below

commit c6a5b445b038fcc1975e3491f11817962ab5cb49
Author: Rainer Jung 
AuthorDate: Thu Apr 18 16:40:41 2024 +0200

Now that we have two native OpenSSL implementation, use a somewhat less 
misleading variable name in unit tests.
---
 test/org/apache/catalina/valves/rewrite/TestResolverSSL.java   |  4 ++--
 test/org/apache/coyote/http2/TestLargeUpload.java  |  4 ++--
 test/org/apache/tomcat/util/net/TestClientCert.java|  4 ++--
 test/org/apache/tomcat/util/net/TestClientCertTls13.java   |  6 +++---
 test/org/apache/tomcat/util/net/TestCustomSslTrustManager.java |  4 ++--
 test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java   |  4 ++--
 .../apache/tomcat/util/net/TestSSLHostConfigIntegration.java   |  4 ++--
 test/org/apache/tomcat/util/net/TestSsl.java   | 10 +-
 test/org/apache/tomcat/util/net/TesterSupport.java |  4 ++--
 .../apache/tomcat/websocket/TestWebSocketFrameClientSSL.java   |  4 ++--
 .../apache/tomcat/websocket/TestWsWebSocketContainerSSL.java   |  4 ++--
 11 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java 
b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java
index 6b7de8ef2c..2bebd2cbf5 100644
--- a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java
+++ b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java
@@ -60,7 +60,7 @@ public class TestResolverSSL extends TomcatBaseTest {
 public String connectorName;
 
 @Parameter(1)
-public boolean needApr;
+public boolean useOpenSSL;
 
 @Parameter(2)
 public String sslImplementationName;
@@ -172,7 +172,7 @@ public class TestResolverSSL extends TomcatBaseTest {
 
 
Assert.assertTrue(tomcat.getConnector().setProperty("sslImplementationName", 
sslImplementationName));
 
-if (needApr) {
+if (useOpenSSL) {
 AprLifecycleListener listener = new AprLifecycleListener();
 Assume.assumeTrue(AprLifecycleListener.isAprAvailable());
 StandardServer server = (StandardServer) tomcat.getServer();
diff --git a/test/org/apache/coyote/http2/TestLargeUpload.java 
b/test/org/apache/coyote/http2/TestLargeUpload.java
index 5904eba8fe..33da9b5879 100644
--- a/test/org/apache/coyote/http2/TestLargeUpload.java
+++ b/test/org/apache/coyote/http2/TestLargeUpload.java
@@ -66,7 +66,7 @@ public class TestLargeUpload extends Http2TestBase {
 public String connectorName;
 
 @Parameter(3)
-public boolean needApr;
+public boolean useOpenSSL;
 
 @Parameter(4)
 public String sslImplementationName;
@@ -159,6 +159,6 @@ public class TestLargeUpload extends Http2TestBase {
 
 Tomcat tomcat = getTomcatInstance();
 
-TesterSupport.configureSSLImplementation(tomcat, 
sslImplementationName, needApr);
+TesterSupport.configureSSLImplementation(tomcat, 
sslImplementationName, useOpenSSL);
 }
 }
diff --git a/test/org/apache/tomcat/util/net/TestClientCert.java 
b/test/org/apache/tomcat/util/net/TestClientCert.java
index 7ebfb4c308..eeabba688c 100644
--- a/test/org/apache/tomcat/util/net/TestClientCert.java
+++ b/test/org/apache/tomcat/util/net/TestClientCert.java
@@ -57,7 +57,7 @@ public class TestClientCert extends TomcatBaseTest {
 public String connectorName;
 
 @Parameter(1)
-public boolean needApr;
+public boolean useOpenSSL;
 
 @Parameter(2)
 public String sslImplementationName;
@@ -216,6 +216,6 @@ public class TestClientCert extends TomcatBaseTest {
 
 TesterSupport.configureClientSsl();
 
-TesterSupport.configureSSLImplementation(tomcat, 
sslImplementationName, needApr);
+TesterSupport.configureSSLImplementation(tomcat, 
sslImplementationName, useOpenSSL);
 }
 }
diff --git a/test/org/apache/tomcat/util/net/TestClientCertTls13.java 
b/test/org/apache/tomcat/util/net/TestClientCertTls13.java
index 742668f062..786d42283f 100644
--- a/test/org/apache/tomcat/util/net/TestClientCertTls13.java
+++ b/test/org/apache/tomcat/util/net/TestClientCertTls13.java
@@ -64,7 +64,7 @@ public class TestClientCertTls13 extends TomcatBaseTest {
 public String connectorName;
 
 @Parameter(1)
-public boolean needApr;
+public boolean useOpenSSL;
 
 @Parameter(2)
 public String sslImplementationName;
@@ -107,9 +107,9 @@ public class TestClientCertTls13 extends TomcatBaseTest {
 TesterSupport.configureClientSsl();
 
 Connector connector = tomcat.getConnector();
-TesterSupport.configureSSLImplementat

(tomcat) branch main updated: Now that we have two native OpenSSL implementation, use a somewhat less misleading variable name in unit tests.

2024-04-18 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 8eea901875 Now that we have two native OpenSSL implementation, use a 
somewhat less misleading variable name in unit tests.
 new 60c4a31345 Merge branch 'main' of https://github.com/apache/tomcat
8eea901875 is described below

commit 8eea9018754804d5e3fb6d258df1ce08e13bae99
Author: Rainer Jung 
AuthorDate: Thu Apr 18 16:40:41 2024 +0200

Now that we have two native OpenSSL implementation, use a somewhat less 
misleading variable name in unit tests.
---
 test/org/apache/catalina/valves/rewrite/TestResolverSSL.java   |  4 ++--
 test/org/apache/coyote/http2/TestLargeUpload.java  |  4 ++--
 test/org/apache/tomcat/util/net/TestClientCert.java|  4 ++--
 test/org/apache/tomcat/util/net/TestClientCertTls13.java   |  6 +++---
 test/org/apache/tomcat/util/net/TestCustomSslTrustManager.java |  4 ++--
 test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java   |  4 ++--
 .../apache/tomcat/util/net/TestSSLHostConfigIntegration.java   |  4 ++--
 test/org/apache/tomcat/util/net/TestSsl.java   | 10 +-
 test/org/apache/tomcat/util/net/TesterSupport.java |  4 ++--
 .../apache/tomcat/websocket/TestWebSocketFrameClientSSL.java   |  4 ++--
 .../apache/tomcat/websocket/TestWsWebSocketContainerSSL.java   |  4 ++--
 11 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java 
b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java
index 6b7de8ef2c..2bebd2cbf5 100644
--- a/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java
+++ b/test/org/apache/catalina/valves/rewrite/TestResolverSSL.java
@@ -60,7 +60,7 @@ public class TestResolverSSL extends TomcatBaseTest {
 public String connectorName;
 
 @Parameter(1)
-public boolean needApr;
+public boolean useOpenSSL;
 
 @Parameter(2)
 public String sslImplementationName;
@@ -172,7 +172,7 @@ public class TestResolverSSL extends TomcatBaseTest {
 
 
Assert.assertTrue(tomcat.getConnector().setProperty("sslImplementationName", 
sslImplementationName));
 
-if (needApr) {
+if (useOpenSSL) {
 AprLifecycleListener listener = new AprLifecycleListener();
 Assume.assumeTrue(AprLifecycleListener.isAprAvailable());
 StandardServer server = (StandardServer) tomcat.getServer();
diff --git a/test/org/apache/coyote/http2/TestLargeUpload.java 
b/test/org/apache/coyote/http2/TestLargeUpload.java
index 5904eba8fe..33da9b5879 100644
--- a/test/org/apache/coyote/http2/TestLargeUpload.java
+++ b/test/org/apache/coyote/http2/TestLargeUpload.java
@@ -66,7 +66,7 @@ public class TestLargeUpload extends Http2TestBase {
 public String connectorName;
 
 @Parameter(3)
-public boolean needApr;
+public boolean useOpenSSL;
 
 @Parameter(4)
 public String sslImplementationName;
@@ -159,6 +159,6 @@ public class TestLargeUpload extends Http2TestBase {
 
 Tomcat tomcat = getTomcatInstance();
 
-TesterSupport.configureSSLImplementation(tomcat, 
sslImplementationName, needApr);
+TesterSupport.configureSSLImplementation(tomcat, 
sslImplementationName, useOpenSSL);
 }
 }
diff --git a/test/org/apache/tomcat/util/net/TestClientCert.java 
b/test/org/apache/tomcat/util/net/TestClientCert.java
index 7ebfb4c308..eeabba688c 100644
--- a/test/org/apache/tomcat/util/net/TestClientCert.java
+++ b/test/org/apache/tomcat/util/net/TestClientCert.java
@@ -57,7 +57,7 @@ public class TestClientCert extends TomcatBaseTest {
 public String connectorName;
 
 @Parameter(1)
-public boolean needApr;
+public boolean useOpenSSL;
 
 @Parameter(2)
 public String sslImplementationName;
@@ -216,6 +216,6 @@ public class TestClientCert extends TomcatBaseTest {
 
 TesterSupport.configureClientSsl();
 
-TesterSupport.configureSSLImplementation(tomcat, 
sslImplementationName, needApr);
+TesterSupport.configureSSLImplementation(tomcat, 
sslImplementationName, useOpenSSL);
 }
 }
diff --git a/test/org/apache/tomcat/util/net/TestClientCertTls13.java 
b/test/org/apache/tomcat/util/net/TestClientCertTls13.java
index 742668f062..786d42283f 100644
--- a/test/org/apache/tomcat/util/net/TestClientCertTls13.java
+++ b/test/org/apache/tomcat/util/net/TestClientCertTls13.java
@@ -64,7 +64,7 @@ public class TestClientCertTls13 extends TomcatBaseTest {
 public String connectorName;
 
 @Parameter(1)
-public boolean needApr;
+public boolean useOpenSSL;
 
 @Parameter(2)
 public String sslImplementationName;
@@ -107,9 +107,9 @@ public class TestClientCertTls13 extends TomcatBaseTest {
 TesterSupport.configureClientSsl();
 

(tomcat) branch 9.0.x updated: Improve websocket junit test timing behavior.

2024-04-18 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 e778178657 Improve websocket junit test timing behavior.
e778178657 is described below

commit e778178657c763df02f9f2475a53bdbd1df7d47c
Author: Rainer Jung 
AuthorDate: Thu Apr 18 13:28:21 2024 +0200

Improve websocket junit test timing behavior.

Since 11.0.0-M17 soome tests hit the default session close timeout
of 30 seconds at the end of test.

Set a session close timeout of 2 seconds for these tests instead.
---
 test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java   | 6 ++
 .../tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java | 3 +++
 test/org/apache/tomcat/websocket/server/TestSlowClient.java | 3 +++
 .../websocket/server/TestWsRemoteEndpointImplServerDeadlock.java| 3 +++
 4 files changed, 15 insertions(+)

diff --git a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java 
b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
index a720dcd6ca..d8d5d672cb 100644
--- a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
+++ b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
@@ -58,6 +58,9 @@ public class TestWebSocketFrameClientSSL extends 
WebSocketBaseTest {
 
clientEndpointConfig.getUserProperties().put(Constants.SSL_TRUSTSTORE_PROPERTY, 
TesterSupport.CA_JKS);
 Session wsSession = 
wsContainer.connectToServer(TesterProgrammaticEndpoint.class, 
clientEndpointConfig,
 new URI("wss://localhost:" + getPort() + 
TesterFirehoseServer.PATH));
+// Set a short session close timeout (milliseconds)
+wsSession.getUserProperties().put(
+
org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, 
Long.valueOf(2000));
 CountDownLatch latch = new 
CountDownLatch(TesterFirehoseServer.MESSAGE_COUNT);
 BasicText handler = new BasicText(latch);
 wsSession.addMessageHandler(handler);
@@ -130,6 +133,9 @@ public class TestWebSocketFrameClientSSL extends 
WebSocketBaseTest {
 Assert.fail("There are [" + openConnectionCount + "] connections 
still open");
 }
 
+// Set a short session close timeout (milliseconds)
+wsSession.getUserProperties().put(
+
org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, 
Long.valueOf(2000));
 // Close the client session.
 wsSession.close();
 }
diff --git 
a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java 
b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java
index ba41b82383..8d414fe33d 100644
--- 
a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java
+++ 
b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java
@@ -100,6 +100,9 @@ public class TestWsWebSocketContainerTimeoutServer extends 
WsWebSocketContainerB
 loops++;
 }
 
+// Set a short session close timeout (milliseconds)
+wsSession.getUserProperties().put(
+
org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, 
Long.valueOf(2000));
 // Close the client session, primarily to allow the
 // BackgroundProcessManager to shut down.
 wsSession.close();
diff --git a/test/org/apache/tomcat/websocket/server/TestSlowClient.java 
b/test/org/apache/tomcat/websocket/server/TestSlowClient.java
index 3a2afad1df..5460d4fc78 100644
--- a/test/org/apache/tomcat/websocket/server/TestSlowClient.java
+++ b/test/org/apache/tomcat/websocket/server/TestSlowClient.java
@@ -70,6 +70,9 @@ public class TestSlowClient extends WebSocketBaseTest {
 count++;
 }
 Assert.assertTrue(wsSession.isOpen());
+// Set a short session close timeout (milliseconds)
+wsSession.getUserProperties().put(
+
org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, 
Long.valueOf(2000));
 wsSession.close();
 
 // BZ 64848 (non-container thread variant)
diff --git 
a/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java
 
b/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java
index 7af3bcc12a..1f35ec0be3 100644
--- 
a/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java
+++ 
b/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java
@@ -124,6 +124,9 @@ public class TestWsRemoteEndpointImplServerDeadlock extends 
WebSocketBaseTest {
 // Server buffers are full. Server cannot send any more messages.
 // Server is now blocked waiting for the client to read the messages.
 
+// Set a short sessi

(tomcat) branch 10.1.x updated: Improve websocket junit test timing behavior.

2024-04-18 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 8ec7ce32e4 Improve websocket junit test timing behavior.
8ec7ce32e4 is described below

commit 8ec7ce32e4b51b2c52012bb2e26baec3b842ee59
Author: Rainer Jung 
AuthorDate: Thu Apr 18 13:28:21 2024 +0200

Improve websocket junit test timing behavior.

Since 11.0.0-M17 soome tests hit the default session close timeout
of 30 seconds at the end of test.

Set a session close timeout of 2 seconds for these tests instead.
---
 test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java   | 6 ++
 .../tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java | 3 +++
 test/org/apache/tomcat/websocket/server/TestSlowClient.java | 3 +++
 .../websocket/server/TestWsRemoteEndpointImplServerDeadlock.java| 3 +++
 4 files changed, 15 insertions(+)

diff --git a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java 
b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
index 0853d1397c..0447e3a549 100644
--- a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
+++ b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
@@ -142,6 +142,9 @@ public class TestWebSocketFrameClientSSL extends 
WebSocketBaseTest {
 
 Session wsSession = 
wsContainer.connectToServer(TesterProgrammaticEndpoint.class, 
clientEndpointConfig,
 new URI("wss://localhost:" + getPort() + 
TesterFirehoseServer.PATH));
+// Set a short session close timeout (milliseconds)
+wsSession.getUserProperties().put(
+
org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, 
Long.valueOf(2000));
 CountDownLatch latch = new 
CountDownLatch(TesterFirehoseServer.MESSAGE_COUNT);
 BasicText handler = new BasicText(latch);
 wsSession.addMessageHandler(handler);
@@ -282,6 +285,9 @@ public class TestWebSocketFrameClientSSL extends 
WebSocketBaseTest {
 Assert.fail("There are [" + openConnectionCount + "] connections 
still open");
 }
 
+// Set a short session close timeout (milliseconds)
+wsSession.getUserProperties().put(
+
org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, 
Long.valueOf(2000));
 // Close the client session.
 wsSession.close();
 }
diff --git 
a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java 
b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java
index b3b31b699c..613fadde8c 100644
--- 
a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java
+++ 
b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java
@@ -100,6 +100,9 @@ public class TestWsWebSocketContainerTimeoutServer extends 
WsWebSocketContainerB
 loops++;
 }
 
+// Set a short session close timeout (milliseconds)
+wsSession.getUserProperties().put(
+
org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, 
Long.valueOf(2000));
 // Close the client session, primarily to allow the
 // BackgroundProcessManager to shut down.
 wsSession.close();
diff --git a/test/org/apache/tomcat/websocket/server/TestSlowClient.java 
b/test/org/apache/tomcat/websocket/server/TestSlowClient.java
index 411c395045..a9203609f5 100644
--- a/test/org/apache/tomcat/websocket/server/TestSlowClient.java
+++ b/test/org/apache/tomcat/websocket/server/TestSlowClient.java
@@ -70,6 +70,9 @@ public class TestSlowClient extends WebSocketBaseTest {
 count++;
 }
 Assert.assertTrue(wsSession.isOpen());
+// Set a short session close timeout (milliseconds)
+wsSession.getUserProperties().put(
+
org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, 
Long.valueOf(2000));
 wsSession.close();
 
 // BZ 64848 (non-container thread variant)
diff --git 
a/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java
 
b/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java
index 7959daa38c..86adf1ac1d 100644
--- 
a/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java
+++ 
b/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java
@@ -124,6 +124,9 @@ public class TestWsRemoteEndpointImplServerDeadlock extends 
WebSocketBaseTest {
 // Server buffers are full. Server cannot send any more messages.
 // Server is now blocked waiting for the client to read the messages.
 
+// Set a short session close timeout (milliseconds)
+s

(tomcat) branch main updated: Improve websocket junit test timing behavior.

2024-04-18 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 9c8c87eba5 Improve websocket junit test timing behavior.
9c8c87eba5 is described below

commit 9c8c87eba5001bb6e220fabf68a6b9edae03ee91
Author: Rainer Jung 
AuthorDate: Thu Apr 18 13:28:21 2024 +0200

Improve websocket junit test timing behavior.

Since 11.0.0-M17 soome tests hit the default session close timeout
of 30 seconds at the end of test.

Set a session close timeout of 2 seconds for these tests instead.
---
 test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java   | 6 ++
 .../tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java | 3 +++
 test/org/apache/tomcat/websocket/server/TestSlowClient.java | 3 +++
 .../websocket/server/TestWsRemoteEndpointImplServerDeadlock.java| 3 +++
 4 files changed, 15 insertions(+)

diff --git a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java 
b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
index b8b661bed7..5abcb73a2a 100644
--- a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
+++ b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
@@ -105,6 +105,9 @@ public class TestWebSocketFrameClientSSL extends 
WebSocketBaseTest {
 
 Session wsSession = 
wsContainer.connectToServer(TesterProgrammaticEndpoint.class, 
clientEndpointConfig,
 new URI("wss://localhost:" + getPort() + 
TesterFirehoseServer.PATH));
+// Set a short session close timeout (milliseconds)
+wsSession.getUserProperties().put(
+
org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, 
Long.valueOf(2000));
 CountDownLatch latch = new 
CountDownLatch(TesterFirehoseServer.MESSAGE_COUNT);
 BasicText handler = new BasicText(latch);
 wsSession.addMessageHandler(handler);
@@ -188,6 +191,9 @@ public class TestWebSocketFrameClientSSL extends 
WebSocketBaseTest {
 Assert.fail("There are [" + openConnectionCount + "] connections 
still open");
 }
 
+// Set a short session close timeout (milliseconds)
+wsSession.getUserProperties().put(
+
org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, 
Long.valueOf(2000));
 // Close the client session.
 wsSession.close();
 }
diff --git 
a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java 
b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java
index b3b31b699c..613fadde8c 100644
--- 
a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java
+++ 
b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java
@@ -100,6 +100,9 @@ public class TestWsWebSocketContainerTimeoutServer extends 
WsWebSocketContainerB
 loops++;
 }
 
+// Set a short session close timeout (milliseconds)
+wsSession.getUserProperties().put(
+
org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, 
Long.valueOf(2000));
 // Close the client session, primarily to allow the
 // BackgroundProcessManager to shut down.
 wsSession.close();
diff --git a/test/org/apache/tomcat/websocket/server/TestSlowClient.java 
b/test/org/apache/tomcat/websocket/server/TestSlowClient.java
index 411c395045..a9203609f5 100644
--- a/test/org/apache/tomcat/websocket/server/TestSlowClient.java
+++ b/test/org/apache/tomcat/websocket/server/TestSlowClient.java
@@ -70,6 +70,9 @@ public class TestSlowClient extends WebSocketBaseTest {
 count++;
 }
 Assert.assertTrue(wsSession.isOpen());
+// Set a short session close timeout (milliseconds)
+wsSession.getUserProperties().put(
+
org.apache.tomcat.websocket.Constants.SESSION_CLOSE_TIMEOUT_PROPERTY, 
Long.valueOf(2000));
 wsSession.close();
 
 // BZ 64848 (non-container thread variant)
diff --git 
a/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java
 
b/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java
index 7959daa38c..86adf1ac1d 100644
--- 
a/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java
+++ 
b/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java
@@ -124,6 +124,9 @@ public class TestWsRemoteEndpointImplServerDeadlock extends 
WebSocketBaseTest {
 // Server buffers are full. Server cannot send any more messages.
 // Server is now blocked waiting for the client to read the messages.
 
+// Set a short session close timeout (milliseconds)
+session.getUserProperties().put(
+
org.apache.tomcat.websocket.Constants.

(tomcat-connectors) branch main updated: BZ 68117: Fix typo and escaping in libtool flag introduced in 1.2.49.

2023-11-10 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new ecd005d07 BZ 68117: Fix typo and escaping in libtool flag introduced 
in 1.2.49.
ecd005d07 is described below

commit ecd005d0792441c4510dc4c2d9348979ab71ddcc
Author: Rainer Jung 
AuthorDate: Fri Nov 10 11:38:04 2023 +0100

BZ 68117: Fix typo and escaping in libtool flag introduced in 1.2.49.
---
 native/apache-2.0/Makefile.apxs.in | 2 +-
 native/apache-2.0/Makefile.in  | 2 +-
 xdocs/miscellaneous/changelog.xml  | 9 +
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/native/apache-2.0/Makefile.apxs.in 
b/native/apache-2.0/Makefile.apxs.in
index 36aeada1c..161616502 100644
--- a/native/apache-2.0/Makefile.apxs.in
+++ b/native/apache-2.0/Makefile.apxs.in
@@ -21,7 +21,7 @@ top_builddir=@top_builddir@
 APXS=@APXS@
 APXSCFLAGS=@APXSCFLAGS@
 APXSLDFLAGS=@APXSLDFLAGS@
-JKLDFLAGS=-export-symbols-regex ^jk_module$
+JKLDFLAGS=-export-symbols-regex ^jk_module\$$
 
 COMMON=common
 JK_INCL=-DUSE_APACHE_MD5 -I${top_builddir}/${COMMON} -I ${top_srcdir}/${COMMON}
diff --git a/native/apache-2.0/Makefile.in b/native/apache-2.0/Makefile.in
index e63f5c921..a9327743b 100644
--- a/native/apache-2.0/Makefile.in
+++ b/native/apache-2.0/Makefile.in
@@ -23,7 +23,7 @@ MKDIR=@MKDIR@
 APXSCFLAGS=@APXSCFLAGS@
 APXSCPPFLAGS=@APXSCPPFLAGS@
 APXSLDFLAGS=@APXSLDFLAGS@
-JKLDFLAGS=-export-symbols-regexp ^jk_module$
+JKLDFLAGS=-export-symbols-regex ^jk_module\$$
 
 CC=@CC@
 SHELL=@SHELL@
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index 1bcaa5f51..932d768c5 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -51,6 +51,15 @@
   
 
 
+  
+
+  
+68117: Fix typo in new libtool flag introduced in 1.2.49
+to reduce symbol visibility. Also improve escaping of it in the 
Makefile.
+Patch provided by lzs...@freemail.c3.hu. (rjung)
+  
+
+  
 
 
   


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



[tomcat-connectors] branch main updated: Restructure subsections in changelog starting with version 1.2.45.

2023-09-05 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 369da3135 Restructure subsections in changelog starting with version 
1.2.45.
369da3135 is described below

commit 369da31352f63453fb762d30a3cd468ddf9c1125
Author: Rainer Jung 
AuthorDate: Tue Sep 5 13:38:28 2023 +0200

Restructure subsections in changelog starting with version 1.2.45.
---
 xdocs/miscellaneous/changelog.xml | 212 +++---
 1 file changed, 127 insertions(+), 85 deletions(-)

diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index aacd14605..a99f7b050 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -31,6 +31,16 @@
   
 
 
+
 
 
   
@@ -41,107 +51,131 @@
   
 
 
-  
-
-  Common: Fix compiler warning when initializing and copying fixed length
-  strings. (rjung)
-
-
-  IIS: Set default request id as a GUID.
-  It can also be taken from an arbitrary request
-  header by configuring "request_id_header". (rjung)
-
-
-  Apache: Retrieve default request id from mod_unique_id.
-  It can also be taken from an arbitrary environment
-  variable by configuring "JkRequestIdIndicator". (rjung)
-
-
-  Common: Add a request id to mod_jk log lines. (rjung)
-
-
-  IIS: Fix non-empty check for the Translate header. (rjung)
-
-
-  Remove support for the Netscape / Sun ONE / Oracle iPlanet Web Server as
-  the product has been retired. (markt)
-
-
-  Remove links to the old JK2 documentation. The JK2 documentation is still
-  available, it is just no longer linked from the current JK documentation.
-  (markt)
-
-
-  64878: Common: Enable configure to find the correct sizes for
-  pid_t and pthread_t when building on MacOS. (markt)
-
-
-  Common: Fix Clang 15/16 compatability. Pull request 6 provided 
by
-  Sam James. (markt)
-
-
-  Apache: 65901: Don't delegate the generatation of the response
-  body to httpd when the status code represents an error if the request 
used
-  the HEAD method. (markt)
-
-
-  Apache: 66005: Only export the main module symbol. Visibility
-  of module internal symbols led to crashes when conflicting with library
-  symbols. Based on a patch provided by Josef ÄŒejka. (rjung)
-
-
-  Status: Improve XSS hardening. (rjung)
-
-  
+  
+
+  
+Retrieve default request id from mod_unique_id.
+It can also be taken from an arbitrary environment
+variable by configuring "JkRequestIdIndicator". (rjung)
+  
+  
+65901: Don't delegate the generatation of the response
+body to httpd when the status code represents an error if the request 
used
+the HEAD method. (markt)
+  
+  
+66005: Only export the main module symbol. Visibility
+of module internal symbols led to crashes when conflicting with library
+symbols. Based on a patch provided by Josef ÄŒejka. (rjung)
+  
+
+  
+  
+
+  
+Set default request id as a GUID.
+It can also be taken from an arbitrary request
+header by configuring "request_id_header". (rjung)
+  
+  
+    Fix non-empty check for the Translate header. (rjung)
+  
+
+  
+  
+
+  
+Fix compiler warning when initializing and copying fixed length
+strings. (rjung)
+  
+  
+    Add a request id to mod_jk log lines. (rjung)
+  
+  
+64878: Enable configure to find the correct sizes for
+pid_t and pthread_t when building on MacOS. (markt)
+  
+  
+Fix Clang 15/16 compatability. Pull request 6 provided by
+Sam James. (markt)
+  
+  
+    Improve XSS hardening i status worker. (rjung)
+  
+
+  
+  
+
+  
+Remove support for the Netscape / Sun ONE / Oracle iPlanet Web Server 
as
+the product has been retired. (markt)
+  
+  
+Remove links to the old JK2 documentation. The JK2 documentation is 
still
+available, it is just no longer linked from the current JK 
documentation.
+(markt)
+  
+  
+Restructure subsections in changelog starting with version 1.2.45.
+(rjung)
+  
+
+  
 
 
-  
-
-  IIS: Update the installation how-to to remove windows versions that are 
no
-  longer supported and to add Windows Server 2019. (markt)
-
-  
+  
+
+  
+Update the installation how-to to remove windows versions that are no
+longer supported and to add Windows Server 2019. (markt)
+  
+
+  
 
 
-  
+  
 

[tomcat-connectors] branch main updated: Status: Improve XSS hardening. (rjung)

2023-09-05 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 5a6e393f5 Status: Improve XSS hardening. (rjung)
 new 1dd2857a3 Merge branch 'main' of 
https://github.com/apache/tomcat-connectors
5a6e393f5 is described below

commit 5a6e393f5163e1ab23445ecf1ad8ee2e05c964eb
Author: Rainer Jung 
AuthorDate: Tue Sep 5 13:18:34 2023 +0200

Status: Improve XSS hardening. (rjung)
---
 native/common/jk_status.c | 47 ++-
 xdocs/miscellaneous/changelog.xml |  3 +++
 2 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/native/common/jk_status.c b/native/common/jk_status.c
index 4b7dd66cc..f4c23c77e 100644
--- a/native/common/jk_status.c
+++ b/native/common/jk_status.c
@@ -424,6 +424,7 @@ struct status_endpoint
 {
 status_worker_t *worker;
 
+char*req_uri;
 char*query_string;
 jk_map_t*req_params;
 char*msg;
@@ -1136,7 +1137,7 @@ static void status_start_form(jk_ws_service_t *s,
 jk_map_t *m = p->req_params;
 
 if (method)
-jk_printf(s, l, JK_STATUS_FORM_START, method, s->req_uri);
+jk_printf(s, l, JK_STATUS_FORM_START, method, p->req_uri);
 else
 return;
 if (cmd != JK_STATUS_CMD_UNKNOWN) {
@@ -1179,7 +1180,7 @@ static void status_write_uri(jk_ws_service_t *s,
 
 if (text)
 jk_puts(s, "req_uri);
+jk_puts(s, p->req_uri);
 status_get_string(p, JK_STATUS_ARG_FROM, NULL, &arg, l);
 from = status_cmd_int(arg);
 status_get_string(p, JK_STATUS_ARG_CMD, NULL, &arg, l);
@@ -1290,6 +1291,32 @@ static void status_write_uri(jk_ws_service_t *s,
 jk_putv(s, "\">", text, "", NULL);
 }
 
+static int status_unescape_uri(jk_ws_service_t *s,
+   status_endpoint_t *p,
+   jk_log_context_t *l)
+{
+status_worker_t *w = p->worker;
+char *req_uri;
+
+JK_TRACE_ENTER(l);
+
+req_uri = p->req_uri = jk_pool_strdup(s->pool, s->req_uri);
+/* percent decoding */
+if (jk_unescape_url(req_uri, req_uri, -1, NULL, NULL, 1, NULL) != JK_TRUE) 
{
+jk_log(l, JK_LOG_ERROR,
+   "Status worker '%s' could not decode request uri",
+   w->name);
+JK_TRACE_EXIT(l);
+return JK_FALSE;
+}
+/* XXX We simply mask special chars in the request uri with '@' to prevent 
cross site scripting */
+while ((req_uri = strpbrk(req_uri, JK_STATUS_ESC_CHARS)))
+req_uri[0] = '@';
+
+JK_TRACE_EXIT(l);
+return JK_TRUE;
+}
+
 static int status_parse_uri(jk_ws_service_t *s,
 status_endpoint_t *p,
 jk_log_context_t *l)
@@ -4777,6 +4804,14 @@ static int JK_METHOD service(jk_endpoint_t *e,
 }
 }
 
+/* Step 0: Unescape request uri and make safe against XSS */
+if (status_unescape_uri(s, p, l) != JK_TRUE) {
+if (is_error)
+*is_error = JK_HTTP_SERVER_ERROR;
+JK_TRACE_EXIT(l);
+return JK_FALSE;
+}
+
 /* Step 1: Process GET params and update configuration */
 if (status_parse_uri(s, p, l) != JK_TRUE) {
 err = "Error during parsing of URI";
@@ -5011,7 +5046,7 @@ static int JK_METHOD service(jk_endpoint_t *e,
 if (cmd_props & JK_STATUS_CMD_PROP_REFRESH &&
 refresh > 0) {
 jk_printf(s, l, "\n",
-  refresh, s->req_uri, p->query_string);
+  refresh, p->req_uri, p->query_string);
 }
 if (w->css) {
 jk_putv(s, "\nreq_uri, NULL);
+jk_putv(s, "[req_uri, NULL);
 if (buf && buf[0])
 jk_putv(s, "?", buf, NULL);
 jk_puts(s, "\">Stop auto refresh]");
@@ -5189,7 +5224,7 @@ static int JK_METHOD service(jk_endpoint_t *e,
 jk_log(l, JK_LOG_WARNING, "Status worker '%s': %s", w->name, err);
 if (mime == JK_STATUS_MIME_HTML) {
 jk_putv(s, "Result: ERROR - ", err, "", NULL);
-jk_putv(s, "req_uri, "\">JK Status Manager Start 
Page", NULL);
+jk_putv(s, "req_uri, "\">JK Status Manager Start 
Page", NULL);
 }
 else if (mime == JK_STATUS_MIME_XML) {
 jk_print_xml_start_elt(s, l, w, 2, 0, "result");
@@ -5210,7 +5245,7 @@ static int JK_METHOD service(jk_endpoint_t *e,
 }
 else {
 if (mime == JK_

[tomcat-connectors] branch main updated: Apache: Only export the main module symbol.

2023-09-05 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new eda74b19e Apache: Only export the main module symbol.
eda74b19e is described below

commit eda74b19e4800e3ed8bb3351d8995d1b3eb44a4d
Author: Rainer Jung 
AuthorDate: Tue Sep 5 12:12:42 2023 +0200

Apache: Only export the main module symbol.

Visibility of module internal symbols led to crashes when
conflicting with library symbols.

Based on a patch provided by Josef ÄŒejka. (rjung)

Fixes BZ 66005.
---
 native/apache-2.0/Makefile.apxs.in | 5 +++--
 native/apache-2.0/Makefile.in  | 4 +++-
 xdocs/miscellaneous/changelog.xml  | 5 +
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/native/apache-2.0/Makefile.apxs.in 
b/native/apache-2.0/Makefile.apxs.in
index 907c82874..36aeada1c 100644
--- a/native/apache-2.0/Makefile.apxs.in
+++ b/native/apache-2.0/Makefile.apxs.in
@@ -19,8 +19,9 @@ srcdir=@srcdir@
 top_srcdir=@top_srcdir@
 top_builddir=@top_builddir@
 APXS=@APXS@
-APXSLDFLAGS=@APXSLDFLAGS@
 APXSCFLAGS=@APXSCFLAGS@
+APXSLDFLAGS=@APXSLDFLAGS@
+JKLDFLAGS=-export-symbols-regex ^jk_module$
 
 COMMON=common
 JK_INCL=-DUSE_APACHE_MD5 -I${top_builddir}/${COMMON} -I ${top_srcdir}/${COMMON}
@@ -32,7 +33,7 @@ include @top_builddir@/common/list.mk
 all: mod_jk.la
 
 mod_jk.la:
-   $(APXS) -c -o $@ -Wc,"${APXSCFLAGS} ${JK_INCL}" ${APXSLDFLAGS} 
${srcdir}/mod_jk.c ${APACHE_OBJECTS}
+   $(APXS) -c -o $@ -Wc,"${APXSCFLAGS} ${JK_INCL}" ${APXSLDFLAGS} 
${JKLDFLAGS} ${srcdir}/mod_jk.c ${APACHE_OBJECTS}
 
 install: mod_jk.la
$(APXS) -i mod_jk.la
diff --git a/native/apache-2.0/Makefile.in b/native/apache-2.0/Makefile.in
index d5fab1bde..e63f5c921 100644
--- a/native/apache-2.0/Makefile.in
+++ b/native/apache-2.0/Makefile.in
@@ -23,6 +23,8 @@ MKDIR=@MKDIR@
 APXSCFLAGS=@APXSCFLAGS@
 APXSCPPFLAGS=@APXSCPPFLAGS@
 APXSLDFLAGS=@APXSLDFLAGS@
+JKLDFLAGS=-export-symbols-regexp ^jk_module$
+
 CC=@CC@
 SHELL=@SHELL@
 
@@ -80,7 +82,7 @@ mod_jk.lo: ${srcdir}/mod_jk.c
${LT_COMPILE}
 
 mod_jk.la: mod_jk.lo $(APACHE_OBJECTS)
-   $(LIBTOOL) --mode=link ${COMPILE} $(APXSLDFLAGS) -o $@ -module -rpath 
${libexecdir} -avoid-version mod_jk.lo $(APACHE_OBJECTS)
+   $(LIBTOOL) --mode=link ${COMPILE} $(APXSLDFLAGS) ${JKLDFLAGS} -o $@ 
-module -rpath ${libexecdir} -avoid-version mod_jk.lo $(APACHE_OBJECTS)
 
 mod_jk.so: mod_jk.la
${top_srcdir}/scripts/build/instdso.sh SH_LIBTOOL='$(LIBTOOL)' 
mod_jk.la `pwd`
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index 4d103383d..86a637ed8 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -84,6 +84,11 @@
   body to httpd when the status code represents an error if the request 
used
   the HEAD method. (markt)
 
+
+  Apache: 66005: Only export the main module symbol. Visibility
+  of module internal symbols led to crashes when conflicting with library
+  symbols. Based on a patch provided by Josef ÄŒejka. (rjung)
+
   
 
 


-
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 type in changelog rtext for TC 8.5.93

2023-08-24 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 ff62d0f0aa Fix type in changelog rtext for TC 8.5.93
ff62d0f0aa is described below

commit ff62d0f0aa37e20481470f75b978272957c89316
Author: Rainer Jung 
AuthorDate: Thu Aug 24 11:43:13 2023 +0200

Fix type in changelog rtext for TC 8.5.93
---
 webapps/docs/changelog.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 267070e325..472714636f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -106,7 +106,7 @@
 -->
 
 
-
+
   
 
   


-
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 type in changelog rtext for TC 9.0.80

2023-08-24 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 4c72584546 Fix type in changelog rtext for TC 9.0.80
4c72584546 is described below

commit 4c72584546638fd8c0f8d0869cb7849d18057102
Author: Rainer Jung 
AuthorDate: Thu Aug 24 11:42:52 2023 +0200

Fix type in changelog rtext for TC 9.0.80
---
 webapps/docs/changelog.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index ab70a809c5..200b0588c1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -106,7 +106,7 @@
 -->
 
 
-
+
   
 
   


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



[tomcat] branch main updated: Fix changelog rtext for old TC 11.0.0-M7

2023-08-24 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 77a41c0bb3 Fix changelog rtext for old TC 11.0.0-M7
77a41c0bb3 is described below

commit 77a41c0bb30fc62c575f15b19bd8479afabfe04f
Author: Rainer Jung 
AuthorDate: Thu Aug 24 11:41:55 2023 +0200

Fix changelog rtext for old TC 11.0.0-M7
---
 webapps/docs/changelog.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 7ab281bafe..33036ef6f4 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -423,7 +423,7 @@
 
   
 
-
+
   
 
   


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



[tomcat-connectors] branch main updated: Fix comment describing function behavior

2023-08-12 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 2e95f74b2 Fix comment describing function behavior
2e95f74b2 is described below

commit 2e95f74b2224d677945a94ca8ba4fe488a3da9c1
Author: Rainer Jung 
AuthorDate: Sat Aug 12 19:29:54 2023 +0200

Fix comment describing function behavior
---
 native/common/jk_url.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/native/common/jk_url.c b/native/common/jk_url.c
index 9d4e1a586..bc0680f7b 100644
--- a/native/common/jk_url.c
+++ b/native/common/jk_url.c
@@ -169,9 +169,9 @@ static char x2c(const char *what)
  * @param plus If non zero, '+' is converted to ' ' as per
  * application/x-www-form-urlencoded encoding
  * @param len If set, the length of the unescaped string will be returned
- * @return JK_TRUE on success, JK_FALSE if no characters are
- * decoded or the string is NULL, if a bad escape sequence is
- * found, or if a character on the forbid list is found.
+ * @return JK_TRUE on success, JK_FALSE if the string is NULL,
+ * if a bad escape sequence is found, or if a character on the
+ * forbid list is found.
  * Implementation copied from APR 1.5.x.
  */
 int jk_unescape_url(char *const unescaped,


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



[tomcat-connectors] branch main updated: Fix typo in changelog

2023-08-12 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new cae5513f2 Fix typo in changelog
cae5513f2 is described below

commit cae5513f2cb38ec459290374d1451ba7c478baf6
Author: Rainer Jung 
AuthorDate: Sat Aug 12 13:57:07 2023 +0200

Fix typo in changelog
---
 xdocs/miscellaneous/changelog.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index a0cd126f9..98a401e6d 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -43,7 +43,7 @@
 
   
 
-  Common: Fix compiler warning when nitializing and copying fixed length
+  Common: Fix compiler warning when initializing and copying fixed length
   strings. (rjung)
 
 


-
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 jsign version number

2023-07-04 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 eb3beee476 Fix jsign version number
eb3beee476 is described below

commit eb3beee476d9f7dd60b37ffb50bc1961f686cb7c
Author: Rainer Jung 
AuthorDate: Tue Jul 4 12:04:44 2023 +0200

Fix jsign version number
---
 build.properties.default | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.properties.default b/build.properties.default
index 929dad74aa..672be22f80 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -307,7 +307,7 @@ spotbugs.jar=${spotbugs.home}/lib/spotbugs-ant.jar
 
spotbugs.loc=${base-maven.loc}/com/github/spotbugs/spotbugs/${spotbugs.version}/spotbugs-${spotbugs.version}.tgz
 
 # - JSign, version 4.1 or later -
-jsign.version=4.2
+jsign.version=5.0
 
 # checksums for JSign 5.0
 jsign.checksum.enabled=true


-
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 jsign version number

2023-07-04 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 250a8e0491 Fix jsign version number
250a8e0491 is described below

commit 250a8e0491e432a462519124997ba7a48af90751
Author: Rainer Jung 
AuthorDate: Tue Jul 4 12:03:59 2023 +0200

Fix jsign version number
---
 build.properties.default | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.properties.default b/build.properties.default
index d01a9c0377..413163eaf8 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -316,7 +316,7 @@ bnd.jar=${bnd.home}/biz.aQute.bnd-${bnd.version}.jar
 
bnd.loc=${base-maven.loc}/biz/aQute/bnd/biz.aQute.bnd/${bnd.version}/biz.aQute.bnd-${bnd.version}.jar
 
 # - JSign, version 4.1 or later -
-jsign.version=4.2
+jsign.version=5.0
 
 # checksums for JSign 5.0
 jsign.checksum.enabled=true


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



[tomcat] branch main updated: Fix jsign version number

2023-07-04 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 b7c1d9e343 Fix jsign version number
b7c1d9e343 is described below

commit b7c1d9e343e78b388b27ed7977f2a4ad3c266c07
Author: Rainer Jung 
AuthorDate: Tue Jul 4 12:01:29 2023 +0200

Fix jsign version number
---
 build.properties.default | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.properties.default b/build.properties.default
index a266768ed3..d7704a2349 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -317,7 +317,7 @@ 
openssl-lib.jar=${openssl-lib.home}/tomcat-coyote-openssl-java17-${openssl-lib.v
 
openssl-lib.loc=${base-maven.loc}/org/apache/tomcat/tomcat-coyote-openssl-java17/${openssl-lib.version}/tomcat-coyote-openssl-java17-${openssl-lib.version}.jar
 
 # - JSign, version 4.1 or later -
-jsign.version=4.2
+jsign.version=5.0
 
 # checksums for JSign 5.0
 jsign.checksum.enabled=true


-
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 jsign version number

2023-07-04 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 1fc525a931 Fix jsign version number
1fc525a931 is described below

commit 1fc525a9317be3f36218f276e69291220a310578
Author: Rainer Jung 
AuthorDate: Tue Jul 4 12:03:20 2023 +0200

Fix jsign version number
---
 build.properties.default | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.properties.default b/build.properties.default
index b969fe066a..e03fb7a009 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -338,7 +338,7 @@ 
openssl-lib.jar=${openssl-lib.home}/tomcat-coyote-openssl-java17-${openssl-lib.v
 
openssl-lib.loc=${base-maven.loc}/org/apache/tomcat/tomcat-coyote-openssl-java17/${openssl-lib.version}/tomcat-coyote-openssl-java17-${openssl-lib.version}.jar
 
 # - JSign, version 4.1 or later -
-jsign.version=4.2
+jsign.version=5.0
 
 # checksums for JSign 5.0
 jsign.checksum.enabled=true


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



[tomcat-native] branch main updated: Remove unused and probably obsolete custom help macro

2023-06-18 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 05919e18e Remove unused and probably obsolete custom help macro
05919e18e is described below

commit 05919e18e67ab37637f4bb57f0d1f01d68b7807f
Author: Rainer Jung 
AuthorDate: Sun Jun 18 14:54:47 2023 +0200

Remove unused and probably obsolete custom help macro
---
 native/build/tcnative.m4 | 8 
 1 file changed, 8 deletions(-)

diff --git a/native/build/tcnative.m4 b/native/build/tcnative.m4
index 15781212d..272eac47f 100644
--- a/native/build/tcnative.m4
+++ b/native/build/tcnative.m4
@@ -141,14 +141,6 @@ AC_DEFUN([TCN_FIND_JDK_OS],[
   ])
 ])
 
-dnl TCN_HELP_STRING(LHS, RHS)
-dnl Autoconf 2.50 can not handle substr correctly.  It does have
-dnl AS_HELP_STRING, so let's try to call it if we can.
-dnl Note: this define must be on one line so that it can be properly returned
-dnl as the help string.
-dnl TODO: Check whether this is still needed for autoconf 2.68. 
-AC_DEFUN([TCN_HELP_STRING],[ifelse(regexp(AC_ACVERSION, 2\.1), -1, 
AS_HELP_STRING($1,$2),[  ]$1 substr([   ],len($1))$2)])dnl
-
 dnl
 dnl TCN_FIND_SSL_TOOLKIT
 dnl


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



[tomcat-native] branch main updated: Make name and version info consistent with recent changes

2023-06-18 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 1b902ad7a Make name and version info consistent with recent changes
1b902ad7a is described below

commit 1b902ad7aa9e893ea3acaf999ac3b0563ab95520
Author: Rainer Jung 
AuthorDate: Sun Jun 18 14:01:34 2023 +0200

Make name and version info consistent with recent changes
---
 native/configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/native/configure.ac b/native/configure.ac
index e082ae6d2..45b815073 100644
--- a/native/configure.ac
+++ b/native/configure.ac
@@ -19,8 +19,8 @@ dnl
 dnl Process this file with autoconf to produce a configure script
 dnl
 
-AC_PREREQ(2.50)
-AC_INIT(configure.in)
+AC_PREREQ(2.68)
+AC_INIT(configure.ac)
 
 AC_CONFIG_AUX_DIR(build)
 


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



[tomcat-native] branch main updated: Add a comment about a probably no longer needed autoconf workaround

2023-06-18 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new cd52d6be3 Add a comment about a probably no longer needed autoconf 
workaround
cd52d6be3 is described below

commit cd52d6be356b9a4cc546c356e3d7206358b44f57
Author: Rainer Jung 
AuthorDate: Sun Jun 18 14:00:55 2023 +0200

Add a comment about a probably no longer needed autoconf workaround
---
 native/build/tcnative.m4 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/native/build/tcnative.m4 b/native/build/tcnative.m4
index 454bc8100..15781212d 100644
--- a/native/build/tcnative.m4
+++ b/native/build/tcnative.m4
@@ -146,6 +146,7 @@ dnl Autoconf 2.50 can not handle substr correctly.  It does 
have
 dnl AS_HELP_STRING, so let's try to call it if we can.
 dnl Note: this define must be on one line so that it can be properly returned
 dnl as the help string.
+dnl TODO: Check whether this is still needed for autoconf 2.68. 
 AC_DEFUN([TCN_HELP_STRING],[ifelse(regexp(AC_ACVERSION, 2\.1), -1, 
AS_HELP_STRING($1,$2),[  ]$1 substr([   ],len($1))$2)])dnl
 
 dnl


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



[tomcat-native] branch main updated: Rename configure.in to modern autotools style configure.ac.

2023-06-18 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 70927e0f3 Rename configure.in to modern autotools style configure.ac.
70927e0f3 is described below

commit 70927e0f336f282ca931f7e7d355e36521b2edfd
Author: Rainer Jung 
AuthorDate: Sun Jun 18 13:57:57 2023 +0200

Rename configure.in to modern autotools style configure.ac.
---
 native/{configure.in => configure.ac} | 0
 xdocs/miscellaneous/changelog.xml | 3 +++
 2 files changed, 3 insertions(+)

diff --git a/native/configure.in b/native/configure.ac
similarity index 100%
rename from native/configure.in
rename to native/configure.ac
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index 5993fd906..918615532 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -33,6 +33,9 @@
 
 
   
+
+  Rename configure.in to modern autotools style configure.ac. (rjung)
+
 
   Fix incomplete updates for autotools generated files during "buildconf" 
execution. (rjung)
 


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



[tomcat-native] branch main updated: Fix incomplete updates for autotools generated files during "buildconf" execution.

2023-06-18 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 12b5e50e3 Fix incomplete updates for autotools generated files during 
"buildconf" execution.
12b5e50e3 is described below

commit 12b5e50e379a633fd87be677e24962a9dc825f6b
Author: Rainer Jung 
AuthorDate: Sun Jun 18 13:55:54 2023 +0200

Fix incomplete updates for autotools generated files during "buildconf" 
execution.
---
 native/buildconf  | 2 +-
 xdocs/miscellaneous/changelog.xml | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/native/buildconf b/native/buildconf
index ef4fd4998..ce2a75db6 100755
--- a/native/buildconf
+++ b/native/buildconf
@@ -70,7 +70,7 @@ rm -rf aclocal.m4 autom4te*.cache
 
 echo "Creating configure ..."
 ### do some work to toss config.cache?
-${AUTOCONF:-autoconf}
+${AUTORECONF:-autoreconf} --install --force
 if [ $? -gt 0 ]; then
   echo "autoconf failed"
   exit 1
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index 353ffdfe0..5993fd906 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -33,6 +33,9 @@
 
 
   
+
+  Fix incomplete updates for autotools generated files during "buildconf" 
execution. (rjung)
+    
 
   Improve quoting in tcnative.m4. (rjung)
 


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



[tomcat-native] branch main updated: Improve quoting in tcnative.m4.

2023-06-18 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 90576c5b0 Improve quoting in tcnative.m4.
90576c5b0 is described below

commit 90576c5b099f48583a95b30893123487d5a7fb45
Author: Rainer Jung 
AuthorDate: Sun Jun 18 13:54:02 2023 +0200

Improve quoting in tcnative.m4.
---
 native/build/tcnative.m4  | 6 +++---
 xdocs/miscellaneous/changelog.xml | 3 +++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/native/build/tcnative.m4 b/native/build/tcnative.m4
index 3b80fb2c5..454bc8100 100644
--- a/native/build/tcnative.m4
+++ b/native/build/tcnative.m4
@@ -18,7 +18,7 @@
 dnl
 dnl TCN_FIND_APR: figure out where APR is located
 dnl
-AC_DEFUN(TCN_FIND_APR,[
+AC_DEFUN([TCN_FIND_APR],[
 
   dnl use the find_apr.m4 script to locate APR. sets apr_found and apr_config
   APR_FIND_APR(,,1,[1])
@@ -146,7 +146,7 @@ dnl Autoconf 2.50 can not handle substr correctly.  It does 
have
 dnl AS_HELP_STRING, so let's try to call it if we can.
 dnl Note: this define must be on one line so that it can be properly returned
 dnl as the help string.
-AC_DEFUN(TCN_HELP_STRING,[ifelse(regexp(AC_ACVERSION, 2\.1), -1, 
AS_HELP_STRING($1,$2),[  ]$1 substr([   ],len($1))$2)])dnl
+AC_DEFUN([TCN_HELP_STRING],[ifelse(regexp(AC_ACVERSION, 2\.1), -1, 
AS_HELP_STRING($1,$2),[  ]$1 substr([   ],len($1))$2)])dnl
 
 dnl
 dnl TCN_FIND_SSL_TOOLKIT
@@ -261,7 +261,7 @@ int main() {
 dnl
 dnl TCN_FIND_APR_FEATURE: figure out if APR feature is suipported
 dnl
-AC_DEFUN(TCN_FIND_APR_FEATURE,[
+AC_DEFUN([TCN_FIND_APR_FEATURE],[
   saved_cflags="$CFLAGS"
   saved_libs="$LIBS"
   CFLAGS="$CFLAGS $APR_INCLUDES"
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index 74e92d221..353ffdfe0 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -33,6 +33,9 @@
 
 
   
+
+  Improve quoting in tcnative.m4. (rjung)
+
 
   Update the minimum version of autoconf for releasing to 2.68. (rjung)
 


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



[tomcat-native] branch main updated: Update the minimum version of autoconf for releasing to 2.68.

2023-06-18 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 52728c62b Update the minimum version of autoconf for releasing to 2.68.
52728c62b is described below

commit 52728c62ba64a7f42e1e112b3f4f68ee9e1eb065
Author: Rainer Jung 
AuthorDate: Sun Jun 18 13:51:55 2023 +0200

Update the minimum version of autoconf for releasing to 2.68.
---
 native/build/buildcheck.sh| 8 
 xdocs/miscellaneous/changelog.xml | 3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/native/build/buildcheck.sh b/native/build/buildcheck.sh
index d6a1faff4..e9c3a5616 100755
--- a/native/build/buildcheck.sh
+++ b/native/build/buildcheck.sh
@@ -30,18 +30,18 @@ py_version=`$python -c 'import sys; print sys.version' 
2>&1|sed 's/ .*//;q'`
 echo "buildconf: python version $py_version (ok)"
 fi
 
-# autoconf 2.50 or newer
+# autoconf 2.68 or newer
 ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 
's/^[^0-9]*//;s/[a-z]* *$//;q'`
 if test -z "$ac_version"; then
 echo "buildconf: autoconf not found."
-echo "   You need autoconf version 2.50 or newer installed"
+echo "   You need autoconf version 2.68 or newer installed"
 echo "   to build Tomcat Native from SVN."
 exit 1
 fi
 IFS=.; set $ac_version; IFS=' '
-if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then
+if test "$1" = "2" -a "$2" -lt "68" || test "$1" -lt "2"; then
 echo "buildconf: autoconf version $ac_version found."
-echo "   You need autoconf version 2.50 or newer installed"
+echo "   You need autoconf version 2.68 or newer installed"
 echo "   to build Tomcat Native from SVN."
 exit 1
 else
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index 60aefcbb2..74e92d221 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -33,6 +33,9 @@
 
 
   
+
+  Update the minimum version of autoconf for releasing to 2.68. (rjung)
+
   
 
 


-
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 AccessLogValve unit test for %I

2023-04-29 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 28a610b47a Fix AccessLogValve unit test for %I
28a610b47a is described below

commit 28a610b47afe261c41cc88f53d8e529770e8d7c0
Author: Rainer Jung 
AuthorDate: Sat Apr 29 10:22:29 2023 +0200

Fix AccessLogValve unit test for %I
---
 test/org/apache/catalina/valves/TestAccessLogValve.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValve.java
index ad099ba9c0..d7976cdfbc 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValve.java
@@ -103,8 +103,8 @@ public class TestAccessLogValve extends TomcatBaseTest {
 parameterSets.add(new Object[] {"pct-h", JSON_TYPE, "/", "%h", 
"\\{\"host\":\"" + LOCAL_IP_PATTERN + "\"\\}"});
 parameterSets.add(new Object[] {"pct-H", TEXT_TYPE, "/", "%H", 
"HTTP/1.1"});
 parameterSets.add(new Object[] {"pct-H", JSON_TYPE, "/", "%H", 
"\\{\"protocol\":\"HTTP/1.1\"\\}"});
-parameterSets.add(new Object[] {"pct-I", TEXT_TYPE, "/", "%I", 
"http-nio2?-" + LOCAL_IP_PATTERN + "-auto-\\d+-exec-\\d+"});
-parameterSets.add(new Object[] {"pct-I", JSON_TYPE, "/", "%I", 
"\\{\"threadName\":\"http-nio2?-" + LOCAL_IP_PATTERN + 
"-auto-\\d+-exec-\\d+\"\\}"});
+parameterSets.add(new Object[] {"pct-I", TEXT_TYPE, "/", "%I", 
"http-(nio2?|apr)-" + LOCAL_IP_PATTERN + "-auto-\\d+-exec-\\d+"});
+parameterSets.add(new Object[] {"pct-I", JSON_TYPE, "/", "%I", 
"\\{\"threadName\":\"http-(nio2?|apr)-" + LOCAL_IP_PATTERN + 
"-auto-\\d+-exec-\\d+\"\\}"});
 parameterSets.add(new Object[] {"pct-l", TEXT_TYPE, "/", "%l", "-"});
 parameterSets.add(new Object[] {"pct-l", JSON_TYPE, "/", "%l", 
"\\{\"logicalUserName\":\"-\"\\}"});
 parameterSets.add(new Object[] {"pct-m", TEXT_TYPE, "/", "%m", "GET"});


-
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 AccessLogValve unit test for %I

2023-04-29 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 e3e84b4564 Fix AccessLogValve unit test for %I
e3e84b4564 is described below

commit e3e84b45648c5e16f6941ba3099a8cb748c9e365
Author: Rainer Jung 
AuthorDate: Sat Apr 29 10:21:00 2023 +0200

Fix AccessLogValve unit test for %I
---
 test/org/apache/catalina/valves/TestAccessLogValve.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValve.java
index 6a3eaf71f0..6eca0980e0 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValve.java
@@ -105,8 +105,8 @@ public class TestAccessLogValve extends TomcatBaseTest {
 parameterSets.add(new Object[] {"pct-h", JSON_TYPE, "/", "%h", 
"\\{\"host\":\"" + LOCAL_IP_PATTERN + "\"\\}"});
 parameterSets.add(new Object[] {"pct-H", TEXT_TYPE, "/", "%H", 
"HTTP/1.1"});
 parameterSets.add(new Object[] {"pct-H", JSON_TYPE, "/", "%H", 
"\\{\"protocol\":\"HTTP/1.1\"\\}"});
-parameterSets.add(new Object[] {"pct-I", TEXT_TYPE, "/", "%I", 
"http-nio2?-" + LOCAL_IP_PATTERN + "-auto-\\d+-exec-\\d+"});
-parameterSets.add(new Object[] {"pct-I", JSON_TYPE, "/", "%I", 
"\\{\"threadName\":\"http-nio2?-" + LOCAL_IP_PATTERN + 
"-auto-\\d+-exec-\\d+\"\\}"});
+parameterSets.add(new Object[] {"pct-I", TEXT_TYPE, "/", "%I", 
"http-(nio2?|apr)-" + LOCAL_IP_PATTERN + "-auto-\\d+-exec-\\d+"});
+parameterSets.add(new Object[] {"pct-I", JSON_TYPE, "/", "%I", 
"\\{\"threadName\":\"http-(nio2?|apr)-" + LOCAL_IP_PATTERN + 
"-auto-\\d+-exec-\\d+\"\\}"});
 parameterSets.add(new Object[] {"pct-l", TEXT_TYPE, "/", "%l", "-"});
 parameterSets.add(new Object[] {"pct-l", JSON_TYPE, "/", "%l", 
"\\{\"logicalUserName\":\"-\"\\}"});
 parameterSets.add(new Object[] {"pct-m", TEXT_TYPE, "/", "%m", "GET"});


-
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: Short sleep in unit test should suffice, but allow for lonhger ones also

2023-04-28 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 554d7f77d5 Short sleep in unit test should suffice, but allow for 
lonhger ones also
554d7f77d5 is described below

commit 554d7f77d58662f15f89b095fd4a31893ef8c9af
Author: Rainer Jung 
AuthorDate: Fri Apr 28 13:02:45 2023 +0200

Short sleep in unit test should suffice, but allow for lonhger ones also
---
 .../org/apache/catalina/valves/TestAccessLogValve.java | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValve.java
index cffd9fd653..ad099ba9c0 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValve.java
@@ -53,7 +53,8 @@ public class TestAccessLogValve extends TomcatBaseTest {
 private static Log log = LogFactory.getLog(TestAccessLogValve.class);
 
 // Requests can return in the client before log() has been called
-private static final long SLEEP = 10;
+private static final long SLEEP = 2;
+private static final long SLEEP_MAX = 100;
 
 private static final String TEXT_TYPE = "text";
 private static final String JSON_TYPE = "json";
@@ -307,12 +308,17 @@ public class TestAccessLogValve extends TomcatBaseTest {
 reqHead.put(REQUEST_HEADER, testHeaders);
 int status = getUrl(url, out, reqHead, resHead);
 Assert.assertEquals(HttpServletResponse.SC_OK, status);
-try {
-Thread.currentThread().sleep(SLEEP);
-} catch (InterruptedException ex) {
-log.error("Exception during sleep", ex);
-}
+long startWait = System.currentTimeMillis();
 String result = writer.toString();
+while ("".equals(result) && System.currentTimeMillis() - startWait < 
SLEEP_MAX) {
+try {
+Thread.currentThread().sleep(SLEEP);
+} catch (InterruptedException ex) {
+log.error("Exception during sleep", ex);
+}
+result = writer.toString();
+}
+Assert.assertFalse("Access log line empty after " + 
(System.currentTimeMillis() - startWait) + " milliseconds", "".equals(result));
 boolean matches = Pattern.matches(resultMatch, result);
 if (!matches) {
 log.error("Resulting log line '" + result + "' does not match '" + 
resultMatch + "'");


-
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: Short sleep in unit test should suffice, but allow for lonhger ones also

2023-04-28 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 be21363d1e Short sleep in unit test should suffice, but allow for 
lonhger ones also
be21363d1e is described below

commit be21363d1e22ab07dc616e03363e6b03b6d13215
Author: Rainer Jung 
AuthorDate: Fri Apr 28 13:01:59 2023 +0200

Short sleep in unit test should suffice, but allow for lonhger ones also
---
 .../org/apache/catalina/valves/TestAccessLogValve.java | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValve.java
index 74a6b85f45..6a3eaf71f0 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValve.java
@@ -55,7 +55,8 @@ public class TestAccessLogValve extends TomcatBaseTest {
 private static Log log = LogFactory.getLog(TestAccessLogValve.class);
 
 // Requests can return in the client before log() has been called
-private static final long SLEEP = 10;
+private static final long SLEEP = 2;
+private static final long SLEEP_MAX = 100;
 
 private static final String TEXT_TYPE = "text";
 private static final String JSON_TYPE = "json";
@@ -309,12 +310,17 @@ public class TestAccessLogValve extends TomcatBaseTest {
 reqHead.put(REQUEST_HEADER, testHeaders);
 int status = getUrl(url, out, reqHead, resHead);
 Assert.assertEquals(HttpServletResponse.SC_OK, status);
-try {
-Thread.currentThread().sleep(SLEEP);
-} catch (InterruptedException ex) {
-log.error("Exception during sleep", ex);
-}
+long startWait = System.currentTimeMillis();
 String result = writer.toString();
+while ("".equals(result) && System.currentTimeMillis() - startWait < 
SLEEP_MAX) {
+try {
+Thread.currentThread().sleep(SLEEP);
+} catch (InterruptedException ex) {
+log.error("Exception during sleep", ex);
+}
+result = writer.toString();
+}
+Assert.assertFalse("Access log line empty after " + 
(System.currentTimeMillis() - startWait) + " milliseconds", "".equals(result));
 boolean matches = Pattern.matches(resultMatch, result);
 if (!matches) {
 log.error("Resulting log line '" + result + "' does not match '" + 
resultMatch + "'");


-
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: Short sleep in unit test should suffice, but allow for lonhger ones also

2023-04-28 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 1adbfd87b1 Short sleep in unit test should suffice, but allow for 
lonhger ones also
1adbfd87b1 is described below

commit 1adbfd87b1607c9fb2e8018b12c1e08522bb8949
Author: Rainer Jung 
AuthorDate: Fri Apr 28 13:01:16 2023 +0200

Short sleep in unit test should suffice, but allow for lonhger ones also
---
 .../org/apache/catalina/valves/TestAccessLogValve.java | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValve.java
index 140b967596..824eab08eb 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValve.java
@@ -55,7 +55,8 @@ public class TestAccessLogValve extends TomcatBaseTest {
 private static Log log = LogFactory.getLog(TestAccessLogValve.class);
 
 // Requests can return in the client before log() has been called
-private static final long SLEEP = 10;
+private static final long SLEEP = 2;
+private static final long SLEEP_MAX = 100;
 
 private static final String TEXT_TYPE = "text";
 private static final String JSON_TYPE = "json";
@@ -309,12 +310,17 @@ public class TestAccessLogValve extends TomcatBaseTest {
 reqHead.put(REQUEST_HEADER, testHeaders);
 int status = getUrl(url, out, reqHead, resHead);
 Assert.assertEquals(HttpServletResponse.SC_OK, status);
-try {
-Thread.currentThread().sleep(SLEEP);
-} catch (InterruptedException ex) {
-log.error("Exception during sleep", ex);
-}
+long startWait = System.currentTimeMillis();
 String result = writer.toString();
+while ("".equals(result) && System.currentTimeMillis() - startWait < 
SLEEP_MAX) {
+try {
+Thread.currentThread().sleep(SLEEP);
+} catch (InterruptedException ex) {
+log.error("Exception during sleep", ex);
+}
+result = writer.toString();
+}
+Assert.assertFalse("Access log line empty after " + 
(System.currentTimeMillis() - startWait) + " milliseconds", "".equals(result));
 boolean matches = Pattern.matches(resultMatch, result);
 if (!matches) {
 log.error("Resulting log line '" + result + "' does not match '" + 
resultMatch + "'");


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



[tomcat] branch main updated: Short sleep in unit test should suffice, but allow for lonhger ones also

2023-04-28 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 7ae80d7554 Short sleep in unit test should suffice, but allow for 
lonhger ones also
7ae80d7554 is described below

commit 7ae80d7554d8ec921f33a4bffe135fe7952c8974
Author: Rainer Jung 
AuthorDate: Fri Apr 28 13:00:18 2023 +0200

Short sleep in unit test should suffice, but allow for lonhger ones also
---
 .../org/apache/catalina/valves/TestAccessLogValve.java | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValve.java
index 140b967596..824eab08eb 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValve.java
@@ -55,7 +55,8 @@ public class TestAccessLogValve extends TomcatBaseTest {
 private static Log log = LogFactory.getLog(TestAccessLogValve.class);
 
 // Requests can return in the client before log() has been called
-private static final long SLEEP = 10;
+private static final long SLEEP = 2;
+private static final long SLEEP_MAX = 100;
 
 private static final String TEXT_TYPE = "text";
 private static final String JSON_TYPE = "json";
@@ -309,12 +310,17 @@ public class TestAccessLogValve extends TomcatBaseTest {
 reqHead.put(REQUEST_HEADER, testHeaders);
 int status = getUrl(url, out, reqHead, resHead);
 Assert.assertEquals(HttpServletResponse.SC_OK, status);
-try {
-Thread.currentThread().sleep(SLEEP);
-} catch (InterruptedException ex) {
-log.error("Exception during sleep", ex);
-}
+long startWait = System.currentTimeMillis();
 String result = writer.toString();
+while ("".equals(result) && System.currentTimeMillis() - startWait < 
SLEEP_MAX) {
+try {
+Thread.currentThread().sleep(SLEEP);
+} catch (InterruptedException ex) {
+log.error("Exception during sleep", ex);
+}
+result = writer.toString();
+}
+Assert.assertFalse("Access log line empty after " + 
(System.currentTimeMillis() - startWait) + " milliseconds", "".equals(result));
 boolean matches = Pattern.matches(resultMatch, result);
 if (!matches) {
 log.error("Resulting log line '" + result + "' does not match '" + 
resultMatch + "'");


-
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: Add new unit tests for AccessLogValve

2023-04-28 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 d3fff471bb Add new unit tests for AccessLogValve
d3fff471bb is described below

commit d3fff471bbee8793b4c197eee2b312cd9757c1c3
Author: Rainer Jung 
AuthorDate: Fri Apr 28 12:09:49 2023 +0200

Add new unit tests for AccessLogValve
---
 .../apache/catalina/valves/TestAccessLogValve.java | 323 +
 1 file changed, 323 insertions(+)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValve.java
new file mode 100644
index 00..cffd9fd653
--- /dev/null
+++ b/test/org/apache/catalina/valves/TestAccessLogValve.java
@@ -0,0 +1,323 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.valves;
+
+import java.io.CharArrayWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+
+import org.apache.catalina.LifecycleException;
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.buf.ByteChunk;
+
+
+@RunWith(Parameterized.class)
+public class TestAccessLogValve extends TomcatBaseTest {
+
+private static Log log = LogFactory.getLog(TestAccessLogValve.class);
+
+// Requests can return in the client before log() has been called
+private static final long SLEEP = 10;
+
+private static final String TEXT_TYPE = "text";
+private static final String JSON_TYPE = "json";
+
+private static final String RESPONSE = "OK\n";
+private static final String BYTES = Integer.toString(RESPONSE.length());
+
+private static final String REQUEST_HEADER = "myRequestHeader";
+private static final String REQUEST_HEADER_VALUE = "1 2 3 4 5 6 7 8 9";
+private static final String REQUEST_HEADER_VALUE_ENCODED = "1 2 3 4 5 6 7 
8 9";
+
+private static final String RESPONSE_HEADER = "myResponseHeader";
+private static final String RESPONSE_HEADER_VALUE = 
"864\u00e4\u00f6\u00fc642";
+private static final String RESPONSE_HEADER_VALUE_ENCODED = 
"864u00e4u00f6u00fc642";
+
+private static final String REQUEST_ATTRIBUTE = "myRequestAttribute";
+private static final String REQUEST_ATTRIBUTE_VALUE = 
"987\u00e4\u00f6\u00fc654";
+private static final String REQUEST_ATTRIBUTE_VALUE_ENCODED = 
"987u00e4u00f6u00fc654";
+
+private static final String SESSION_ATTRIBUTE = "mySessionAttribute";
+private static final String SESSION_ATTRIBUTE_VALUE = 
"123\u00e4\u00f6\u00fc456";
+private static final String SESSION_ATTRIBUTE_VALUE_ENCODED = 
"123u00e4u00f6u00fc456";
+
+private static final String DATE_PATTERN = 
"\\[\\d\\d/[A-Z][a-z][a-z]/\\d\\d\\d\\d:\\d\\d:\\d\\d:\\d\\d 
[-+]\\d\\d\\d\\d\\]";
+private static final String LOCAL_IP_PATTERN = 
"(127\\.0\\.\\d\\.\\d+|\\[::1\\])";
+private static final String IP_PATTERN = 
"(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|([0-9a-fA-F]){1,4}(:([0-9a-fA-F]){1,4}){7})";
+private static final String UA_PATTERN = "[^\"]+";
+
+@Parameterized.Parameters(name = "{index}: Name[{0}], Type[{1}]")
+public

[tomcat] branch 9.0.x updated: Add new unit tests for AccessLogValve

2023-04-28 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 f339f688e3 Add new unit tests for AccessLogValve
f339f688e3 is described below

commit f339f688e383b674744da70510d434d27cddebb2
Author: Rainer Jung 
AuthorDate: Fri Apr 28 12:09:25 2023 +0200

Add new unit tests for AccessLogValve
---
 .../apache/catalina/valves/TestAccessLogValve.java | 335 +
 1 file changed, 335 insertions(+)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValve.java
new file mode 100644
index 00..74a6b85f45
--- /dev/null
+++ b/test/org/apache/catalina/valves/TestAccessLogValve.java
@@ -0,0 +1,335 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.valves;
+
+import java.io.CharArrayWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+
+import org.apache.catalina.LifecycleException;
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.buf.ByteChunk;
+import org.apache.tomcat.util.json.JSONParser;
+import org.apache.tomcat.util.json.ParseException;
+
+
+@RunWith(Parameterized.class)
+public class TestAccessLogValve extends TomcatBaseTest {
+
+private static Log log = LogFactory.getLog(TestAccessLogValve.class);
+
+// Requests can return in the client before log() has been called
+private static final long SLEEP = 10;
+
+private static final String TEXT_TYPE = "text";
+private static final String JSON_TYPE = "json";
+
+private static final String RESPONSE = "OK\n";
+private static final String BYTES = Integer.toString(RESPONSE.length());
+
+private static final String REQUEST_HEADER = "myRequestHeader";
+private static final String REQUEST_HEADER_VALUE = "1 2 3 4 5 6 7 8 9";
+private static final String REQUEST_HEADER_VALUE_ENCODED = "1 2 3 4 5 6 7 
8 9";
+
+private static final String RESPONSE_HEADER = "myResponseHeader";
+private static final String RESPONSE_HEADER_VALUE = 
"864\u00e4\u00f6\u00fc642";
+private static final String RESPONSE_HEADER_VALUE_ENCODED = 
"864u00e4u00f6u00fc642";
+
+private static final String REQUEST_ATTRIBUTE = "myRequestAttribute";
+private static final String REQUEST_ATTRIBUTE_VALUE = 
"987\u00e4\u00f6\u00fc654";
+private static final String REQUEST_ATTRIBUTE_VALUE_ENCODED = 
"987u00e4u00f6u00fc654";
+
+private static final String SESSION_ATTRIBUTE = "mySessionAttribute";
+private static final String SESSION_ATTRIBUTE_VALUE = 
"123\u00e4\u00f6\u00fc456";
+private static final String SESSION_ATTRIBUTE_VALUE_ENCODED = 
"123u00e4u00f6u00fc456";
+
+private static final String DATE_PATTERN = 
"\\[\\d\\d/[A-Z][a-z][a-z]/\\d\\d\\d\\d:\\d\\d:\\d\\d:\\d\\d 
[-+]\\d\\d\\d\\d\\]";
+private static final String LOCAL_IP_PATTERN = 
"(127\\.0\\.\\d\\.\\d+|\\[::1\\])";
+private static final String IP_PATTERN = 
"(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|([0-9a-fA-F]){1,4}(:([0-9a-fA-F]){1,4}){7})";
+private static final String UA_PATTERN = "[^\"]

[tomcat] branch 10.1.x updated: Add new unit tests for AccessLogValve

2023-04-28 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 eb6a5e28df Add new unit tests for AccessLogValve
eb6a5e28df is described below

commit eb6a5e28df86cad1cd7bfc5183fecf753777ad7a
Author: Rainer Jung 
AuthorDate: Fri Apr 28 12:09:00 2023 +0200

Add new unit tests for AccessLogValve
---
 .../apache/catalina/valves/TestAccessLogValve.java | 335 +
 1 file changed, 335 insertions(+)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValve.java
new file mode 100644
index 00..140b967596
--- /dev/null
+++ b/test/org/apache/catalina/valves/TestAccessLogValve.java
@@ -0,0 +1,335 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.valves;
+
+import java.io.CharArrayWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpSession;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+
+import org.apache.catalina.LifecycleException;
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.buf.ByteChunk;
+import org.apache.tomcat.util.json.JSONParser;
+import org.apache.tomcat.util.json.ParseException;
+
+
+@RunWith(Parameterized.class)
+public class TestAccessLogValve extends TomcatBaseTest {
+
+private static Log log = LogFactory.getLog(TestAccessLogValve.class);
+
+// Requests can return in the client before log() has been called
+private static final long SLEEP = 10;
+
+private static final String TEXT_TYPE = "text";
+private static final String JSON_TYPE = "json";
+
+private static final String RESPONSE = "OK\n";
+private static final String BYTES = Integer.toString(RESPONSE.length());
+
+private static final String REQUEST_HEADER = "myRequestHeader";
+private static final String REQUEST_HEADER_VALUE = "1 2 3 4 5 6 7 8 9";
+private static final String REQUEST_HEADER_VALUE_ENCODED = "1 2 3 4 5 6 7 
8 9";
+
+private static final String RESPONSE_HEADER = "myResponseHeader";
+private static final String RESPONSE_HEADER_VALUE = 
"864\u00e4\u00f6\u00fc642";
+private static final String RESPONSE_HEADER_VALUE_ENCODED = 
"864u00e4u00f6u00fc642";
+
+private static final String REQUEST_ATTRIBUTE = "myRequestAttribute";
+private static final String REQUEST_ATTRIBUTE_VALUE = 
"987\u00e4\u00f6\u00fc654";
+private static final String REQUEST_ATTRIBUTE_VALUE_ENCODED = 
"987u00e4u00f6u00fc654";
+
+private static final String SESSION_ATTRIBUTE = "mySessionAttribute";
+private static final String SESSION_ATTRIBUTE_VALUE = 
"123\u00e4\u00f6\u00fc456";
+private static final String SESSION_ATTRIBUTE_VALUE_ENCODED = 
"123u00e4u00f6u00fc456";
+
+private static final String DATE_PATTERN = 
"\\[\\d\\d/[A-Z][a-z][a-z]/\\d\\d\\d\\d:\\d\\d:\\d\\d:\\d\\d 
[-+]\\d\\d\\d\\d\\]";
+private static final String LOCAL_IP_PATTERN = 
"(127\\.0\\.\\d\\.\\d+|\\[::1\\])";
+private static final String IP_PATTERN = 
"(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|([0-9a-fA-F]){1,4}(:([0-9a-fA-F]){1,4}){7})";
+private static final String UA_PATTERN = "[^\

[tomcat] branch 8.5.x updated: Fix class name broken during recent class move

2023-04-28 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 9bb328ebdd Fix class name broken during recent class move
9bb328ebdd is described below

commit 9bb328ebddfc46f878b7cdce026e8b202a0f1a63
Author: Rainer Jung 
AuthorDate: Fri Apr 28 10:38:39 2023 +0200

Fix class name broken during recent class move
---
 test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java 
b/test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java
index f0e03591ff..171f5cfcab 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java
@@ -24,7 +24,7 @@ import java.util.TimeZone;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class TestAccessLogValveDateCache {
+public class TestAccessLogValveDateFormatCache {
 
 // Note that there is a similar test:
 // org.apache.juli.TestDateFormatCache.testBug54044()


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



[tomcat] branch main updated: Improve and fix new AccessLogValve unit test

2023-04-28 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 9d2ec8c7f5 Improve and fix new AccessLogValve unit test
 new c658727f65 Merge branch 'main' of 
https://gitbox.apache.org/repos/asf/tomcat
9d2ec8c7f5 is described below

commit 9d2ec8c7f53da156794f47f0c5fab0ff7e68ba52
Author: Rainer Jung 
AuthorDate: Fri Apr 28 10:15:17 2023 +0200

Improve and fix new AccessLogValve unit test
---
 .../apache/catalina/valves/TestAccessLogValve.java | 97 --
 1 file changed, 72 insertions(+), 25 deletions(-)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValve.java
index 907b8f4b66..140b967596 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValve.java
@@ -30,6 +30,7 @@ import jakarta.servlet.ServletException;
 import jakarta.servlet.http.HttpServlet;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpSession;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -59,40 +60,60 @@ public class TestAccessLogValve extends TomcatBaseTest {
 private static final String TEXT_TYPE = "text";
 private static final String JSON_TYPE = "json";
 
+private static final String RESPONSE = "OK\n";
+private static final String BYTES = Integer.toString(RESPONSE.length());
+
+private static final String REQUEST_HEADER = "myRequestHeader";
+private static final String REQUEST_HEADER_VALUE = "1 2 3 4 5 6 7 8 9";
+private static final String REQUEST_HEADER_VALUE_ENCODED = "1 2 3 4 5 6 7 
8 9";
+
+private static final String RESPONSE_HEADER = "myResponseHeader";
+private static final String RESPONSE_HEADER_VALUE = 
"864\u00e4\u00f6\u00fc642";
+private static final String RESPONSE_HEADER_VALUE_ENCODED = 
"864u00e4u00f6u00fc642";
+
+private static final String REQUEST_ATTRIBUTE = "myRequestAttribute";
+private static final String REQUEST_ATTRIBUTE_VALUE = 
"987\u00e4\u00f6\u00fc654";
+private static final String REQUEST_ATTRIBUTE_VALUE_ENCODED = 
"987u00e4u00f6u00fc654";
+
+private static final String SESSION_ATTRIBUTE = "mySessionAttribute";
+private static final String SESSION_ATTRIBUTE_VALUE = 
"123\u00e4\u00f6\u00fc456";
+private static final String SESSION_ATTRIBUTE_VALUE_ENCODED = 
"123u00e4u00f6u00fc456";
+
 private static final String DATE_PATTERN = 
"\\[\\d\\d/[A-Z][a-z][a-z]/\\d\\d\\d\\d:\\d\\d:\\d\\d:\\d\\d 
[-+]\\d\\d\\d\\d\\]";
-private static final String IP_PATTERN = 
"(127\\.0\\.\\d\\.\\d+|\\[::1\\])";
+private static final String LOCAL_IP_PATTERN = 
"(127\\.0\\.\\d\\.\\d+|\\[::1\\])";
+private static final String IP_PATTERN = 
"(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|([0-9a-fA-F]){1,4}(:([0-9a-fA-F]){1,4}){7})";
 private static final String UA_PATTERN = "[^\"]+";
 
 @Parameterized.Parameters(name = "{index}: Name[{0}], Type[{1}]")
 public static Collection parameters() {
 List parameterSets = new ArrayList<>();
 
-parameterSets.add(new Object[] {"pct-a", TEXT_TYPE, "/", "%a", 
IP_PATTERN});
-parameterSets.add(new Object[] {"pct-a", JSON_TYPE, "/", "%a", 
"\\{\"remoteAddr\":\"" + IP_PATTERN + "\"\\}"});
+parameterSets.add(new Object[] {"pct-a", TEXT_TYPE, "/", "%a", 
LOCAL_IP_PATTERN});
+parameterSets.add(new Object[] {"pct-a", JSON_TYPE, "/", "%a", 
"\\{\"remoteAddr\":\"" + LOCAL_IP_PATTERN + "\"\\}"});
 parameterSets.add(new Object[] {"pct-A", TEXT_TYPE, "/", "%A", 
IP_PATTERN});
 parameterSets.add(new Object[] {"pct-A", JSON_TYPE, "/", "%A", 
"\\{\"localAddr\":\"" + IP_PATTERN + "\"\\}"});
-parameterSets.add(new Object[] {"pct-b", TEXT_TYPE, "/", "%b", "3"});
-parameterSets.add(new Object[] {"pct-b", JSON_TYPE, "/", "%b", 
"\\{\"size\":\"3\"\\}"});
-parameterSets.add(new Object[] {"pct-B", TEXT_TYPE, "/", "%B", "3"});
-parameterSets.add(new Object[] {"pct-B", JSON_TYPE, "/", "%

[tomcat] branch main updated: Extend AccessLogValve unit tests for single pattern identifiers

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 fbdd0f20da Extend AccessLogValve unit tests for single pattern 
identifiers
fbdd0f20da is described below

commit fbdd0f20da081d7ffafccb23508dcceb3e1d03ac
Author: Rainer Jung 
AuthorDate: Fri Apr 28 00:18:16 2023 +0200

Extend AccessLogValve unit tests for single pattern identifiers
---
 .../apache/catalina/valves/TestAccessLogValve.java | 128 +
 1 file changed, 108 insertions(+), 20 deletions(-)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValve.java
index 5dfa4a1dbe..907b8f4b66 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValve.java
@@ -18,11 +18,19 @@ package org.apache.catalina.valves;
 
 import java.io.CharArrayWriter;
 import java.io.IOException;
+import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.regex.Pattern;
 
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -30,6 +38,7 @@ import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameter;
 
 import org.apache.catalina.LifecycleException;
+import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
 import org.apache.juli.logging.Log;
@@ -51,23 +60,85 @@ public class TestAccessLogValve extends TomcatBaseTest {
 private static final String JSON_TYPE = "json";
 
 private static final String DATE_PATTERN = 
"\\[\\d\\d/[A-Z][a-z][a-z]/\\d\\d\\d\\d:\\d\\d:\\d\\d:\\d\\d 
[-+]\\d\\d\\d\\d\\]";
-private static final String IP_PATTERN = "(127\\.0\\.0\\.\\d+|\\[::1\\])";
+private static final String IP_PATTERN = 
"(127\\.0\\.\\d\\.\\d+|\\[::1\\])";
 private static final String UA_PATTERN = "[^\"]+";
 
 @Parameterized.Parameters(name = "{index}: Name[{0}], Type[{1}]")
 public static Collection parameters() {
 List parameterSets = new ArrayList<>();
 
+parameterSets.add(new Object[] {"pct-a", TEXT_TYPE, "/", "%a", 
IP_PATTERN});
+parameterSets.add(new Object[] {"pct-a", JSON_TYPE, "/", "%a", 
"\\{\"remoteAddr\":\"" + IP_PATTERN + "\"\\}"});
+parameterSets.add(new Object[] {"pct-A", TEXT_TYPE, "/", "%A", 
IP_PATTERN});
+parameterSets.add(new Object[] {"pct-A", JSON_TYPE, "/", "%A", 
"\\{\"localAddr\":\"" + IP_PATTERN + "\"\\}"});
+parameterSets.add(new Object[] {"pct-b", TEXT_TYPE, "/", "%b", "3"});
+parameterSets.add(new Object[] {"pct-b", JSON_TYPE, "/", "%b", 
"\\{\"size\":\"3\"\\}"});
+parameterSets.add(new Object[] {"pct-B", TEXT_TYPE, "/", "%B", "3"});
+parameterSets.add(new Object[] {"pct-B", JSON_TYPE, "/", "%B", 
"\\{\"byteSentNC\":\"3\"\\}"});
+parameterSets.add(new Object[] {"pct-D", TEXT_TYPE, "/", "%D", 
"\\d+"});
+parameterSets.add(new Object[] {"pct-D", JSON_TYPE, "/", "%D", 
"\\{\"elapsedTime\":\"\\d+\"\\}"});
+parameterSets.add(new Object[] {"pct-F", TEXT_TYPE, "/", "%F", 
"\\d+"});
+parameterSets.add(new Object[] {"pct-F", JSON_TYPE, "/", "%F", 
"\\{\"firstByteTime\":\"\\d+\"\\}"});
+parameterSets.add(new Object[] {"pct-h", TEXT_TYPE, "/", "%h", 
IP_PATTERN});
+parameterSets.add(new Object[] {"pct-h", JSON_TYPE, "/", "%h", 
"\\{\"host\":\"" + IP_PATTERN + "\"\\}"});
+parameterSets.add(new Object[] {"pct-H", TEXT_TYPE, "/", "%H", 
"HTTP/1.1"});
+parameterSets.add(new Object[] {"pct-H", JSON_TYPE, "/", "%H", 
"\\{\"protocol\":\"HTTP/1.1\"\\}"});
+parame

[tomcat] branch main updated: Fix new unit test: make expected error page size a bit flexible

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 d3f549fe98 Fix new unit test: make expected error page size a bit 
flexible
d3f549fe98 is described below

commit d3f549fe984aecfbae515c309b459f0e5e1e22a3
Author: Rainer Jung 
AuthorDate: Thu Apr 27 22:20:43 2023 +0200

Fix new unit test: make expected error page size a bit flexible
---
 test/org/apache/catalina/valves/TestAccessLogValve.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValve.java
index d6aea92f1e..5dfa4a1dbe 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValve.java
@@ -59,15 +59,15 @@ public class TestAccessLogValve extends TomcatBaseTest {
 List parameterSets = new ArrayList<>();
 
 parameterSets.add(new Object[] {"common", TEXT_TYPE, "/", "common",
-IP_PATTERN + " - - " + DATE_PATTERN + " \"GET / HTTP/1.1\" 404 
700"});
+IP_PATTERN + " - - " + DATE_PATTERN + " \"GET / HTTP/1.1\" 404 
[67]\\d\\d"});
 parameterSets.add(new Object[] {"common", JSON_TYPE, "/", "common",
 "\\{\"host\":\"" + IP_PATTERN + 
"\",\"logicalUserName\":\"-\",\"user\":\"-\",\"time\":\"" + DATE_PATTERN +
-"\",\"request\":\"GET / 
HTTP/1.1\",\"statusCode\":\"404\",\"size\":\"700\"\\}"});
+"\",\"request\":\"GET / 
HTTP/1.1\",\"statusCode\":\"404\",\"size\":\"[67]\\d\\d\"\\}"});
 parameterSets.add(new Object[] {"combined", TEXT_TYPE, "/", "combined",
-IP_PATTERN + " - - " + DATE_PATTERN + " \"GET / HTTP/1.1\" 404 700 
\"-\" \"" + UA_PATTERN + "\""});
+IP_PATTERN + " - - " + DATE_PATTERN + " \"GET / HTTP/1.1\" 404 
[67]\\d\\d \"-\" \"" + UA_PATTERN + "\""});
 parameterSets.add(new Object[] {"combined", JSON_TYPE, "/", "combined",
 "\\{\"host\":\"" + IP_PATTERN + 
"\",\"logicalUserName\":\"-\",\"user\":\"-\",\"time\":\"" + DATE_PATTERN +
-"\",\"request\":\"GET / 
HTTP/1.1\",\"statusCode\":\"404\",\"size\":\"700\"" +
+"\",\"request\":\"GET / 
HTTP/1.1\",\"statusCode\":\"404\",\"size\":\"[67]\\d\\d\"" +
 ",\"requestHeaders\": \\{\"Referer\":\"-\",\"User-Agent\":\"" + 
UA_PATTERN + "\"\\}\\}"});
 
 return parameterSets;


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



[tomcat] branch main updated: Add error logging to failing unit test as a workaround for missing access to unit test detail log.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 e71864670e Add error logging to failing unit test as a workaround for 
missing access to unit test detail log.
e71864670e is described below

commit e71864670e7df50785641a8092b0d2793b4488ee
Author: Rainer Jung 
AuthorDate: Thu Apr 27 22:14:55 2023 +0200

Add error logging to failing unit test
as a workaround for missing access to unit test detail log.
---
 test/org/apache/catalina/valves/TestAccessLogValve.java | 4 
 1 file changed, 4 insertions(+)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValve.java
index 98bf1bca6d..d6aea92f1e 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValve.java
@@ -157,6 +157,7 @@ public class TestAccessLogValve extends TomcatBaseTest {
 valve.setPattern(logPattern);
 tomcat.getHost().getPipeline().addValve(valve);
 } else {
+log.error("Unknown AccessLogValve type " + type);
 Assert.fail("Unknown AccessLogValve type " + type);
 }
 
@@ -180,6 +181,9 @@ public class TestAccessLogValve extends TomcatBaseTest {
 }
 String result = writer.toString();
 boolean matches = Pattern.matches(resultMatch, result);
+if (!matches) {
+log.error("Resulting log line '" + result + "' does not match '" + 
resultMatch + "'");
+}
 Assert.assertTrue("Resulting log line '" + result + "' does not match 
'" + resultMatch + "'", matches);
 
 if (JSON_TYPE.equals(type)) {


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



[tomcat] branch main updated: Add unit test for AccessLogVale

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 996e8dfad0 Add unit test for AccessLogVale
996e8dfad0 is described below

commit 996e8dfad0189d3db625940b9f386f3cb4c96656
Author: Rainer Jung 
AuthorDate: Thu Apr 27 19:44:06 2023 +0200

Add unit test for AccessLogVale
---
 .../apache/catalina/valves/TestAccessLogValve.java | 196 +
 1 file changed, 196 insertions(+)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValve.java
new file mode 100644
index 00..98bf1bca6d
--- /dev/null
+++ b/test/org/apache/catalina/valves/TestAccessLogValve.java
@@ -0,0 +1,196 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.valves;
+
+import java.io.CharArrayWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+
+import org.apache.catalina.LifecycleException;
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.buf.ByteChunk;
+import org.apache.tomcat.util.json.JSONParser;
+import org.apache.tomcat.util.json.ParseException;
+
+
+@RunWith(Parameterized.class)
+public class TestAccessLogValve extends TomcatBaseTest {
+
+private static Log log = LogFactory.getLog(TestAccessLogValve.class);
+
+// Requests can return in the client before log() has been called
+private static final long SLEEP = 10;
+
+private static final String TEXT_TYPE = "text";
+private static final String JSON_TYPE = "json";
+
+private static final String DATE_PATTERN = 
"\\[\\d\\d/[A-Z][a-z][a-z]/\\d\\d\\d\\d:\\d\\d:\\d\\d:\\d\\d 
[-+]\\d\\d\\d\\d\\]";
+private static final String IP_PATTERN = "(127\\.0\\.0\\.\\d+|\\[::1\\])";
+private static final String UA_PATTERN = "[^\"]+";
+
+@Parameterized.Parameters(name = "{index}: Name[{0}], Type[{1}]")
+public static Collection parameters() {
+List parameterSets = new ArrayList<>();
+
+parameterSets.add(new Object[] {"common", TEXT_TYPE, "/", "common",
+IP_PATTERN + " - - " + DATE_PATTERN + " \"GET / HTTP/1.1\" 404 
700"});
+parameterSets.add(new Object[] {"common", JSON_TYPE, "/", "common",
+"\\{\"host\":\"" + IP_PATTERN + 
"\",\"logicalUserName\":\"-\",\"user\":\"-\",\"time\":\"" + DATE_PATTERN +
+"\",\"request\":\"GET / 
HTTP/1.1\",\"statusCode\":\"404\",\"size\":\"700\"\\}"});
+parameterSets.add(new Object[] {"combined", TEXT_TYPE, "/", "combined",
+IP_PATTERN + " - - " + DATE_PATTERN + " \"GET / HTTP/1.1\" 404 700 
\"-\" \"" + UA_PATTERN + "\""});
+parameterSets.add(new Object[] {"combined", JSON_TYPE, "/", "combined",
+"\\{\"host\":\"" + IP_PATTERN + 
"\",\"logicalUserName\":\"-\",\"user\":\"-\",\"time\":\"" + DATE_PATTERN +
+"\",\"request\":\"GET / 
HTTP/1.1\",\"statusCode\":\"404\",\"size\":\"700\"" +
+",\"requestHeaders\": \\{\"Referer\":\"-\",\"User-Agent\":\""

[tomcat] branch 8.5.x updated: Prepare new unit test class for AccessLogValve; give the existing one a more precise name

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 5407c0453c Prepare new unit test class for AccessLogValve; give the 
existing one a more precise name
5407c0453c is described below

commit 5407c0453c5f6da39a4710c36330c0a3d0e7fba9
Author: Rainer Jung 
AuthorDate: Thu Apr 27 19:38:48 2023 +0200

Prepare new unit test class for AccessLogValve; give the existing one a 
more precise name
---
 .../{TestAccessLogValve.java => TestAccessLogValveDateFormatCache.java} | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java
similarity index 98%
rename from test/org/apache/catalina/valves/TestAccessLogValve.java
rename to test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java
index d4b76e43f0..f0e03591ff 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java
@@ -24,7 +24,7 @@ import java.util.TimeZone;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class TestAccessLogValve {
+public class TestAccessLogValveDateCache {
 
 // Note that there is a similar test:
 // org.apache.juli.TestDateFormatCache.testBug54044()


-
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: Prepare new unit test class for AccessLogValve; give the existing one a more precise name

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 432474e9b7 Prepare new unit test class for AccessLogValve; give the 
existing one a more precise name
432474e9b7 is described below

commit 432474e9b7ac98bed8d2179bd187942de4ed5dfd
Author: Rainer Jung 
AuthorDate: Thu Apr 27 19:38:17 2023 +0200

Prepare new unit test class for AccessLogValve; give the existing one a 
more precise name
---
 .../{TestAccessLogValve.java => TestAccessLogValveDateFormatCache.java} | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java
similarity index 98%
rename from test/org/apache/catalina/valves/TestAccessLogValve.java
rename to test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java
index d4b76e43f0..171f5cfcab 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java
@@ -24,7 +24,7 @@ import java.util.TimeZone;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class TestAccessLogValve {
+public class TestAccessLogValveDateFormatCache {
 
 // Note that there is a similar test:
 // org.apache.juli.TestDateFormatCache.testBug54044()


-
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: Prepare new unit test class for AccessLogValve; give the existing one a more precise name

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 ab64b621eb Prepare new unit test class for AccessLogValve; give the 
existing one a more precise name
ab64b621eb is described below

commit ab64b621ebdf93b7325f10c492ed1260cab42f5d
Author: Rainer Jung 
AuthorDate: Thu Apr 27 19:37:43 2023 +0200

Prepare new unit test class for AccessLogValve; give the existing one a 
more precise name
---
 .../{TestAccessLogValve.java => TestAccessLogValveDateFormatCache.java} | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java
similarity index 98%
rename from test/org/apache/catalina/valves/TestAccessLogValve.java
rename to test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java
index d4b76e43f0..171f5cfcab 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java
@@ -24,7 +24,7 @@ import java.util.TimeZone;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class TestAccessLogValve {
+public class TestAccessLogValveDateFormatCache {
 
 // Note that there is a similar test:
 // org.apache.juli.TestDateFormatCache.testBug54044()


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



[tomcat] branch main updated: Prepare new unit test class for AccessLogValve; give the existing one a more precise name

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 723de0eba1 Prepare new unit test class for AccessLogValve; give the 
existing one a more precise name
723de0eba1 is described below

commit 723de0eba14d42fbbba0a9bb47395dd25e7a89e7
Author: Rainer Jung 
AuthorDate: Thu Apr 27 19:36:48 2023 +0200

Prepare new unit test class for AccessLogValve; give the existing one a 
more precise name
---
 .../{TestAccessLogValve.java => TestAccessLogValveDateFormatCache.java} | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java 
b/test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java
similarity index 98%
rename from test/org/apache/catalina/valves/TestAccessLogValve.java
rename to test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java
index d4b76e43f0..171f5cfcab 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValveDateFormatCache.java
@@ -24,7 +24,7 @@ import java.util.TimeZone;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class TestAccessLogValve {
+public class TestAccessLogValveDateFormatCache {
 
 // Note that there is a similar test:
 // org.apache.juli.TestDateFormatCache.testBug54044()


-
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: Improve JsonAccessLogValve: support more patterns like for headers and attributes.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 5f010ee726 Improve JsonAccessLogValve: support more patterns like for 
headers and attributes.
5f010ee726 is described below

commit 5f010ee7262e91518ec3c20881fc0ffa0647f8b8
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:41:13 2023 +0200

Improve JsonAccessLogValve: support more patterns like for headers and 
attributes.

Those will be logged as sub objects.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 115 +++--
 webapps/docs/changelog.xml |   9 +-
 webapps/docs/config/valve.xml  |  32 --
 3 files changed, 137 insertions(+), 19 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index c7de7a47f0..2508814a83 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -57,6 +57,14 @@ import org.apache.tomcat.util.json.JSONFilter;
  * v: localServerName
  * I: threadName
  * X: connectionStatus
+ * %{xxx}a: remoteAddress-xxx
+ * %{xxx}p: port-xxx
+ * %{xxx}t: time-xxx
+ * %{xxx}c: cookies
+ * %{xxx}i: requestHeaders
+ * %{xxx}o: responseHeaders
+ * %{xxx}r: requestAttributes
+ * %{xxx}s: sessionAttributes
  * 
  * The attribute list is based on
  * 
https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin/parser_apache2.rb#L72
@@ -92,6 +100,18 @@ public class JsonAccessLogValve extends AccessLogValve {
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }
 
+private static final Map SUB_OBJECT_PATTERNS;
+static {
+// FIXME: finalize attribute names
+Map pattern2AttributeName = new HashMap<>();
+pattern2AttributeName.put(Character.valueOf('c'), "cookies");
+pattern2AttributeName.put(Character.valueOf('i'), "requestHeaders");
+pattern2AttributeName.put(Character.valueOf('o'), "responseHeaders");
+pattern2AttributeName.put(Character.valueOf('r'), "requestAttributes");
+pattern2AttributeName.put(Character.valueOf('s'), "sessionAttributes");
+SUB_OBJECT_PATTERNS = 
Collections.unmodifiableMap(pattern2AttributeName);
+}
+
 /**
  * write any char
  */
@@ -108,8 +128,28 @@ public class JsonAccessLogValve extends AccessLogValve {
 }
 }
 
+private boolean addSubkeyedItems(ListIterator iterator, 
List elements, String patternAttribute) {
+if (! elements.isEmpty()) {
+iterator.add(new StringElement("\"" + patternAttribute + "\": {"));
+for (JsonWrappedElement element: elements) {
+iterator.add(element);
+iterator.add(new CharElement(','));
+}
+iterator.previous();
+iterator.remove();
+iterator.add(new StringElement("},"));
+return true;
+}
+return false;
+}
+
 @Override
 protected AccessLogElement[] createLogElements() {
+Map> subTypeLists = new 
HashMap<>();
+for (Character pattern: SUB_OBJECT_PATTERNS.keySet()) {
+subTypeLists.put(pattern, new ArrayList());
+}
+boolean hasSub = false;
 List logElements = new 
ArrayList<>(Arrays.asList(super.createLogElements()));
 ListIterator lit = logElements.listIterator();
 lit.add(new CharElement('{'));
@@ -120,23 +160,58 @@ public class JsonAccessLogValve extends AccessLogValve {
 lit.remove();
 continue;
 }
-lit.add(new CharElement(','));
+// Remove items which should be written as
+// Json objects and add them later in correct order
+JsonWrappedElement wrappedLogElement = 
(JsonWrappedElement)logElement;
+AccessLogElement ale = wrappedLogElement.getDelegate();
+if (ale instanceof HeaderElement) {
+
subTypeLists.get(Character.valueOf('i')).add(wrappedLogElement);
+lit.remove();
+} else if (ale instanceof ResponseHeaderElement) {
+
subTypeLists.get(Character.valueOf('o')).add(wrappedLogElement);
+lit.remove();
+} else if (ale instanceof RequestAttributeElement) {
+
subTypeLists.get(Character.valueOf('r')).add(wrappedLogElement);
+lit.remove();
+} else if (ale instanceof SessionAttributeElement) {
+
subTypeLists.get(Character.valueOf('s')).add(wrappedLo

[tomcat] branch 9.0.x updated: Improve JsonAccessLogValve: support more patterns like for headers and attributes.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 76f43275c7 Improve JsonAccessLogValve: support more patterns like for 
headers and attributes.
76f43275c7 is described below

commit 76f43275c76f2ad21cb12a5a2c7f41e0d3e9225d
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:39:53 2023 +0200

Improve JsonAccessLogValve: support more patterns like for headers and 
attributes.

Those will be logged as sub objects.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 115 +++--
 webapps/docs/changelog.xml |   9 +-
 webapps/docs/config/valve.xml  |  32 --
 3 files changed, 137 insertions(+), 19 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index c7de7a47f0..f6162c8d70 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -57,6 +57,14 @@ import org.apache.tomcat.util.json.JSONFilter;
  * v: localServerName
  * I: threadName
  * X: connectionStatus
+ * %{xxx}a: remoteAddress-xxx
+ * %{xxx}p: port-xxx
+ * %{xxx}t: time-xxx
+ * %{xxx}c: cookies
+ * %{xxx}i: requestHeaders
+ * %{xxx}o: responseHeaders
+ * %{xxx}r: requestAttributes
+ * %{xxx}s: sessionAttributes
  * 
  * The attribute list is based on
  * 
https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin/parser_apache2.rb#L72
@@ -92,6 +100,18 @@ public class JsonAccessLogValve extends AccessLogValve {
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }
 
+private static final Map SUB_OBJECT_PATTERNS;
+static {
+// FIXME: finalize attribute names
+Map pattern2AttributeName = new HashMap<>();
+pattern2AttributeName.put(Character.valueOf('c'), "cookies");
+pattern2AttributeName.put(Character.valueOf('i'), "requestHeaders");
+pattern2AttributeName.put(Character.valueOf('o'), "responseHeaders");
+pattern2AttributeName.put(Character.valueOf('r'), "requestAttributes");
+pattern2AttributeName.put(Character.valueOf('s'), "sessionAttributes");
+SUB_OBJECT_PATTERNS = 
Collections.unmodifiableMap(pattern2AttributeName);
+}
+
 /**
  * write any char
  */
@@ -108,8 +128,28 @@ public class JsonAccessLogValve extends AccessLogValve {
 }
 }
 
+private boolean addSubkeyedItems(ListIterator iterator, 
List elements, String patternAttribute) {
+if (! elements.isEmpty()) {
+iterator.add(new StringElement("\"" + patternAttribute + "\": {"));
+for (JsonWrappedElement element: elements) {
+iterator.add(element);
+iterator.add(new CharElement(','));
+}
+iterator.previous();
+iterator.remove();
+iterator.add(new StringElement("},"));
+return true;
+}
+return false;
+}
+
 @Override
 protected AccessLogElement[] createLogElements() {
+Map> subTypeLists = new 
HashMap<>();
+for (Character pattern: SUB_OBJECT_PATTERNS.keySet()) {
+subTypeLists.put(pattern, new ArrayList<>());
+}
+boolean hasSub = false;
 List logElements = new 
ArrayList<>(Arrays.asList(super.createLogElements()));
 ListIterator lit = logElements.listIterator();
 lit.add(new CharElement('{'));
@@ -120,23 +160,58 @@ public class JsonAccessLogValve extends AccessLogValve {
 lit.remove();
 continue;
 }
-lit.add(new CharElement(','));
+// Remove items which should be written as
+// Json objects and add them later in correct order
+JsonWrappedElement wrappedLogElement = 
(JsonWrappedElement)logElement;
+AccessLogElement ale = wrappedLogElement.getDelegate();
+if (ale instanceof HeaderElement) {
+
subTypeLists.get(Character.valueOf('i')).add(wrappedLogElement);
+lit.remove();
+} else if (ale instanceof ResponseHeaderElement) {
+
subTypeLists.get(Character.valueOf('o')).add(wrappedLogElement);
+lit.remove();
+} else if (ale instanceof RequestAttributeElement) {
+
subTypeLists.get(Character.valueOf('r')).add(wrappedLogElement);
+lit.remove();
+} else if (ale instanceof SessionAttributeElement) {
+
subTypeLists.get(Character.valueOf(

[tomcat] branch 10.1.x updated: Improve JsonAccessLogValve: support more patterns like for headers and attributes.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 c95e5a3f92 Improve JsonAccessLogValve: support more patterns like for 
headers and attributes.
c95e5a3f92 is described below

commit c95e5a3f922157a8ec67fb26df038e578a9bdbaf
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:39:25 2023 +0200

Improve JsonAccessLogValve: support more patterns like for headers and 
attributes.

Those will be logged as sub objects.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 115 +++--
 webapps/docs/changelog.xml |   9 +-
 webapps/docs/config/valve.xml  |  32 --
 3 files changed, 137 insertions(+), 19 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index c7de7a47f0..f6162c8d70 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -57,6 +57,14 @@ import org.apache.tomcat.util.json.JSONFilter;
  * v: localServerName
  * I: threadName
  * X: connectionStatus
+ * %{xxx}a: remoteAddress-xxx
+ * %{xxx}p: port-xxx
+ * %{xxx}t: time-xxx
+ * %{xxx}c: cookies
+ * %{xxx}i: requestHeaders
+ * %{xxx}o: responseHeaders
+ * %{xxx}r: requestAttributes
+ * %{xxx}s: sessionAttributes
  * 
  * The attribute list is based on
  * 
https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin/parser_apache2.rb#L72
@@ -92,6 +100,18 @@ public class JsonAccessLogValve extends AccessLogValve {
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }
 
+private static final Map SUB_OBJECT_PATTERNS;
+static {
+// FIXME: finalize attribute names
+Map pattern2AttributeName = new HashMap<>();
+pattern2AttributeName.put(Character.valueOf('c'), "cookies");
+pattern2AttributeName.put(Character.valueOf('i'), "requestHeaders");
+pattern2AttributeName.put(Character.valueOf('o'), "responseHeaders");
+pattern2AttributeName.put(Character.valueOf('r'), "requestAttributes");
+pattern2AttributeName.put(Character.valueOf('s'), "sessionAttributes");
+SUB_OBJECT_PATTERNS = 
Collections.unmodifiableMap(pattern2AttributeName);
+}
+
 /**
  * write any char
  */
@@ -108,8 +128,28 @@ public class JsonAccessLogValve extends AccessLogValve {
 }
 }
 
+private boolean addSubkeyedItems(ListIterator iterator, 
List elements, String patternAttribute) {
+if (! elements.isEmpty()) {
+iterator.add(new StringElement("\"" + patternAttribute + "\": {"));
+for (JsonWrappedElement element: elements) {
+iterator.add(element);
+iterator.add(new CharElement(','));
+}
+iterator.previous();
+iterator.remove();
+iterator.add(new StringElement("},"));
+return true;
+}
+return false;
+}
+
 @Override
 protected AccessLogElement[] createLogElements() {
+Map> subTypeLists = new 
HashMap<>();
+for (Character pattern: SUB_OBJECT_PATTERNS.keySet()) {
+subTypeLists.put(pattern, new ArrayList<>());
+}
+boolean hasSub = false;
 List logElements = new 
ArrayList<>(Arrays.asList(super.createLogElements()));
 ListIterator lit = logElements.listIterator();
 lit.add(new CharElement('{'));
@@ -120,23 +160,58 @@ public class JsonAccessLogValve extends AccessLogValve {
 lit.remove();
 continue;
 }
-lit.add(new CharElement(','));
+// Remove items which should be written as
+// Json objects and add them later in correct order
+JsonWrappedElement wrappedLogElement = 
(JsonWrappedElement)logElement;
+AccessLogElement ale = wrappedLogElement.getDelegate();
+if (ale instanceof HeaderElement) {
+
subTypeLists.get(Character.valueOf('i')).add(wrappedLogElement);
+lit.remove();
+} else if (ale instanceof ResponseHeaderElement) {
+
subTypeLists.get(Character.valueOf('o')).add(wrappedLogElement);
+lit.remove();
+} else if (ale instanceof RequestAttributeElement) {
+
subTypeLists.get(Character.valueOf('r')).add(wrappedLogElement);
+lit.remove();
+} else if (ale instanceof SessionAttributeElement) {
+
subTypeLists.get(Character.valueOf(

[tomcat] branch main updated: Improve JsonAccessLogValve: support more patterns like for headers and attributes.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 26c55d239e Improve JsonAccessLogValve: support more patterns like for 
headers and attributes.
26c55d239e is described below

commit 26c55d239e14899840d7d4bb7db91081396536b9
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:38:55 2023 +0200

Improve JsonAccessLogValve: support more patterns like for headers and 
attributes.

Those will be logged as sub objects.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 115 +++--
 webapps/docs/changelog.xml |   9 +-
 webapps/docs/config/valve.xml  |  32 --
 3 files changed, 137 insertions(+), 19 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index c7de7a47f0..f6162c8d70 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -57,6 +57,14 @@ import org.apache.tomcat.util.json.JSONFilter;
  * v: localServerName
  * I: threadName
  * X: connectionStatus
+ * %{xxx}a: remoteAddress-xxx
+ * %{xxx}p: port-xxx
+ * %{xxx}t: time-xxx
+ * %{xxx}c: cookies
+ * %{xxx}i: requestHeaders
+ * %{xxx}o: responseHeaders
+ * %{xxx}r: requestAttributes
+ * %{xxx}s: sessionAttributes
  * 
  * The attribute list is based on
  * 
https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin/parser_apache2.rb#L72
@@ -92,6 +100,18 @@ public class JsonAccessLogValve extends AccessLogValve {
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }
 
+private static final Map SUB_OBJECT_PATTERNS;
+static {
+// FIXME: finalize attribute names
+Map pattern2AttributeName = new HashMap<>();
+pattern2AttributeName.put(Character.valueOf('c'), "cookies");
+pattern2AttributeName.put(Character.valueOf('i'), "requestHeaders");
+pattern2AttributeName.put(Character.valueOf('o'), "responseHeaders");
+pattern2AttributeName.put(Character.valueOf('r'), "requestAttributes");
+pattern2AttributeName.put(Character.valueOf('s'), "sessionAttributes");
+SUB_OBJECT_PATTERNS = 
Collections.unmodifiableMap(pattern2AttributeName);
+}
+
 /**
  * write any char
  */
@@ -108,8 +128,28 @@ public class JsonAccessLogValve extends AccessLogValve {
 }
 }
 
+private boolean addSubkeyedItems(ListIterator iterator, 
List elements, String patternAttribute) {
+if (! elements.isEmpty()) {
+iterator.add(new StringElement("\"" + patternAttribute + "\": {"));
+for (JsonWrappedElement element: elements) {
+iterator.add(element);
+iterator.add(new CharElement(','));
+}
+iterator.previous();
+iterator.remove();
+iterator.add(new StringElement("},"));
+return true;
+}
+return false;
+}
+
 @Override
 protected AccessLogElement[] createLogElements() {
+Map> subTypeLists = new 
HashMap<>();
+for (Character pattern: SUB_OBJECT_PATTERNS.keySet()) {
+subTypeLists.put(pattern, new ArrayList<>());
+}
+boolean hasSub = false;
 List logElements = new 
ArrayList<>(Arrays.asList(super.createLogElements()));
 ListIterator lit = logElements.listIterator();
 lit.add(new CharElement('{'));
@@ -120,23 +160,58 @@ public class JsonAccessLogValve extends AccessLogValve {
 lit.remove();
 continue;
 }
-lit.add(new CharElement(','));
+// Remove items which should be written as
+// Json objects and add them later in correct order
+JsonWrappedElement wrappedLogElement = 
(JsonWrappedElement)logElement;
+AccessLogElement ale = wrappedLogElement.getDelegate();
+if (ale instanceof HeaderElement) {
+
subTypeLists.get(Character.valueOf('i')).add(wrappedLogElement);
+lit.remove();
+} else if (ale instanceof ResponseHeaderElement) {
+
subTypeLists.get(Character.valueOf('o')).add(wrappedLogElement);
+lit.remove();
+} else if (ale instanceof RequestAttributeElement) {
+
subTypeLists.get(Character.valueOf('r')).add(wrappedLogElement);
+lit.remove();
+} else if (ale instanceof SessionAttributeElement) {
+
subTypeLists.get(Character.valueOf('s')).add(wra

[tomcat] branch 8.5.x updated: Remove redundant Json escaping of values in JsonAccessLogValve.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 0d658cac82 Remove redundant Json escaping of values in 
JsonAccessLogValve.
0d658cac82 is described below

commit 0d658cac8259ade2ed8dc25bb93931c15838cd9d
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:29:23 2023 +0200

Remove redundant Json escaping of values in JsonAccessLogValve.

The value escaping done in AbstractAccessLogValve is already
Json compliant.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 43 +-
 1 file changed, 1 insertion(+), 42 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index 4c71278fe9..c7de7a47f0 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -17,7 +17,6 @@
 package org.apache.catalina.valves;
 
 import java.io.CharArrayWriter;
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -140,40 +139,6 @@ public class JsonAccessLogValve extends AccessLogValve {
 return new JsonWrappedElement(attributeName, true, ale);
 }
 
-/**
- * JSON string escaping writer
- */
-private static class JsonCharArrayWriter extends CharArrayWriter {
-
-JsonCharArrayWriter(int i) {
-super(i);
-}
-
-@Override
-public void write(int c) {
-try {
-super.write(JSONFilter.escape((char) c));
-} catch (IOException e) {
-// ignore
-}
-}
-
-@Override
-public void write(char[] c, int off, int len) {
-try {
-super.write(JSONFilter.escape(new String(c, off, len)));
-} catch (IOException e) {
-// ignore
-}
-}
-
-@Override
-public void write(String str, int off, int len) {
-CharSequence escaped = JSONFilter.escape(str, off, len);
-super.write(escaped.toString(), 0, escaped.length());
-}
-}
-
 private static class JsonWrappedElement implements AccessLogElement, 
CachedElement {
 
 private CharSequence attributeName;
@@ -196,13 +161,7 @@ public class JsonAccessLogValve extends AccessLogValve {
 if (quoteValue) {
 buf.append('"');
 }
-CharArrayWriter valueWriter = new JsonCharArrayWriter(8);
-try {
-delegate.addElement(valueWriter, date, request, response, 
time);
-valueWriter.writeTo(buf);
-} catch (IOException e) {
-// ignore
-}
+delegate.addElement(buf, date, request, response, time);
 if (quoteValue) {
 buf.append('"');
 }


-
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: Remove redundant Json escaping of values in JsonAccessLogValve.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 098de46890 Remove redundant Json escaping of values in 
JsonAccessLogValve.
098de46890 is described below

commit 098de4689073e2ef71bba08139239cb6fe4abff6
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:28:59 2023 +0200

Remove redundant Json escaping of values in JsonAccessLogValve.

The value escaping done in AbstractAccessLogValve is already
Json compliant.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 43 +-
 1 file changed, 1 insertion(+), 42 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index 4c71278fe9..c7de7a47f0 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -17,7 +17,6 @@
 package org.apache.catalina.valves;
 
 import java.io.CharArrayWriter;
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -140,40 +139,6 @@ public class JsonAccessLogValve extends AccessLogValve {
 return new JsonWrappedElement(attributeName, true, ale);
 }
 
-/**
- * JSON string escaping writer
- */
-private static class JsonCharArrayWriter extends CharArrayWriter {
-
-JsonCharArrayWriter(int i) {
-super(i);
-}
-
-@Override
-public void write(int c) {
-try {
-super.write(JSONFilter.escape((char) c));
-} catch (IOException e) {
-// ignore
-}
-}
-
-@Override
-public void write(char[] c, int off, int len) {
-try {
-super.write(JSONFilter.escape(new String(c, off, len)));
-} catch (IOException e) {
-// ignore
-}
-}
-
-@Override
-public void write(String str, int off, int len) {
-CharSequence escaped = JSONFilter.escape(str, off, len);
-super.write(escaped.toString(), 0, escaped.length());
-}
-}
-
 private static class JsonWrappedElement implements AccessLogElement, 
CachedElement {
 
 private CharSequence attributeName;
@@ -196,13 +161,7 @@ public class JsonAccessLogValve extends AccessLogValve {
 if (quoteValue) {
 buf.append('"');
 }
-CharArrayWriter valueWriter = new JsonCharArrayWriter(8);
-try {
-delegate.addElement(valueWriter, date, request, response, 
time);
-valueWriter.writeTo(buf);
-} catch (IOException e) {
-// ignore
-}
+delegate.addElement(buf, date, request, response, time);
 if (quoteValue) {
 buf.append('"');
 }


-
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: Remove redundant Json escaping of values in JsonAccessLogValve.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 511ca79028 Remove redundant Json escaping of values in 
JsonAccessLogValve.
511ca79028 is described below

commit 511ca7902810d6d3b2b8457151bb66f2b57a4c3a
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:28:28 2023 +0200

Remove redundant Json escaping of values in JsonAccessLogValve.

The value escaping done in AbstractAccessLogValve is already
Json compliant.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 43 +-
 1 file changed, 1 insertion(+), 42 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index 4c71278fe9..c7de7a47f0 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -17,7 +17,6 @@
 package org.apache.catalina.valves;
 
 import java.io.CharArrayWriter;
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -140,40 +139,6 @@ public class JsonAccessLogValve extends AccessLogValve {
 return new JsonWrappedElement(attributeName, true, ale);
 }
 
-/**
- * JSON string escaping writer
- */
-private static class JsonCharArrayWriter extends CharArrayWriter {
-
-JsonCharArrayWriter(int i) {
-super(i);
-}
-
-@Override
-public void write(int c) {
-try {
-super.write(JSONFilter.escape((char) c));
-} catch (IOException e) {
-// ignore
-}
-}
-
-@Override
-public void write(char[] c, int off, int len) {
-try {
-super.write(JSONFilter.escape(new String(c, off, len)));
-} catch (IOException e) {
-// ignore
-}
-}
-
-@Override
-public void write(String str, int off, int len) {
-CharSequence escaped = JSONFilter.escape(str, off, len);
-super.write(escaped.toString(), 0, escaped.length());
-}
-}
-
 private static class JsonWrappedElement implements AccessLogElement, 
CachedElement {
 
 private CharSequence attributeName;
@@ -196,13 +161,7 @@ public class JsonAccessLogValve extends AccessLogValve {
 if (quoteValue) {
 buf.append('"');
 }
-CharArrayWriter valueWriter = new JsonCharArrayWriter(8);
-try {
-delegate.addElement(valueWriter, date, request, response, 
time);
-valueWriter.writeTo(buf);
-} catch (IOException e) {
-// ignore
-}
+delegate.addElement(buf, date, request, response, time);
 if (quoteValue) {
 buf.append('"');
 }


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



[tomcat] branch main updated: Remove redundant Json escaping of values in JsonAccessLogValve.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 b3294ebe45 Remove redundant Json escaping of values in 
JsonAccessLogValve.
b3294ebe45 is described below

commit b3294ebe45dbe4eeda7b112e5c52c0c89e50c1c9
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:28:07 2023 +0200

Remove redundant Json escaping of values in JsonAccessLogValve.

The value escaping done in AbstractAccessLogValve is already
Json compliant.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 43 +-
 1 file changed, 1 insertion(+), 42 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index 4c71278fe9..c7de7a47f0 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -17,7 +17,6 @@
 package org.apache.catalina.valves;
 
 import java.io.CharArrayWriter;
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -140,40 +139,6 @@ public class JsonAccessLogValve extends AccessLogValve {
 return new JsonWrappedElement(attributeName, true, ale);
 }
 
-/**
- * JSON string escaping writer
- */
-private static class JsonCharArrayWriter extends CharArrayWriter {
-
-JsonCharArrayWriter(int i) {
-super(i);
-}
-
-@Override
-public void write(int c) {
-try {
-super.write(JSONFilter.escape((char) c));
-} catch (IOException e) {
-// ignore
-}
-}
-
-@Override
-public void write(char[] c, int off, int len) {
-try {
-super.write(JSONFilter.escape(new String(c, off, len)));
-} catch (IOException e) {
-// ignore
-}
-}
-
-@Override
-public void write(String str, int off, int len) {
-CharSequence escaped = JSONFilter.escape(str, off, len);
-super.write(escaped.toString(), 0, escaped.length());
-}
-}
-
 private static class JsonWrappedElement implements AccessLogElement, 
CachedElement {
 
 private CharSequence attributeName;
@@ -196,13 +161,7 @@ public class JsonAccessLogValve extends AccessLogValve {
 if (quoteValue) {
 buf.append('"');
 }
-CharArrayWriter valueWriter = new JsonCharArrayWriter(8);
-try {
-delegate.addElement(valueWriter, date, request, response, 
time);
-valueWriter.writeTo(buf);
-} catch (IOException e) {
-// ignore
-}
+delegate.addElement(buf, date, request, response, time);
 if (quoteValue) {
 buf.append('"');
 }


-
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: Use alphabetical order, remove comment. No functional change.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 66a10e29f5 Use alphabetical order, remove comment. No functional 
change.
66a10e29f5 is described below

commit 66a10e29f54e3d20d47d8f49ee39adfe23571a64
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:20:25 2023 +0200

Use alphabetical order, remove comment. No functional change.
---
 java/org/apache/catalina/valves/JsonAccessLogValve.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index bd4fb91da4..4c71278fe9 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -70,12 +70,13 @@ public class JsonAccessLogValve extends AccessLogValve {
 Map pattern2AttributeName = new HashMap<>();
 pattern2AttributeName.put(Character.valueOf('a'), "remoteAddr");
 pattern2AttributeName.put(Character.valueOf('A'), "localAddr");
-pattern2AttributeName.put(Character.valueOf('b'), "size"); /* byteSent 
-> size */
+pattern2AttributeName.put(Character.valueOf('b'), "size");
 pattern2AttributeName.put(Character.valueOf('B'), "byteSentNC");
 pattern2AttributeName.put(Character.valueOf('D'), "elapsedTime");
 pattern2AttributeName.put(Character.valueOf('F'), "firstByteTime");
 pattern2AttributeName.put(Character.valueOf('h'), "host");
 pattern2AttributeName.put(Character.valueOf('H'), "protocol");
+pattern2AttributeName.put(Character.valueOf('I'), "threadName");
 pattern2AttributeName.put(Character.valueOf('l'), "logicalUserName");
 pattern2AttributeName.put(Character.valueOf('m'), "method");
 pattern2AttributeName.put(Character.valueOf('p'), "port");
@@ -83,12 +84,11 @@ public class JsonAccessLogValve extends AccessLogValve {
 pattern2AttributeName.put(Character.valueOf('r'), "request");
 pattern2AttributeName.put(Character.valueOf('s'), "statusCode");
 pattern2AttributeName.put(Character.valueOf('S'), "sessionId");
-pattern2AttributeName.put(Character.valueOf('t'), "time"); /* dateTime 
-> time */
+pattern2AttributeName.put(Character.valueOf('t'), "time");
 pattern2AttributeName.put(Character.valueOf('T'), "elapsedTimeS");
 pattern2AttributeName.put(Character.valueOf('u'), "user");
-pattern2AttributeName.put(Character.valueOf('U'), "path"); /* 
requestURI -> path */
+pattern2AttributeName.put(Character.valueOf('U'), "path");
 pattern2AttributeName.put(Character.valueOf('v'), "localServerName");
-pattern2AttributeName.put(Character.valueOf('I'), "threadName");
 pattern2AttributeName.put(Character.valueOf('X'), "connectionStatus");
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }


-
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: Use alphabetical order, remove comment. No functional change.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 c9951fd374 Use alphabetical order, remove comment. No functional 
change.
c9951fd374 is described below

commit c9951fd374da0bda63af67d86cc224ebef70b972
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:20:08 2023 +0200

Use alphabetical order, remove comment. No functional change.
---
 java/org/apache/catalina/valves/JsonAccessLogValve.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index bd4fb91da4..4c71278fe9 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -70,12 +70,13 @@ public class JsonAccessLogValve extends AccessLogValve {
 Map pattern2AttributeName = new HashMap<>();
 pattern2AttributeName.put(Character.valueOf('a'), "remoteAddr");
 pattern2AttributeName.put(Character.valueOf('A'), "localAddr");
-pattern2AttributeName.put(Character.valueOf('b'), "size"); /* byteSent 
-> size */
+pattern2AttributeName.put(Character.valueOf('b'), "size");
 pattern2AttributeName.put(Character.valueOf('B'), "byteSentNC");
 pattern2AttributeName.put(Character.valueOf('D'), "elapsedTime");
 pattern2AttributeName.put(Character.valueOf('F'), "firstByteTime");
 pattern2AttributeName.put(Character.valueOf('h'), "host");
 pattern2AttributeName.put(Character.valueOf('H'), "protocol");
+pattern2AttributeName.put(Character.valueOf('I'), "threadName");
 pattern2AttributeName.put(Character.valueOf('l'), "logicalUserName");
 pattern2AttributeName.put(Character.valueOf('m'), "method");
 pattern2AttributeName.put(Character.valueOf('p'), "port");
@@ -83,12 +84,11 @@ public class JsonAccessLogValve extends AccessLogValve {
 pattern2AttributeName.put(Character.valueOf('r'), "request");
 pattern2AttributeName.put(Character.valueOf('s'), "statusCode");
 pattern2AttributeName.put(Character.valueOf('S'), "sessionId");
-pattern2AttributeName.put(Character.valueOf('t'), "time"); /* dateTime 
-> time */
+pattern2AttributeName.put(Character.valueOf('t'), "time");
 pattern2AttributeName.put(Character.valueOf('T'), "elapsedTimeS");
 pattern2AttributeName.put(Character.valueOf('u'), "user");
-pattern2AttributeName.put(Character.valueOf('U'), "path"); /* 
requestURI -> path */
+pattern2AttributeName.put(Character.valueOf('U'), "path");
 pattern2AttributeName.put(Character.valueOf('v'), "localServerName");
-pattern2AttributeName.put(Character.valueOf('I'), "threadName");
 pattern2AttributeName.put(Character.valueOf('X'), "connectionStatus");
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }


-
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: Use alphabetical order, remove comment. No functional change.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 161abb8018 Use alphabetical order, remove comment. No functional 
change.
161abb8018 is described below

commit 161abb801896b96d002a79a3b74d0960021e5fd8
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:19:44 2023 +0200

Use alphabetical order, remove comment. No functional change.
---
 java/org/apache/catalina/valves/JsonAccessLogValve.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index bd4fb91da4..4c71278fe9 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -70,12 +70,13 @@ public class JsonAccessLogValve extends AccessLogValve {
 Map pattern2AttributeName = new HashMap<>();
 pattern2AttributeName.put(Character.valueOf('a'), "remoteAddr");
 pattern2AttributeName.put(Character.valueOf('A'), "localAddr");
-pattern2AttributeName.put(Character.valueOf('b'), "size"); /* byteSent 
-> size */
+pattern2AttributeName.put(Character.valueOf('b'), "size");
 pattern2AttributeName.put(Character.valueOf('B'), "byteSentNC");
 pattern2AttributeName.put(Character.valueOf('D'), "elapsedTime");
 pattern2AttributeName.put(Character.valueOf('F'), "firstByteTime");
 pattern2AttributeName.put(Character.valueOf('h'), "host");
 pattern2AttributeName.put(Character.valueOf('H'), "protocol");
+pattern2AttributeName.put(Character.valueOf('I'), "threadName");
 pattern2AttributeName.put(Character.valueOf('l'), "logicalUserName");
 pattern2AttributeName.put(Character.valueOf('m'), "method");
 pattern2AttributeName.put(Character.valueOf('p'), "port");
@@ -83,12 +84,11 @@ public class JsonAccessLogValve extends AccessLogValve {
 pattern2AttributeName.put(Character.valueOf('r'), "request");
 pattern2AttributeName.put(Character.valueOf('s'), "statusCode");
 pattern2AttributeName.put(Character.valueOf('S'), "sessionId");
-pattern2AttributeName.put(Character.valueOf('t'), "time"); /* dateTime 
-> time */
+pattern2AttributeName.put(Character.valueOf('t'), "time");
 pattern2AttributeName.put(Character.valueOf('T'), "elapsedTimeS");
 pattern2AttributeName.put(Character.valueOf('u'), "user");
-pattern2AttributeName.put(Character.valueOf('U'), "path"); /* 
requestURI -> path */
+pattern2AttributeName.put(Character.valueOf('U'), "path");
 pattern2AttributeName.put(Character.valueOf('v'), "localServerName");
-pattern2AttributeName.put(Character.valueOf('I'), "threadName");
 pattern2AttributeName.put(Character.valueOf('X'), "connectionStatus");
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }


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



[tomcat] branch main updated: Use alphabetical order, remove comment. No functional change.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 074e6437d1 Use alphabetical order, remove comment. No functional 
change.
074e6437d1 is described below

commit 074e6437d1af139afdd453832a775134c2620f17
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:18:57 2023 +0200

Use alphabetical order, remove comment. No functional change.
---
 java/org/apache/catalina/valves/JsonAccessLogValve.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index bd4fb91da4..4c71278fe9 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -70,12 +70,13 @@ public class JsonAccessLogValve extends AccessLogValve {
 Map pattern2AttributeName = new HashMap<>();
 pattern2AttributeName.put(Character.valueOf('a'), "remoteAddr");
 pattern2AttributeName.put(Character.valueOf('A'), "localAddr");
-pattern2AttributeName.put(Character.valueOf('b'), "size"); /* byteSent 
-> size */
+pattern2AttributeName.put(Character.valueOf('b'), "size");
 pattern2AttributeName.put(Character.valueOf('B'), "byteSentNC");
 pattern2AttributeName.put(Character.valueOf('D'), "elapsedTime");
 pattern2AttributeName.put(Character.valueOf('F'), "firstByteTime");
 pattern2AttributeName.put(Character.valueOf('h'), "host");
 pattern2AttributeName.put(Character.valueOf('H'), "protocol");
+pattern2AttributeName.put(Character.valueOf('I'), "threadName");
 pattern2AttributeName.put(Character.valueOf('l'), "logicalUserName");
 pattern2AttributeName.put(Character.valueOf('m'), "method");
 pattern2AttributeName.put(Character.valueOf('p'), "port");
@@ -83,12 +84,11 @@ public class JsonAccessLogValve extends AccessLogValve {
 pattern2AttributeName.put(Character.valueOf('r'), "request");
 pattern2AttributeName.put(Character.valueOf('s'), "statusCode");
 pattern2AttributeName.put(Character.valueOf('S'), "sessionId");
-pattern2AttributeName.put(Character.valueOf('t'), "time"); /* dateTime 
-> time */
+pattern2AttributeName.put(Character.valueOf('t'), "time");
 pattern2AttributeName.put(Character.valueOf('T'), "elapsedTimeS");
 pattern2AttributeName.put(Character.valueOf('u'), "user");
-pattern2AttributeName.put(Character.valueOf('U'), "path"); /* 
requestURI -> path */
+pattern2AttributeName.put(Character.valueOf('U'), "path");
 pattern2AttributeName.put(Character.valueOf('v'), "localServerName");
-pattern2AttributeName.put(Character.valueOf('I'), "threadName");
 pattern2AttributeName.put(Character.valueOf('X'), "connectionStatus");
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }


-
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: Switch from locally defined AccessLogElement to new parametrized CharElement.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 87746e188d Switch from locally defined AccessLogElement to new 
parametrized CharElement.
87746e188d is described below

commit 87746e188d380eead3171288e6d5ad4adfab4510
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:11:29 2023 +0200

Switch from locally defined AccessLogElement to new parametrized 
CharElement.

It is more consistent with all other output
and eases backports.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 34 --
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index c2564f9778..bd4fb91da4 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -93,15 +93,27 @@ public class JsonAccessLogValve extends AccessLogValve {
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }
 
+/**
+ * write any char
+ */
+protected static class CharElement implements AccessLogElement {
+private final char ch;
+
+public CharElement(char ch) {
+this.ch = ch;
+}
+
+@Override
+public void addElement(CharArrayWriter buf, Date date, Request 
request, Response response, long time) {
+buf.write(ch);
+}
+}
+
 @Override
 protected AccessLogElement[] createLogElements() {
 List logElements = new 
ArrayList<>(Arrays.asList(super.createLogElements()));
 ListIterator lit = logElements.listIterator();
-lit.add(new AccessLogElement() {
-@Override
-public void addElement(CharArrayWriter buf, Date date, Request 
request, Response response, long time) {
-buf.write('{');
-}});
+lit.add(new CharElement('{'));
 while (lit.hasNext()) {
 AccessLogElement logElement = lit.next();
 // remove all other elements, like StringElements
@@ -109,20 +121,12 @@ public class JsonAccessLogValve extends AccessLogValve {
 lit.remove();
 continue;
 }
-lit.add(new AccessLogElement() {
-@Override
-public void addElement(CharArrayWriter buf, Date date, Request 
request, Response response, long time) {
-buf.write(',');
-}});
+lit.add(new CharElement(','));
 }
 // remove last comma again
 lit.previous();
 lit.remove();
-lit.add(new AccessLogElement() {
-@Override
-public void addElement(CharArrayWriter buf, Date date, Request 
request, Response response, long time) {
-buf.write('}');
-}});
+lit.add(new CharElement('}'));
 return logElements.toArray(new AccessLogElement[logElements.size()]);
 }
 


-
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: Switch from lambda to new parametrized CharElement.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 4516a266ed Switch from lambda to new parametrized CharElement.
4516a266ed is described below

commit 4516a266ed9b8242b443d74f14b324721f73c836
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:09:29 2023 +0200

Switch from lambda to new parametrized CharElement.

It is more consistent with all other output
and eases backports.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 22 +++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index 2a56d1763e..bd4fb91da4 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -93,11 +93,27 @@ public class JsonAccessLogValve extends AccessLogValve {
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }
 
+/**
+ * write any char
+ */
+protected static class CharElement implements AccessLogElement {
+private final char ch;
+
+public CharElement(char ch) {
+this.ch = ch;
+}
+
+@Override
+public void addElement(CharArrayWriter buf, Date date, Request 
request, Response response, long time) {
+buf.write(ch);
+}
+}
+
 @Override
 protected AccessLogElement[] createLogElements() {
 List logElements = new 
ArrayList<>(Arrays.asList(super.createLogElements()));
 ListIterator lit = logElements.listIterator();
-lit.add((buf, date, req, resp, time) -> buf.write('{'));
+lit.add(new CharElement('{'));
 while (lit.hasNext()) {
 AccessLogElement logElement = lit.next();
 // remove all other elements, like StringElements
@@ -105,12 +121,12 @@ public class JsonAccessLogValve extends AccessLogValve {
 lit.remove();
 continue;
 }
-lit.add((buf, date, req, resp, time) -> buf.write(','));
+lit.add(new CharElement(','));
 }
 // remove last comma again
 lit.previous();
 lit.remove();
-lit.add((buf, date, req, resp, time) -> buf.write('}'));
+lit.add(new CharElement('}'));
 return logElements.toArray(new AccessLogElement[logElements.size()]);
 }
 


-
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: Switch from lambda to new parametrized CharElement.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 ad0177cfbb Switch from lambda to new parametrized CharElement.
ad0177cfbb is described below

commit ad0177cfbb29dd1751bb612327f52b6e188bd116
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:08:55 2023 +0200

Switch from lambda to new parametrized CharElement.

It is more consistent with all other output
and eases backports.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 22 +++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index 2a56d1763e..bd4fb91da4 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -93,11 +93,27 @@ public class JsonAccessLogValve extends AccessLogValve {
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }
 
+/**
+ * write any char
+ */
+protected static class CharElement implements AccessLogElement {
+private final char ch;
+
+public CharElement(char ch) {
+this.ch = ch;
+}
+
+@Override
+public void addElement(CharArrayWriter buf, Date date, Request 
request, Response response, long time) {
+buf.write(ch);
+}
+}
+
 @Override
 protected AccessLogElement[] createLogElements() {
 List logElements = new 
ArrayList<>(Arrays.asList(super.createLogElements()));
 ListIterator lit = logElements.listIterator();
-lit.add((buf, date, req, resp, time) -> buf.write('{'));
+lit.add(new CharElement('{'));
 while (lit.hasNext()) {
 AccessLogElement logElement = lit.next();
 // remove all other elements, like StringElements
@@ -105,12 +121,12 @@ public class JsonAccessLogValve extends AccessLogValve {
 lit.remove();
 continue;
 }
-lit.add((buf, date, req, resp, time) -> buf.write(','));
+lit.add(new CharElement(','));
 }
 // remove last comma again
 lit.previous();
 lit.remove();
-lit.add((buf, date, req, resp, time) -> buf.write('}'));
+lit.add(new CharElement('}'));
 return logElements.toArray(new AccessLogElement[logElements.size()]);
 }
 


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



[tomcat] branch main updated: Switch from lambda to new parametrized CharElement.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 91f07c1cb8 Switch from lambda to new parametrized CharElement.
91f07c1cb8 is described below

commit 91f07c1cb8ac9ea494c032fd787003f3799b5cdd
Author: Rainer Jung 
AuthorDate: Thu Apr 27 10:05:28 2023 +0200

Switch from lambda to new parametrized CharElement.

It is more consistent with all other output
and eases backports.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 22 +++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index 2a56d1763e..bd4fb91da4 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -93,11 +93,27 @@ public class JsonAccessLogValve extends AccessLogValve {
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }
 
+/**
+ * write any char
+ */
+protected static class CharElement implements AccessLogElement {
+private final char ch;
+
+public CharElement(char ch) {
+this.ch = ch;
+}
+
+@Override
+public void addElement(CharArrayWriter buf, Date date, Request 
request, Response response, long time) {
+buf.write(ch);
+}
+}
+
 @Override
 protected AccessLogElement[] createLogElements() {
 List logElements = new 
ArrayList<>(Arrays.asList(super.createLogElements()));
 ListIterator lit = logElements.listIterator();
-lit.add((buf, date, req, resp, time) -> buf.write('{'));
+lit.add(new CharElement('{'));
 while (lit.hasNext()) {
 AccessLogElement logElement = lit.next();
 // remove all other elements, like StringElements
@@ -105,12 +121,12 @@ public class JsonAccessLogValve extends AccessLogValve {
 lit.remove();
 continue;
 }
-lit.add((buf, date, req, resp, time) -> buf.write(','));
+lit.add(new CharElement(','));
 }
 // remove last comma again
 lit.previous();
 lit.remove();
-lit.add((buf, date, req, resp, time) -> buf.write('}'));
+lit.add(new CharElement('}'));
 return logElements.toArray(new AccessLogElement[logElements.size()]);
 }
 


-
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 docs.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 f2daf9447d Fix docs.
f2daf9447d is described below

commit f2daf9447dabba9a3760dea0b096ffa186c99200
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:57:10 2023 +0200

Fix docs.
---
 webapps/docs/config/valve.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index c7ac4bcc92..210abc1dd4 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -370,7 +370,7 @@
 " is escaped as \"
 \ is escaped as \\
 Standard C escaping are used for \f, \n,
-\r, \t and \v
+\r and \t
 Any other control characters or characters with code points above 127
 are encoded using the standard Java unicode escaping
 (\u)


-
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 docs.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 c057ab63ba Fix docs.
c057ab63ba is described below

commit c057ab63ba3c4e9f4ef9051c6f1419d0cc729930
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:56:47 2023 +0200

Fix docs.
---
 webapps/docs/config/valve.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 895c9291f9..9f1f6b41da 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -370,7 +370,7 @@
 " is escaped as \"
 \ is escaped as \\
 Standard C escaping are used for \f, \n,
-\r, \t and \v
+\r and \t
 Any other control characters or characters with code points above 127
 are encoded using the standard Java unicode escaping
 (\u)


-
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 docs.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 daacbf38e2 Fix docs.
daacbf38e2 is described below

commit daacbf38e269361d4e74b619a18026e1af2544a1
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:56:31 2023 +0200

Fix docs.
---
 webapps/docs/config/valve.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 6170c474c3..85394d25b8 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -369,7 +369,7 @@
 " is escaped as \"
 \ is escaped as \\
 Standard C escaping are used for \f, \n,
-\r, \t and \v
+\r and \t
 Any other control characters or characters with code points above 127
 are encoded using the standard Java unicode escaping
 (\u)


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



[tomcat] branch main updated: Fix docs.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 f755fd0552 Fix docs.
f755fd0552 is described below

commit f755fd0552d0ad7dd181fd16694ebb12a5189616
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:56:09 2023 +0200

Fix docs.
---
 webapps/docs/config/valve.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index c0af86da54..c618045949 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -369,7 +369,7 @@
 " is escaped as \"
 \ is escaped as \\
 Standard C escaping are used for \f, \n,
-\r, \t and \v
+\r and \t
 Any other control characters or characters with code points above 127
 are encoded using the standard Java unicode escaping
 (\u)


-
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: Improve performance of escaping in AccessLogValve roughly by a factor of two.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 4fa9bb3418 Improve performance of escaping in AccessLogValve roughly 
by a factor of two.
4fa9bb3418 is described below

commit 4fa9bb34180af33602b01c8515290a26171c4f7a
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:54:29 2023 +0200

Improve performance of escaping in AccessLogValve roughly by a factor of 
two.

- this is in the hot code path
- move most of the special cases behind the typical case of characters
  which do not need escaping
- as long as we encounter characters that to not need escaping,
  don't output them char by char but instead remember where this
  char sequence started and output them all at once when the next
  char which needs escaping is encountered (or at the end of the input).
---
 .../catalina/valves/AbstractAccessLogValve.java| 93 +++---
 .../valves/TestAbstractAccessLogValveEscape.java   |  9 ++-
 webapps/docs/changelog.xml |  4 +
 3 files changed, 77 insertions(+), 29 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index e2f50f83eb..7b49fc6bbd 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1867,37 +1867,74 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 return;
 }
 
-for (char c : input.toCharArray()) {
-switch (c) {
-// " and \
-case '\\':
-dest.append("");
-break;
-case '\"':
-dest.append("\\\"");
-break;
-// Standard C escapes for whitespace (not all standard C 
escapes)
-case '\f':
-dest.append("\\f");
-break;
-case '\n':
-dest.append("\\n");
-break;
-case '\r':
-dest.append("\\r");
-break;
-case '\t':
-dest.append("\\t");
-break;
-default:
-// Control, delete (127) or above 127
-if (c < 32 || c > 126) {
+int len = input.length();
+// As long as we don't encounter chars that need escaping,
+// we only remember start and length of that string part.
+// "next" is the start of the string part containing these chars,
+// "current - 1" is its end. So writing from "next" with length
+// "current - next" writes that part.
+// We write that part whenever we find a character to escape and the
+// unchanged and unwritten string part is not empty.
+int next = 0;
+char c;
+for (int current = 0; current < len; current++) {
+c = input.charAt(current);
+// Fast path
+if (c >= 32 && c < 127) {
+// special case " and \
+switch (c) {
+case '\\': // dec 92
+// Write unchanged string parts
+if (current > next) {
+dest.write(input, next, current - next);
+}
+next = current + 1;
+dest.append("");
+break;
+case '\"': // dec 34
+// Write unchanged string parts
+if (current > next) {
+dest.write(input, next, current - next);
+}
+next = current + 1;
+dest.append("\\\"");
+break;
+// Don't output individual unchanged chars,
+// write the sub string only when the first char to encode
+// is encountered plus at the end.
+default:
+}
+// Control (1-31), delete (127) or above 127
+} else {
+// Write unchanged string parts
+if (current > next) {
+dest.write(input, next, current - next);
+}
+next = current + 1;
+switch (c) {
+//

[tomcat] branch 9.0.x updated: Improve performance of escaping in AccessLogValve roughly by a factor of two.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 275a1b1c1f Improve performance of escaping in AccessLogValve roughly 
by a factor of two.
275a1b1c1f is described below

commit 275a1b1c1fadd996987be075304640393298dde8
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:53:58 2023 +0200

Improve performance of escaping in AccessLogValve roughly by a factor of 
two.

- this is in the hot code path
- move most of the special cases behind the typical case of characters
  which do not need escaping
- as long as we encounter characters that to not need escaping,
  don't output them char by char but instead remember where this
  char sequence started and output them all at once when the next
  char which needs escaping is encountered (or at the end of the input).
---
 .../catalina/valves/AbstractAccessLogValve.java| 93 +++---
 .../valves/TestAbstractAccessLogValveEscape.java   |  9 ++-
 webapps/docs/changelog.xml |  4 +
 3 files changed, 77 insertions(+), 29 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index c285fd7d66..567d5c1f1c 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1858,37 +1858,74 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 return;
 }
 
-for (char c : input.toCharArray()) {
-switch (c) {
-// " and \
-case '\\':
-dest.append("");
-break;
-case '\"':
-dest.append("\\\"");
-break;
-// Standard C escapes for whitespace (not all standard C 
escapes)
-case '\f':
-dest.append("\\f");
-break;
-case '\n':
-dest.append("\\n");
-break;
-case '\r':
-dest.append("\\r");
-break;
-case '\t':
-dest.append("\\t");
-break;
-default:
-// Control, delete (127) or above 127
-if (c < 32 || c > 126) {
+int len = input.length();
+// As long as we don't encounter chars that need escaping,
+// we only remember start and length of that string part.
+// "next" is the start of the string part containing these chars,
+// "current - 1" is its end. So writing from "next" with length
+// "current - next" writes that part.
+// We write that part whenever we find a character to escape and the
+// unchanged and unwritten string part is not empty.
+int next = 0;
+char c;
+for (int current = 0; current < len; current++) {
+c = input.charAt(current);
+// Fast path
+if (c >= 32 && c < 127) {
+// special case " and \
+switch (c) {
+case '\\': // dec 92
+// Write unchanged string parts
+if (current > next) {
+dest.write(input, next, current - next);
+}
+next = current + 1;
+dest.append("");
+break;
+case '\"': // dec 34
+// Write unchanged string parts
+if (current > next) {
+dest.write(input, next, current - next);
+}
+next = current + 1;
+dest.append("\\\"");
+break;
+// Don't output individual unchanged chars,
+// write the sub string only when the first char to encode
+// is encountered plus at the end.
+default:
+}
+// Control (1-31), delete (127) or above 127
+} else {
+// Write unchanged string parts
+if (current > next) {
+dest.write(input, next, current - next);
+}
+next = current + 1;
+switch (c) {
+//

[tomcat] branch 10.1.x updated: Improve performance of escaping in AccessLogValve roughly by a factor of two.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 41f1fd5806 Improve performance of escaping in AccessLogValve roughly 
by a factor of two.
41f1fd5806 is described below

commit 41f1fd58066fc07fc43f0d4bb8d686c85e8344ec
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:53:29 2023 +0200

Improve performance of escaping in AccessLogValve roughly by a factor of 
two.

- this is in the hot code path
- move most of the special cases behind the typical case of characters
  which do not need escaping
- as long as we encounter characters that to not need escaping,
  don't output them char by char but instead remember where this
  char sequence started and output them all at once when the next
  char which needs escaping is encountered (or at the end of the input).
---
 .../catalina/valves/AbstractAccessLogValve.java| 93 +++---
 .../valves/TestAbstractAccessLogValveEscape.java   |  9 ++-
 webapps/docs/changelog.xml |  4 +
 3 files changed, 77 insertions(+), 29 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 31dad68d7b..f44df79e3c 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1865,37 +1865,74 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 return;
 }
 
-for (char c : input.toCharArray()) {
-switch (c) {
-// " and \
-case '\\':
-dest.append("");
-break;
-case '\"':
-dest.append("\\\"");
-break;
-// Standard C escapes for whitespace (not all standard C 
escapes)
-case '\f':
-dest.append("\\f");
-break;
-case '\n':
-dest.append("\\n");
-break;
-case '\r':
-dest.append("\\r");
-break;
-case '\t':
-dest.append("\\t");
-break;
-default:
-// Control, delete (127) or above 127
-if (c < 32 || c > 126) {
+int len = input.length();
+// As long as we don't encounter chars that need escaping,
+// we only remember start and length of that string part.
+// "next" is the start of the string part containing these chars,
+// "current - 1" is its end. So writing from "next" with length
+// "current - next" writes that part.
+// We write that part whenever we find a character to escape and the
+// unchanged and unwritten string part is not empty.
+int next = 0;
+char c;
+for (int current = 0; current < len; current++) {
+c = input.charAt(current);
+// Fast path
+if (c >= 32 && c < 127) {
+// special case " and \
+switch (c) {
+case '\\': // dec 92
+// Write unchanged string parts
+if (current > next) {
+dest.write(input, next, current - next);
+}
+next = current + 1;
+dest.append("");
+break;
+case '\"': // dec 34
+// Write unchanged string parts
+if (current > next) {
+dest.write(input, next, current - next);
+}
+next = current + 1;
+dest.append("\\\"");
+break;
+// Don't output individual unchanged chars,
+// write the sub string only when the first char to encode
+// is encountered plus at the end.
+default:
+}
+// Control (1-31), delete (127) or above 127
+} else {
+// Write unchanged string parts
+if (current > next) {
+dest.write(input, next, current - next);
+}
+next = current + 1;
+switch (c) {
+//

[tomcat] branch main updated: Improve performance of escaping in AccessLogValve roughly by a factor of two.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 8b387612fd Improve performance of escaping in AccessLogValve roughly 
by a factor of two.
8b387612fd is described below

commit 8b387612fdebe6ed2ca9090bd01e99ec85ae7689
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:50:35 2023 +0200

Improve performance of escaping in AccessLogValve roughly by a factor of 
two.

- this is in the hot code path
- move most of the special cases behind the typical case of characters
  which do not need escaping
- as long as we encounter characters that to not need escaping,
  don't output them char by char but instead remember where this
  char sequence started and output them all at once when the next
  char which needs escaping is encountered (or at the end of the input).
---
 .../catalina/valves/AbstractAccessLogValve.java| 93 +++---
 .../valves/TestAbstractAccessLogValveEscape.java   |  9 ++-
 webapps/docs/changelog.xml |  4 +
 3 files changed, 77 insertions(+), 29 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 49ab94e6c5..699aca5ef6 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1863,37 +1863,74 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 return;
 }
 
-for (char c : input.toCharArray()) {
-switch (c) {
-// " and \
-case '\\':
-dest.append("");
-break;
-case '\"':
-dest.append("\\\"");
-break;
-// Standard C escapes for whitespace (not all standard C 
escapes)
-case '\f':
-dest.append("\\f");
-break;
-case '\n':
-dest.append("\\n");
-break;
-case '\r':
-dest.append("\\r");
-break;
-case '\t':
-dest.append("\\t");
-break;
-default:
-// Control, delete (127) or above 127
-if (c < 32 || c > 126) {
+int len = input.length();
+// As long as we don't encounter chars that need escaping,
+// we only remember start and length of that string part.
+// "next" is the start of the string part containing these chars,
+// "current - 1" is its end. So writing from "next" with length
+// "current - next" writes that part.
+// We write that part whenever we find a character to escape and the
+// unchanged and unwritten string part is not empty.
+int next = 0;
+char c;
+for (int current = 0; current < len; current++) {
+c = input.charAt(current);
+// Fast path
+if (c >= 32 && c < 127) {
+// special case " and \
+switch (c) {
+case '\\': // dec 92
+// Write unchanged string parts
+if (current > next) {
+dest.write(input, next, current - next);
+}
+next = current + 1;
+dest.append("");
+break;
+case '\"': // dec 34
+// Write unchanged string parts
+if (current > next) {
+dest.write(input, next, current - next);
+}
+next = current + 1;
+dest.append("\\\"");
+break;
+// Don't output individual unchanged chars,
+// write the sub string only when the first char to encode
+// is encountered plus at the end.
+default:
+}
+// Control (1-31), delete (127) or above 127
+} else {
+// Write unchanged string parts
+if (current > next) {
+dest.write(input, next, current - next);
+}
+next = current + 1;
+switch (c) {
+//

[tomcat] branch 8.5.x updated: Change output of vertical tab in AccessLogValve from "\v" to "\u000b".

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 d11e8c30f0 Change output of vertical tab in AccessLogValve from "\v" 
to "\u000b".
d11e8c30f0 is described below

commit d11e8c30f05ce23797f4f8fb8966c1d0dac29278
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:46:28 2023 +0200

Change output of vertical tab in AccessLogValve from "\v" to "\u000b".
---
 java/org/apache/catalina/valves/AbstractAccessLogValve.java | 3 ---
 webapps/docs/changelog.xml  | 4 
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index cfe5b7000f..e2f50f83eb 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1889,9 +1889,6 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 case '\t':
 dest.append("\\t");
 break;
-case '\u000b':
-dest.append("\\v");
-break;
 default:
 // Control, delete (127) or above 127
 if (c < 32 || c > 126) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 687386346c..85d425e699 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -116,6 +116,10 @@
 SimpleDateFormat is used which contains verbatim
 characters that need escaping. (rjung)
   
+  
+    Change output of vertical tab in AccessLogValve from
+   \v to \u000b. (rjung)
+  
 
   
   


-
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: Change output of vertical tab in AccessLogValve from "\v" to "\u000b".

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 5759f7887e Change output of vertical tab in AccessLogValve from "\v" 
to "\u000b".
5759f7887e is described below

commit 5759f7887e4a291c251651af4e40355d2ddc0639
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:46:00 2023 +0200

Change output of vertical tab in AccessLogValve from "\v" to "\u000b".
---
 java/org/apache/catalina/valves/AbstractAccessLogValve.java | 3 ---
 webapps/docs/changelog.xml  | 4 
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 6bebc34cfa..c285fd7d66 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1880,9 +1880,6 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 case '\t':
 dest.append("\\t");
 break;
-case '\u000b':
-dest.append("\\v");
-break;
 default:
 // Control, delete (127) or above 127
 if (c < 32 || c > 126) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 05e0dac669..72870aa8df 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -116,6 +116,10 @@
 SimpleDateFormat is used which contains verbatim
 characters that need escaping. (rjung)
   
+  
+    Change output of vertical tab in AccessLogValve from
+   \v to \u000b. (rjung)
+  
 
   
   


-
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: Change output of vertical tab in AccessLogValve from "\v" to "\u000b".

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 b087a1883c Change output of vertical tab in AccessLogValve from "\v" 
to "\u000b".
b087a1883c is described below

commit b087a1883cdfcbbf540fa6b45123278b92d41c2b
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:45:35 2023 +0200

Change output of vertical tab in AccessLogValve from "\v" to "\u000b".
---
 java/org/apache/catalina/valves/AbstractAccessLogValve.java | 3 ---
 webapps/docs/changelog.xml  | 4 
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index c996948171..31dad68d7b 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1887,9 +1887,6 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 case '\t':
 dest.append("\\t");
 break;
-case '\u000b':
-dest.append("\\v");
-break;
 default:
 // Control, delete (127) or above 127
 if (c < 32 || c > 126) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4da62e5c5a..c542f11c91 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -116,6 +116,10 @@
 SimpleDateFormat is used which contains verbatim
 characters that need escaping. (rjung)
   
+  
+    Change output of vertical tab in AccessLogValve from
+   \v to \u000b. (rjung)
+  
 
   
   


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



[tomcat] branch main updated: Change output of vertical tab in AccessLogValve from "\v" to "\u000b".

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 7b3a825265 Change output of vertical tab in AccessLogValve from "\v" 
to "\u000b".
7b3a825265 is described below

commit 7b3a8252652d8f357929752bdf40311c8e8cac79
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:44:21 2023 +0200

Change output of vertical tab in AccessLogValve from "\v" to "\u000b".
---
 java/org/apache/catalina/valves/AbstractAccessLogValve.java | 3 ---
 webapps/docs/changelog.xml  | 4 
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index c0955f0051..49ab94e6c5 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1885,9 +1885,6 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 case '\t':
 dest.append("\\t");
 break;
-case '\u000b':
-dest.append("\\v");
-break;
 default:
 // Control, delete (127) or above 127
 if (c < 32 || c > 126) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 5b460212bb..695b00dbc2 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -116,6 +116,10 @@
 SimpleDateFormat is used which contains verbatim
 characters that need escaping. (rjung)
   
+  
+    Change output of vertical tab in AccessLogValve from
+   \v to \u000b. (rjung)
+  
 
   
   


-
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: Add changelog entry

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 ebd56c3de7 Add changelog entry
ebd56c3de7 is described below

commit ebd56c3de7b0fb10a7ce950ee028ffa80741d8d0
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:40:24 2023 +0200

Add changelog entry
---
 webapps/docs/changelog.xml | 5 +
 1 file changed, 5 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8ad32892d2..687386346c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -111,6 +111,11 @@
 66567: Fix missing IllegalArgumentException
 after the Tomcat code was converted to using URI instead of URL. (remm)
   
+  
+Escape timestamp output in AccessLogValve if a
+SimpleDateFormat is used which contains verbatim
+characters that need escaping. (rjung)
+  
 
   
   


-
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: Add changelog entry

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 e83c34d2b9 Add changelog entry
e83c34d2b9 is described below

commit e83c34d2b97d360bec02eed1cad5198be7ee4a99
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:40:07 2023 +0200

Add changelog entry
---
 webapps/docs/changelog.xml | 5 +
 1 file changed, 5 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 1b8bb1122a..05e0dac669 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -111,6 +111,11 @@
 66567: Fix missing IllegalArgumentException
 after the Tomcat code was converted to using URI instead of URL. (remm)
   
+  
+Escape timestamp output in AccessLogValve if a
+SimpleDateFormat is used which contains verbatim
+characters that need escaping. (rjung)
+  
 
   
   


-
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: Add changelog entry

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 798766045e Add changelog entry
798766045e is described below

commit 798766045e0942f29c585330c655e9e1c497743c
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:39:45 2023 +0200

Add changelog entry
---
 webapps/docs/changelog.xml | 5 +
 1 file changed, 5 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index d9badc751b..4da62e5c5a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -111,6 +111,11 @@
 66567: Fix missing IllegalArgumentException
 after the Tomcat code was converted to using URI instead of URL. (remm)
   
+  
+Escape timestamp output in AccessLogValve if a
+SimpleDateFormat is used which contains verbatim
+characters that need escaping. (rjung)
+  
 
   
   


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



[tomcat] branch main updated: Add changelog entry

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 c6cb5a89dc Add changelog entry
c6cb5a89dc is described below

commit c6cb5a89dc94cdfdaf749bf5b4bccc08ccda7aaa
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:39:30 2023 +0200

Add changelog entry
---
 webapps/docs/changelog.xml | 5 +
 1 file changed, 5 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8eaf0fabf8..5b460212bb 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -111,6 +111,11 @@
 66567: Fix missing IllegalArgumentException
 after the Tomcat code was converted to using URI instead of URL. (remm)
   
+  
+Escape timestamp output in AccessLogValve if a
+SimpleDateFormat is used which contains verbatim
+characters that need escaping. (rjung)
+  
 
   
   


-
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: Escape timestamp output in AccessLog.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 28253ccaf4 Escape timestamp output in AccessLog.
28253ccaf4 is described below

commit 28253ccaf4b607db168e64c4bf7c9f1179a98806
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:32:44 2023 +0200

Escape timestamp output in AccessLog.

It is needed if a SimpleDateFormat is used which contains
verbatim characters that need escaping.
---
 .../apache/catalina/valves/AbstractAccessLogValve.java | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 7d923cdb7a..cfe5b7000f 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1047,6 +1047,8 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 
 /* Our format description string, null if CLF */
 private final String format;
+/* Does the format string contain characters we need to escape */
+private final boolean needsEscaping;
 /* Whether to use begin of request or end of response as the timestamp 
*/
 private final boolean usesBegin;
 /* The format type */
@@ -1085,6 +1087,16 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 
 protected DateAndTimeElement(String sdf) {
 String format = sdf;
+boolean needsEscaping = false;
+if (sdf != null) {
+CharArrayWriter writer = new CharArrayWriter();
+escapeAndAppend(sdf, writer);
+String escaped = writer.toString();
+if (!escaped.equals(sdf)) {
+needsEscaping = true;
+}
+}
+this.needsEscaping = needsEscaping;
 boolean usesBegin = false;
 FormatType type = FormatType.CLF;
 
@@ -1169,7 +1181,11 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 temp = temp.replace(tripleMsecPattern, tripleMsec);
 temp = temp.replace(msecPattern, Long.toString(frac));
 }
-buf.append(temp);
+if (needsEscaping) {
+escapeAndAppend(temp, buf);
+} else {
+buf.append(temp);
+}
 }
 }
 }


-
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: Escape timestamp output in AccessLog.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 e896fd34d2 Escape timestamp output in AccessLog.
e896fd34d2 is described below

commit e896fd34d20e9b23f57e8b26551983fc04163c00
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:32:13 2023 +0200

Escape timestamp output in AccessLog.

It is needed if a SimpleDateFormat is used which contains
verbatim characters that need escaping.
---
 .../apache/catalina/valves/AbstractAccessLogValve.java | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 87784a205e..6bebc34cfa 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1038,6 +1038,8 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 
 /* Our format description string, null if CLF */
 private final String format;
+/* Does the format string contain characters we need to escape */
+private final boolean needsEscaping;
 /* Whether to use begin of request or end of response as the timestamp 
*/
 private final boolean usesBegin;
 /* The format type */
@@ -1076,6 +1078,16 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 
 protected DateAndTimeElement(String sdf) {
 String format = sdf;
+boolean needsEscaping = false;
+if (sdf != null) {
+CharArrayWriter writer = new CharArrayWriter();
+escapeAndAppend(sdf, writer);
+String escaped = writer.toString();
+if (!escaped.equals(sdf)) {
+needsEscaping = true;
+}
+}
+this.needsEscaping = needsEscaping;
 boolean usesBegin = false;
 FormatType type = FormatType.CLF;
 
@@ -1160,7 +1172,11 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 temp = temp.replace(tripleMsecPattern, tripleMsec);
 temp = temp.replace(msecPattern, Long.toString(frac));
 }
-buf.append(temp);
+if (needsEscaping) {
+escapeAndAppend(temp, buf);
+} else {
+buf.append(temp);
+}
 }
 }
 }


-
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: Escape timestamp output in AccessLog.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 a326a53a9a Escape timestamp output in AccessLog.
a326a53a9a is described below

commit a326a53a9a132757dead071ce2159fdac9156c4f
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:31:33 2023 +0200

Escape timestamp output in AccessLog.

It is needed if a SimpleDateFormat is used which contains
verbatim characters that need escaping.
---
 .../apache/catalina/valves/AbstractAccessLogValve.java | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index b947a912a5..c996948171 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1036,6 +1036,8 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 
 /* Our format description string, null if CLF */
 private final String format;
+/* Does the format string contain characters we need to escape */
+private final boolean needsEscaping;
 /* Whether to use begin of request or end of response as the timestamp 
*/
 private final boolean usesBegin;
 /* The format type */
@@ -1074,6 +1076,16 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 
 protected DateAndTimeElement(String sdf) {
 String format = sdf;
+boolean needsEscaping = false;
+if (sdf != null) {
+CharArrayWriter writer = new CharArrayWriter();
+escapeAndAppend(sdf, writer);
+String escaped = writer.toString();
+if (!escaped.equals(sdf)) {
+needsEscaping = true;
+}
+}
+this.needsEscaping = needsEscaping;
 boolean usesBegin = false;
 FormatType type = FormatType.CLF;
 
@@ -1158,7 +1170,11 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 temp = temp.replace(tripleMsecPattern, tripleMsec);
 temp = temp.replace(msecPattern, Long.toString(frac));
 }
-buf.append(temp);
+if (needsEscaping) {
+escapeAndAppend(temp, buf);
+} else {
+buf.append(temp);
+}
 }
 }
 }


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



[tomcat] branch main updated: Escape timestamp output in AccessLog.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 05243d39d9 Escape timestamp output in AccessLog.
05243d39d9 is described below

commit 05243d39d9161b4293d6aa2151e6a6b7a43daf40
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:29:52 2023 +0200

Escape timestamp output in AccessLog.

It is needed if a SimpleDateFormat is used which contains
verbatim characters that need escaping.
---
 .../apache/catalina/valves/AbstractAccessLogValve.java | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 03eb9908a4..c0955f0051 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1036,6 +1036,8 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 
 /* Our format description string, null if CLF */
 private final String format;
+/* Does the format string contain characters we need to escape */
+private final boolean needsEscaping;
 /* Whether to use begin of request or end of response as the timestamp 
*/
 private final boolean usesBegin;
 /* The format type */
@@ -1074,6 +1076,16 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 
 protected DateAndTimeElement(String sdf) {
 String format = sdf;
+boolean needsEscaping = false;
+if (sdf != null) {
+CharArrayWriter writer = new CharArrayWriter();
+escapeAndAppend(sdf, writer);
+String escaped = writer.toString();
+if (!escaped.equals(sdf)) {
+needsEscaping = true;
+}
+}
+this.needsEscaping = needsEscaping;
 boolean usesBegin = false;
 FormatType type = FormatType.CLF;
 
@@ -1155,7 +1167,11 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 temp = temp.replace(tripleMsecPattern, tripleMsec);
 temp = temp.replace(msecPattern, Long.toString(frac));
 }
-buf.append(temp);
+if (needsEscaping) {
+escapeAndAppend(temp, buf);
+} else {
+buf.append(temp);
+}
 break;
 }
 }


-
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: Rename some parameters. No functional change.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 160b1f67db Rename some parameters. No functional change.
160b1f67db is described below

commit 160b1f67db9fe60ce22835dc3bad2be7f9b2d490
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:26:36 2023 +0200

Rename some parameters. No functional change.

Instead of "header" (copy-and-pasted) use something more sensible.
---
 .../catalina/valves/AbstractAccessLogValve.java  | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index f04ee3f70f..7d923cdb7a 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1083,8 +1083,8 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 return result.toString();
 }
 
-protected DateAndTimeElement(String header) {
-String format = header;
+protected DateAndTimeElement(String sdf) {
+String format = sdf;
 boolean usesBegin = false;
 FormatType type = FormatType.CLF;
 
@@ -1560,17 +1560,17 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
  * write an attribute in the ServletRequest - %{xxx}r
  */
 protected static class RequestAttributeElement implements AccessLogElement 
{
-private final String header;
+private final String attribute;
 
-public RequestAttributeElement(String header) {
-this.header = header;
+public RequestAttributeElement(String attribute) {
+this.attribute = attribute;
 }
 
 @Override
 public void addElement(CharArrayWriter buf, Date date, Request 
request, Response response, long time) {
 Object value = null;
 if (request != null) {
-value = request.getAttribute(header);
+value = request.getAttribute(attribute);
 } else {
 value = "??";
 }
@@ -1590,10 +1590,10 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
  * write an attribute in the HttpSession - %{xxx}s
  */
 protected static class SessionAttributeElement implements AccessLogElement 
{
-private final String header;
+private final String attribute;
 
-public SessionAttributeElement(String header) {
-this.header = header;
+public SessionAttributeElement(String attribute) {
+this.attribute = attribute;
 }
 
 @Override
@@ -1602,7 +1602,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 if (null != request) {
 HttpSession sess = request.getSession(false);
 if (null != sess) {
-value = sess.getAttribute(header);
+value = sess.getAttribute(attribute);
 }
 } else {
 value = "??";


-
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: Rename some parameters. No functional change.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 d8cf34d113 Rename some parameters. No functional change.
d8cf34d113 is described below

commit d8cf34d113a418fba63ca5411f8d26c94723c0f1
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:26:01 2023 +0200

Rename some parameters. No functional change.

Instead of "header" (copy-and-pasted) use something more sensible.
---
 .../catalina/valves/AbstractAccessLogValve.java  | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 1569701020..87784a205e 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1074,8 +1074,8 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 return result.toString();
 }
 
-protected DateAndTimeElement(String header) {
-String format = header;
+protected DateAndTimeElement(String sdf) {
+String format = sdf;
 boolean usesBegin = false;
 FormatType type = FormatType.CLF;
 
@@ -1551,17 +1551,17 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
  * write an attribute in the ServletRequest - %{xxx}r
  */
 protected static class RequestAttributeElement implements AccessLogElement 
{
-private final String header;
+private final String attribute;
 
-public RequestAttributeElement(String header) {
-this.header = header;
+public RequestAttributeElement(String attribute) {
+this.attribute = attribute;
 }
 
 @Override
 public void addElement(CharArrayWriter buf, Date date, Request 
request, Response response, long time) {
 Object value = null;
 if (request != null) {
-value = request.getAttribute(header);
+value = request.getAttribute(attribute);
 } else {
 value = "??";
 }
@@ -1581,10 +1581,10 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
  * write an attribute in the HttpSession - %{xxx}s
  */
 protected static class SessionAttributeElement implements AccessLogElement 
{
-private final String header;
+private final String attribute;
 
-public SessionAttributeElement(String header) {
-this.header = header;
+public SessionAttributeElement(String attribute) {
+this.attribute = attribute;
 }
 
 @Override
@@ -1593,7 +1593,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 if (null != request) {
 HttpSession sess = request.getSession(false);
 if (null != sess) {
-value = sess.getAttribute(header);
+value = sess.getAttribute(attribute);
 }
 } else {
 value = "??";


-
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: Rename some parameters. No functional change.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 35e543b3a2 Rename some parameters. No functional change.
35e543b3a2 is described below

commit 35e543b3a2b7e7a7f48208d9d8085c31bc447200
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:24:59 2023 +0200

Rename some parameters. No functional change.

Instead of "header" (copy-and-pasted) use something more sensible.
---
 .../catalina/valves/AbstractAccessLogValve.java  | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 88b3541cb8..b947a912a5 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1072,8 +1072,8 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 return result.toString();
 }
 
-protected DateAndTimeElement(String header) {
-String format = header;
+protected DateAndTimeElement(String sdf) {
+String format = sdf;
 boolean usesBegin = false;
 FormatType type = FormatType.CLF;
 
@@ -1549,17 +1549,17 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
  * write an attribute in the ServletRequest - %{xxx}r
  */
 protected static class RequestAttributeElement implements AccessLogElement 
{
-private final String header;
+private final String attribute;
 
-public RequestAttributeElement(String header) {
-this.header = header;
+public RequestAttributeElement(String attribute) {
+this.attribute = attribute;
 }
 
 @Override
 public void addElement(CharArrayWriter buf, Date date, Request 
request, Response response, long time) {
 Object value = null;
 if (request != null) {
-value = request.getAttribute(header);
+value = request.getAttribute(attribute);
 } else {
 value = "??";
 }
@@ -1579,10 +1579,10 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
  * write an attribute in the HttpSession - %{xxx}s
  */
 protected static class SessionAttributeElement implements AccessLogElement 
{
-private final String header;
+private final String attribute;
 
-public SessionAttributeElement(String header) {
-this.header = header;
+public SessionAttributeElement(String attribute) {
+this.attribute = attribute;
 }
 
 @Override
@@ -1591,7 +1591,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 if (null != request) {
 HttpSession sess = request.getSession(false);
 if (null != sess) {
-value = sess.getAttribute(header);
+value = sess.getAttribute(attribute);
 }
 } else {
 value = "??";


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



[tomcat] branch main updated: Rename some parameters. No functional change.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 1e2d8bba9e Rename some parameters. No functional change.
1e2d8bba9e is described below

commit 1e2d8bba9e0e9c03d780020d2fa31e0030fb77f5
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:23:33 2023 +0200

Rename some parameters. No functional change.

Instead of "header" (copy-and-pasted) use something more sensible.
---
 .../catalina/valves/AbstractAccessLogValve.java  | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 371dc3d550..03eb9908a4 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1072,8 +1072,8 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 return result.toString();
 }
 
-protected DateAndTimeElement(String header) {
-String format = header;
+protected DateAndTimeElement(String sdf) {
+String format = sdf;
 boolean usesBegin = false;
 FormatType type = FormatType.CLF;
 
@@ -1547,17 +1547,17 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
  * write an attribute in the ServletRequest - %{xxx}r
  */
 protected static class RequestAttributeElement implements AccessLogElement 
{
-private final String header;
+private final String attribute;
 
-public RequestAttributeElement(String header) {
-this.header = header;
+public RequestAttributeElement(String attribute) {
+this.attribute = attribute;
 }
 
 @Override
 public void addElement(CharArrayWriter buf, Date date, Request 
request, Response response, long time) {
 Object value = null;
 if (request != null) {
-value = request.getAttribute(header);
+value = request.getAttribute(attribute);
 } else {
 value = "??";
 }
@@ -1577,10 +1577,10 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
  * write an attribute in the HttpSession - %{xxx}s
  */
 protected static class SessionAttributeElement implements AccessLogElement 
{
-private final String header;
+private final String attribute;
 
-public SessionAttributeElement(String header) {
-this.header = header;
+public SessionAttributeElement(String attribute) {
+this.attribute = attribute;
 }
 
 @Override
@@ -1589,7 +1589,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
 if (null != request) {
 HttpSession sess = request.getSession(false);
 if (null != sess) {
-value = sess.getAttribute(header);
+value = sess.getAttribute(attribute);
 }
 } else {
 value = "??";


-
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: Improve docs for access log valves.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 b81f7f20a0 Improve docs for access log valves.
b81f7f20a0 is described below

commit b81f7f20a02a516042498a020c5c898a430ae20d
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:17:34 2023 +0200

Improve docs for access log valves.

- sort pattern identifier lists alphabetically.
  Easier to find things than in a mxied alphabetical/context sorted list.
- document special cases (handling of unknown pattern indentifiers)
- list limitations of JsonAccessLogValve
- remove redundant field value info from JsonAccessLogValve,
  refer to AccessLogValve values instead.
---
 webapps/docs/config/valve.xml | 58 +--
 1 file changed, 39 insertions(+), 19 deletions(-)

diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 960759f0b4..c7ac4bcc92 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -288,9 +288,14 @@
 %A - Local IP address
 %b - Bytes sent, excluding HTTP headers, or '-' if 
zero
 %B - Bytes sent, excluding HTTP headers
+%D - Time taken to process the request in millis. 
Note: In
+httpd %D is microseconds. Behaviour will be aligned to httpd
+in Tomcat 10 onwards.
+%F - Time taken to commit the response, in 
milliseconds
 %h - Remote host name (or IP address if
 enableLookups for the connector is false)
 %H - Request protocol
+%I - Current request thread name (can compare 
later with stacktraces)
 %l - Remote logical username from identd (always 
returns
 '-')
 %m - Request method (GET, POST, etc.)
@@ -301,18 +306,13 @@
 %s - HTTP status code of the response
 %S - User session ID
 %t - Date and time, in Common Log Format
-%u - Remote user that was authenticated (if any), 
else '-' (escaped if required)
-%U - Requested URL path
-%v - Local server name
-%D - Time taken to process the request in millis. 
Note: In
-httpd %D is microseconds. Behaviour will be aligned to httpd
-in Tomcat 10 onwards.
 %T - Time taken to process the request, in 
seconds. Note: This
 value has millisecond resolution whereas in httpd it has
 second resolution. Behaviour will be align to httpd
 in Tomcat 10 onwards.
-%F - Time taken to commit the response, in 
milliseconds
-%I - Current request thread name (can compare 
later with stacktraces)
+%u - Remote user that was authenticated (if any), 
else '-' (escaped if required)
+%U - Requested URL path
+%v - Local server name
 %X - Connection status when response is completed:
   
 X = Connection aborted before the response 
completed.
@@ -336,8 +336,8 @@
 %{xxx}i write value of incoming header with name 
xxx (escaped if required)
 %{xxx}o write value of outgoing header with name 
xxx (escaped if required)
 %{xxx}c write value of cookie(s) with name 
xxx (comma separated and escaped if required)
-%{xxx}r write value of ServletRequest attribute 
with name xxx (escaped if required)
-%{xxx}s write value of HttpSession attribute with 
name xxx (escaped if required)
+%{xxx}r write value of ServletRequest attribute 
with name xxx (escaped if required, value ?? if 
request is null)
+%{xxx}s write value of HttpSession attribute with 
name xxx (escaped if required, value ?? if request is 
null)
 %{xxx}p write local (server) port 
(xxx==local) or
 remote (client) port (xxx=remote)
 %{xxx}t write timestamp at the end of the request 
formatted using the
@@ -384,6 +384,10 @@
 appends the values of the Referer and User-Agent
 headers, each in double quotes, to the common pattern.
 
+Fields using unknown pattern identifiers will be logged as 
???X???
+where X is the unknown identifier. Fields with unknown 
pattern identifier
+plus {xxx} key will be logged as ???.
+
 When Tomcat is operating behind a reverse proxy, the client information
 logged by the Access Log Valve may represent the reverse proxy, the browser
 or some combination of the two depending on the configuration of Tomcat and
@@ -509,9 +513,9 @@
   
 
 The JSON Access Log Valve extends the
-Access Log Valve class, and so
+Access Log Valve, and so
 uses the same self-contained logging logic.  This means it
-implements many of the same file handling attributes.  The main
+implements the same file handling attributes.  The main
 difference to the standard AccessLogValve is that
 JsonAccessLogValve creates log files which
 follow the JSON syntax as defined by
@@ -536,18 +540,32 @@
 
 
 
-While the pattern supported are the same as for the regu

[tomcat] branch 8.5.x updated: Improve optical readability.

2023-04-27 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 806f89d851 Improve optical readability.
806f89d851 is described below

commit 806f89d85152ca2907dea3f9d34ad2d81b02eb51
Author: Rainer Jung 
AuthorDate: Thu Apr 27 09:16:28 2023 +0200

Improve optical readability.

Lower case "l" and upper case "I" look very similar.
Use same improved code styling for JsonAccessLogValve
pattern table that is already used for AccessLogValve.
---
 webapps/docs/config/valve.xml | 44 +--
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 237fe29154..960759f0b4 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -540,28 +540,28 @@
 those are mapped to specific JSON attribute names. The attributes are the
 following:
 
-a: remoteAddr
-A: localAddr
-b: size (byteSent: size)
-B: byteSentNC
-D: elapsedTime
-F: firstByteTime
-h: host
-H: protocol
-l: logicalUserName
-m: method
-p: port
-q: query
-r: request
-s: statusCode
-S: sessionId
-t: time (dateTime: time)
-T: elapsedTimeS
-u: user
-U: path (requestURI: path)
-v: localServerName
-I: threadName
-X: connectionStatus
+%a: remoteAddr
+%A: localAddr
+%b: size (byteSent: size)
+%B: byteSentNC
+%D: elapsedTime
+%F: firstByteTime
+%h: host
+%H: protocol
+%l: logicalUserName
+%m: method
+%p: port
+%q: query
+%r: request
+%s: statusCode
+%S: sessionId
+%t: time (dateTime: time)
+%T: elapsedTimeS
+%u: user
+%U: path (requestURI: path)
+%v: localServerName
+%I: threadName
+%X: connectionStatus
 
 
 


-
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: Improve docs for access log valves.

2023-04-21 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 c7e83cfda1 Improve docs for access log valves.
c7e83cfda1 is described below

commit c7e83cfda180888ee5308e90a6fd5f1c23e6bf89
Author: Rainer Jung 
AuthorDate: Fri Apr 21 13:48:12 2023 +0200

Improve docs for access log valves.

- sort pattern identifier lists alphabetically.
  Easier to find things than in a mxied alphabetical/context sorted list.
- document special cases (handling of unknown pattern indentifiers)
- list limitations of JsonAccessLogValve
- remove redundant field value info from JsonAccessLogValve,
  refer to AccessLogValve values instead.
---
 webapps/docs/config/valve.xml | 58 +--
 1 file changed, 39 insertions(+), 19 deletions(-)

diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 936c02b227..895c9291f9 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -288,9 +288,14 @@
 %A - Local IP address
 %b - Bytes sent, excluding HTTP headers, or '-' if 
zero
 %B - Bytes sent, excluding HTTP headers
+%D - Time taken to process the request in millis. 
Note: In
+httpd %D is microseconds. Behaviour will be aligned to httpd
+in Tomcat 10 onwards.
+%F - Time taken to commit the response, in 
milliseconds
 %h - Remote host name (or IP address if
 enableLookups for the connector is false)
 %H - Request protocol
+%I - Current request thread name (can compare 
later with stacktraces)
 %l - Remote logical username from identd (always 
returns
 '-')
 %m - Request method (GET, POST, etc.)
@@ -301,18 +306,13 @@
 %s - HTTP status code of the response
 %S - User session ID
 %t - Date and time, in Common Log Format
-%u - Remote user that was authenticated (if any), 
else '-' (escaped if required)
-%U - Requested URL path
-%v - Local server name
-%D - Time taken to process the request in millis. 
Note: In
-httpd %D is microseconds. Behaviour will be aligned to httpd
-in Tomcat 10 onwards.
 %T - Time taken to process the request, in 
seconds. Note: This
 value has millisecond resolution whereas in httpd it has
 second resolution. Behaviour will be align to httpd
 in Tomcat 10 onwards.
-%F - Time taken to commit the response, in 
milliseconds
-%I - Current request thread name (can compare 
later with stacktraces)
+%u - Remote user that was authenticated (if any), 
else '-' (escaped if required)
+%U - Requested URL path
+%v - Local server name
 %X - Connection status when response is completed:
   
 X = Connection aborted before the response 
completed.
@@ -336,8 +336,8 @@
 %{xxx}i write value of incoming header with name 
xxx (escaped if required)
 %{xxx}o write value of outgoing header with name 
xxx (escaped if required)
 %{xxx}c write value of cookie(s) with name 
xxx (comma separated and escaped if required)
-%{xxx}r write value of ServletRequest attribute 
with name xxx (escaped if required)
-%{xxx}s write value of HttpSession attribute with 
name xxx (escaped if required)
+%{xxx}r write value of ServletRequest attribute 
with name xxx (escaped if required, value ?? if 
request is null)
+%{xxx}s write value of HttpSession attribute with 
name xxx (escaped if required, value ?? if request is 
null)
 %{xxx}p write local (server) port 
(xxx==local) or
 remote (client) port (xxx=remote)
 %{xxx}t write timestamp at the end of the request 
formatted using the
@@ -384,6 +384,10 @@
 appends the values of the Referer and User-Agent
 headers, each in double quotes, to the common pattern.
 
+Fields using unknown pattern identifiers will be logged as 
???X???
+where X is the unknown identifier. Fields with unknown 
pattern identifier
+plus {xxx} key will be logged as ???.
+
 When Tomcat is operating behind a reverse proxy, the client information
 logged by the Access Log Valve may represent the reverse proxy, the browser
 or some combination of the two depending on the configuration of Tomcat and
@@ -509,9 +513,9 @@
   
 
 The JSON Access Log Valve extends the
-Access Log Valve class, and so
+Access Log Valve, and so
 uses the same self-contained logging logic.  This means it
-implements many of the same file handling attributes.  The main
+implements the same file handling attributes.  The main
 difference to the standard AccessLogValve is that
 JsonAccessLogValve creates log files which
 follow the JSON syntax as defined by
@@ -536,18 +540,32 @@
 
 
 
-While the pattern supported are the same as for the regu

[tomcat] branch 10.1.x updated: Improve docs for access log valves.

2023-04-21 Thread rjung
This is an automated email from the ASF dual-hosted git repository.

rjung 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 e536d39387 Improve docs for access log valves.
e536d39387 is described below

commit e536d3938768f89d5580ff9d0083d988c7d66890
Author: Rainer Jung 
AuthorDate: Fri Apr 21 13:45:47 2023 +0200

Improve docs for access log valves.

- sort pattern identifier lists alphabetically.
  Easier to find things than in a mxied alphabetical/context sorted list.
- document special cases (handling of unknown pattern indentifiers)
- list limitations of JsonAccessLogValve
- remove redundant field value info from JsonAccessLogValve,
  refer to AccessLogValve values instead.
---
 webapps/docs/config/valve.xml | 50 ++-
 1 file changed, 35 insertions(+), 15 deletions(-)

diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index f065a2181a..6170c474c3 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -288,9 +288,12 @@
 %A - Local IP address
 %b - Bytes sent, excluding HTTP headers, or '-' if 
zero
 %B - Bytes sent, excluding HTTP headers
+%D - Time taken to process the request in 
microseconds
+%F - Time taken to commit the response, in 
milliseconds
 %h - Remote host name (or IP address if
 enableLookups for the connector is false)
 %H - Request protocol
+%I - Current request thread name (can compare 
later with stacktraces)
 %l - Remote logical username from identd (always 
returns
 '-')
 %m - Request method (GET, POST, etc.)
@@ -301,13 +304,10 @@
 %s - HTTP status code of the response
 %S - User session ID
 %t - Date and time, in Common Log Format
+%T - Time taken to process the request, in 
seconds
 %u - Remote user that was authenticated (if any), 
else '-' (escaped if required)
 %U - Requested URL path
 %v - Local server name
-%D - Time taken to process the request in 
microseconds
-%T - Time taken to process the request, in 
seconds
-%F - Time taken to commit the response, in 
milliseconds
-%I - Current request thread name (can compare 
later with stacktraces)
 %X - Connection status when response is completed:
   
   X = Connection aborted before the response 
completed.
@@ -331,8 +331,8 @@
 %{xxx}i write value of incoming header with name 
xxx (escaped if required)
 %{xxx}o write value of outgoing header with name 
xxx (escaped if required)
 %{xxx}c write value of cookie(s) with name 
xxx (comma separated and escaped if required)
-%{xxx}r write value of ServletRequest attribute 
with name xxx (escaped if required)
-%{xxx}s write value of HttpSession attribute with 
name xxx (escaped if required)
+%{xxx}r write value of ServletRequest attribute 
with name xxx (escaped if required, value ?? if 
request is null)
+%{xxx}s write value of HttpSession attribute with 
name xxx (escaped if required, value ?? if request is 
null)
 %{xxx}p write local (server) port 
(xxx==local) or
 remote (client) port (xxx=remote)
 %{xxx}t write timestamp at the end of the request 
formatted using the
@@ -383,6 +383,10 @@
 appends the values of the Referer and User-Agent
 headers, each in double quotes, to the common pattern.
 
+Fields using unknown pattern identifiers will be logged as 
???X???
+where X is the unknown identifier. Fields with unknown 
pattern identifier
+plus {xxx} key will be logged as ???.
+
 When Tomcat is operating behind a reverse proxy, the client information
 logged by the Access Log Valve may represent the reverse proxy, the browser
 or some combination of the two depending on the configuration of Tomcat and
@@ -508,9 +512,9 @@
   
 
 The JSON Access Log Valve extends the
-Access Log Valve class, and so
+Access Log Valve, and so
 uses the same self-contained logging logic.  This means it
-implements many of the same file handling attributes.  The main
+implements the same file handling attributes.  The main
 difference to the standard AccessLogValve is that
 JsonAccessLogValve creates log files which
 follow the JSON syntax as defined by
@@ -535,18 +539,32 @@
 
 
 
-While the pattern supported are the same as for the regular access log,
-those are mapped to specific JSON attribute names. The attributes are the
-following:
+While the patterns supported are the same as for the regular
+Access Log Valve,
+there are a few differences:
+
+requests are logged as JSON objects. Each "%" prefixed pattern
+identifier results in a key value pair in this object.
+See below for the list of keys used for the respective pattern
+identifiers.
+ 

  1   2   3   4   5   6   7   8   9   10   >