Re: buildbot failure in on tomcat-trunk

2019-11-08 Thread Konstantin Kolinko
сб, 9 нояб. 2019 г. в 02:32, Michael Osipov :
>
> Am 2019-11-09 um 00:19 schrieb build...@apache.org:
> > The Buildbot has detected a new failure on builder tomcat-trunk while 
> > building tomcat. Full details are available at:
> >  https://ci.apache.org/builders/tomcat-trunk/builds/4713
> >
> > Buildbot URL: https://ci.apache.org/
> >
> > Buildslave for this Build: asf946_ubuntu
> >
> > Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
> > triggered this build
> > Build Source Stamp: [branch master] 69602cb1ef0dc3aa2188a1b3be9fa3a1440cd1b1
> > Blamelist: Michael Osipov 
>
> Folks,
>
> is there a way to access the build directory on that node or retrigger
> the build?
> The failure looks pretty epheremal to me, but want to make sure.

http://tomcat.apache.org/ci.html#Buildbot
https://ci.apache.org/projects/tomcat/tomcat9/logs/4713/

The failing test is org.apache.coyote.http2.TestHttp2InitialConnection
# testMultipleHostHeaders[0]
# testNoHostHeader[0]

> expected:<...r-[content-length]-[[1131]
...
> but was:<...r-[content-length]-[[766]

The expected size of the page is hardcoded in the test, and your
change saved 365 bytes.

See the following line in TestHttp2InitialConnection.
int len = 1073 + serverInfoLength + statusHeaderLength * 2;

.Best regards,
Konstantin Kolinko

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



[Bug 63905] ErrorReportValve adds CSS even if both showReport and showServerInfo are set to false

2019-11-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63905

--- Comment #17 from Christopher Schultz  ---
(In reply to Michael Osipov from comment #15)
> (In reply to Christopher Schultz from comment #14)
> > This should all really be replaced by external stylesheets, for a few
> > reasons:
> > 
> > 1. They are trivially changed by administrators instead of hacking Java code
> > 2. They can be completely blocked, replaced, etc. by a reverse proxy if
> > desired
> > 3. They are more compatible with a desire to reduce response entity byte
> > count
> > 4. They can be used with a "safe" CSF policies[1]
> 
> I agree here, but this is far more work than I do now at the moment.

Honestly, I see this as easy:

1. Move CSS definitions to [whatever.css]
1. Change all CSS to 

> A lot of stuff is hardcoded in Java, buried in static fields.
> All of our default apps would require a rewrite -- and all of them are 
> optional!

"Our default apps" = "Tomcat's default apps"?

You gotta start somewhere.

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



Re: buildbot failure in on tomcat-trunk

2019-11-08 Thread Michael Osipov

Am 2019-11-09 um 00:19 schrieb build...@apache.org:

The Buildbot has detected a new failure on builder tomcat-trunk while building 
tomcat. Full details are available at:
 https://ci.apache.org/builders/tomcat-trunk/builds/4713

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] 69602cb1ef0dc3aa2188a1b3be9fa3a1440cd1b1
Blamelist: Michael Osipov 


Folks,

is there a way to access the build directory on that node or retrigger 
the build?

The failure looks pretty epheremal to me, but want to make sure.

Michael

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



buildbot failure in on tomcat-85-trunk

2019-11-08 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-85-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-85-trunk/builds/2010

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-85-commit' 
triggered this build
Build Source Stamp: [branch 8.5.x] 98b021b9c4da460a0fdbe60c2a753d08a497d327
Blamelist: Michael Osipov 

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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



buildbot failure in on tomcat-trunk

2019-11-08 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-trunk while building 
tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/4713

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] 69602cb1ef0dc3aa2188a1b3be9fa3a1440cd1b1
Blamelist: Michael Osipov 

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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



[Bug 63909] ExpiresFilter not account for 304 when content-type is null

2019-11-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63909

--- Comment #1 from some.java@gmail.com ---
“CustomExpiresFilter” should be “ExpiresFilter” in original config example in
description.

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



[Bug 63905] ErrorReportValve adds CSS even if both showReport and showServerInfo are set to false

2019-11-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63905

Michael Osipov  changed:

   What|Removed |Added

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

--- Comment #16 from Michael Osipov  ---
Fixed in:
- master for 9.0.28 onwards
- 8.5.x for 8.5.48 onwards
- 7.0.x for 7.0.98 onwards

I have opted to fix this for now since I am the one who made the last rewrite
of the ErrorReportValve output. I am quite certain that there is still room for
improvement and discussion from the other committers. Let's continue this on
the mailing list please.

awalt...@gmail.com, if you think there is still something open to be fixed,
raise this on the mailing list please, I'd be happy to jump into the
discussion.

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



[tomcat] branch 7.0.x updated: BZ 63905: Clean up Tomcat CSS

2019-11-08 Thread michaelo
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new 4b78394  BZ 63905: Clean up Tomcat CSS
4b78394 is described below

commit 4b78394123e9cb4aeeaec6ed113b2bee5cca8e1a
Author: Michael Osipov 
AuthorDate: Thu Nov 7 22:21:27 2019 +0100

BZ 63905: Clean up Tomcat CSS

Remove duplication in Tomcat CSS and align its usage which applies to
ErrorReportValve, and several servlets. Also update update incorrect
documentation as well.
---
 java/org/apache/catalina/servlets/DefaultServlet.java | 16 ++--
 java/org/apache/catalina/util/TomcatCSS.java  | 19 ---
 webapps/docs/changelog.xml|  3 +++
 webapps/docs/config/valve.xml |  2 +-
 4 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index 5a5eddd..1b95f95 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -1482,14 +1482,18 @@ public class DefaultServlet extends HttpServlet {
 String rewrittenContextPath =  rewriteUrl(contextPath);
 
 // Render the page header
-sb.append("\r\n");
+sb.append("\r\n");
+/* TODO Activate this as soon as we use smClient with the request 
locales
+sb.append("\r\n");
+*/
 sb.append("\r\n");
 sb.append("");
 sb.append(sm.getString("directory.title", name));
 sb.append("\r\n");
-sb.append(" ");
+sb.append(" ");
 sb.append("\r\n");
 sb.append("");
 sb.append("");
@@ -1519,7 +1523,7 @@ public class DefaultServlet extends HttpServlet {
 }
 
 sb.append("");
-sb.append("");
+sb.append("");
 
 sb.append("\r\n");
@@ -1599,12 +1603,12 @@ public class DefaultServlet extends HttpServlet {
 // Render the page footer
 sb.append("\r\n");
 
-sb.append("");
+sb.append("");
 
 String readme = getReadme(cacheEntry.context);
 if (readme!=null) {
 sb.append(readme);
-sb.append("");
+sb.append("");
 }
 
 if (showServerInfo) {
diff --git a/java/org/apache/catalina/util/TomcatCSS.java 
b/java/org/apache/catalina/util/TomcatCSS.java
index 89084b7..93f15a9 100644
--- a/java/org/apache/catalina/util/TomcatCSS.java
+++ b/java/org/apache/catalina/util/TomcatCSS.java
@@ -22,16 +22,13 @@ package org.apache.catalina.util;
 public class TomcatCSS {
 
 public static final String TOMCAT_CSS =
-"H1 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
 " +
-"H2 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
 " +
-"H3 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
 " +
-"BODY 
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} " +
-"B 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} " +
-"P 
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}"
 +
-"A {color : black;}" +
-"A.name {color : black;}" +
-"HR {color : #525D76;}";
-
+"body {font-family:Tahoma,Arial,sans-serif;} " +
+"h1, h2, h3, b {color:white;background-color:#525D76;} " +
+"h1 {font-size:22px;} " +
+"h2 {font-size:16px;} " +
+"h3 {font-size:14px;} " +
+"p {font-size:12px;} " +
+"a {color:black;} " +
+".line {height:1px;background-color:#525D76;border:none;}";
 
 }
-
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index cd1a8f0..3c1af27 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -70,6 +70,9 @@
 Make a best efforts attempt to clean-up if a request fails during
 processing due to an OutOfMemoryException. (markt)
   
+  
+63905 Clean up Tomcat CSS. (michaelo)
+  
 
   
   
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 288020e..5a9f671 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -1750,7 +1750,7 @@
 for HTTP status codes that will generate and return HTML error pages.
 
 NOTE: Disabling both showServerInfo and showReport will
-only return the HTTP status code and remove all CSS.
+only return the HTTP status code.
 
   
 


-
To unsubscribe, 

[tomcat] branch 8.5.x updated: BZ 63905: Clean up Tomcat CSS

2019-11-08 Thread michaelo
This is an automated email from the ASF dual-hosted git repository.

michaelo 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 98b021b  BZ 63905: Clean up Tomcat CSS
98b021b is described below

commit 98b021b9c4da460a0fdbe60c2a753d08a497d327
Author: Michael Osipov 
AuthorDate: Thu Nov 7 22:21:27 2019 +0100

BZ 63905: Clean up Tomcat CSS

Remove duplication in Tomcat CSS and align its usage which applies to
ErrorReportValve, and several servlets. Also update update incorrect
documentation as well.
---
 java/org/apache/catalina/servlets/DefaultServlet.java | 16 ++--
 java/org/apache/catalina/util/TomcatCSS.java  | 16 +++-
 webapps/docs/changelog.xml|  3 +++
 webapps/docs/config/valve.xml |  2 +-
 4 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index 22f6058..a9b7a56 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -1882,14 +1882,18 @@ public class DefaultServlet extends HttpServlet {
 String rewrittenContextPath =  rewriteUrl(contextPath);
 
 // Render the page header
-sb.append("\r\n");
+sb.append("\r\n");
+/* TODO Activate this as soon as we use smClient with the request 
locales
+sb.append("\r\n");
+*/
 sb.append("\r\n");
 sb.append("");
 sb.append(sm.getString("directory.title", directoryWebappPath));
 sb.append("\r\n");
-sb.append(" ");
+sb.append(" ");
 sb.append("\r\n");
 sb.append("");
 sb.append("");
@@ -1919,7 +1923,7 @@ public class DefaultServlet extends HttpServlet {
 }
 
 sb.append("");
-sb.append("");
+sb.append("");
 
 sb.append("\r\n");
@@ -2016,12 +2020,12 @@ public class DefaultServlet extends HttpServlet {
 // Render the page footer
 sb.append("\r\n");
 
-sb.append("");
+sb.append("");
 
 String readme = getReadme(resource, encoding);
 if (readme!=null) {
 sb.append(readme);
-sb.append("");
+sb.append("");
 }
 
 if (showServerInfo) {
diff --git a/java/org/apache/catalina/util/TomcatCSS.java 
b/java/org/apache/catalina/util/TomcatCSS.java
index c4f6da3..93f15a9 100644
--- a/java/org/apache/catalina/util/TomcatCSS.java
+++ b/java/org/apache/catalina/util/TomcatCSS.java
@@ -22,15 +22,13 @@ package org.apache.catalina.util;
 public class TomcatCSS {
 
 public static final String TOMCAT_CSS =
-"h1 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
 " +
-"h2 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
 " +
-"h3 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
 " +
-"body 
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} " +
-"b 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} " +
-"p 
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}
 " +
+"body {font-family:Tahoma,Arial,sans-serif;} " +
+"h1, h2, h3, b {color:white;background-color:#525D76;} " +
+"h1 {font-size:22px;} " +
+"h2 {font-size:16px;} " +
+"h3 {font-size:14px;} " +
+"p {font-size:12px;} " +
 "a {color:black;} " +
-"a.name {color:black;} " +
 ".line {height:1px;background-color:#525D76;border:none;}";
 
-
-}
\ No newline at end of file
+}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 7e38941..970270b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -71,6 +71,9 @@
 to this change it was possible to see an updated last modified time but
 the content would be that prior to the modification. (markt)
   
+  
+63905 Clean up Tomcat CSS. (michaelo)
+  
 
   
   
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 7f5f527..7a5bc31 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -1898,7 +1898,7 @@
 for HTTP status codes that will generate and return HTML error pages.
 
 NOTE: Disabling both showServerInfo and showReport will
-only return the HTTP status code and remove all CSS.
+only return the HTTP status code.
 
   
 


-
To unsubscribe, e-mail: 

[tomcat] branch master updated: BZ 63905: Clean up Tomcat CSS

2019-11-08 Thread michaelo
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 69602cb  BZ 63905: Clean up Tomcat CSS
69602cb is described below

commit 69602cb1ef0dc3aa2188a1b3be9fa3a1440cd1b1
Author: Michael Osipov 
AuthorDate: Thu Nov 7 22:21:27 2019 +0100

BZ 63905: Clean up Tomcat CSS

Remove duplication in Tomcat CSS and align its usage which applies to
ErrorReportValve, and several servlets. Also update update incorrect
documentation as well.
---
 java/org/apache/catalina/servlets/DefaultServlet.java | 16 ++--
 java/org/apache/catalina/util/TomcatCSS.java  | 16 +++-
 webapps/docs/changelog.xml|  3 +++
 webapps/docs/config/valve.xml |  5 ++---
 4 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index c217cf6..2883f5c 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -1815,14 +1815,18 @@ public class DefaultServlet extends HttpServlet {
 String rewrittenContextPath =  rewriteUrl(contextPath);
 
 // Render the page header
-sb.append("\r\n");
+sb.append("\r\n");
+/* TODO Activate this as soon as we use smClient with the request 
locales
+sb.append("\r\n");
+*/
 sb.append("\r\n");
 sb.append("");
 sb.append(sm.getString("directory.title", directoryWebappPath));
 sb.append("\r\n");
-sb.append(" ");
+sb.append(" ");
 sb.append("\r\n");
 sb.append("");
 sb.append("");
@@ -1852,7 +1856,7 @@ public class DefaultServlet extends HttpServlet {
 }
 
 sb.append("");
-sb.append("");
+sb.append("");
 
 sb.append("\r\n");
@@ -1949,12 +1953,12 @@ public class DefaultServlet extends HttpServlet {
 // Render the page footer
 sb.append("\r\n");
 
-sb.append("");
+sb.append("");
 
 String readme = getReadme(resource, encoding);
 if (readme!=null) {
 sb.append(readme);
-sb.append("");
+sb.append("");
 }
 
 if (showServerInfo) {
diff --git a/java/org/apache/catalina/util/TomcatCSS.java 
b/java/org/apache/catalina/util/TomcatCSS.java
index c4f6da3..93f15a9 100644
--- a/java/org/apache/catalina/util/TomcatCSS.java
+++ b/java/org/apache/catalina/util/TomcatCSS.java
@@ -22,15 +22,13 @@ package org.apache.catalina.util;
 public class TomcatCSS {
 
 public static final String TOMCAT_CSS =
-"h1 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
 " +
-"h2 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
 " +
-"h3 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
 " +
-"body 
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} " +
-"b 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} " +
-"p 
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}
 " +
+"body {font-family:Tahoma,Arial,sans-serif;} " +
+"h1, h2, h3, b {color:white;background-color:#525D76;} " +
+"h1 {font-size:22px;} " +
+"h2 {font-size:16px;} " +
+"h3 {font-size:14px;} " +
+"p {font-size:12px;} " +
 "a {color:black;} " +
-"a.name {color:black;} " +
 ".line {height:1px;background-color:#525D76;border:none;}";
 
-
-}
\ No newline at end of file
+}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index c910d17..0e701f3 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -70,6 +70,9 @@
 to this change it was possible to see an updated last modified time but
 the content would be that prior to the modification. (markt)
   
+  
+63905 Clean up Tomcat CSS. (michaelo)
+  
 
   
   
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 5e05287..72f0584 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -1900,8 +1900,7 @@
 status codes and/or exception types.
 
 NOTE: Disabling both showServerInfo and showReport will
-only return the HTTP status code and remove all CSS from the default
-response.
+only return the HTTP status code.
 
   
 
@@ -1922,7 +1921,7 @@
 The location of the UTF-8 encoded HTML file to return for the 

[Bug 63905] ErrorReportValve adds CSS even if both showReport and showServerInfo are set to false

2019-11-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63905

--- Comment #15 from Michael Osipov  ---
(In reply to Christopher Schultz from comment #14)
> (In reply to Michael Osipov from comment #13)
> > I don't see how "securing the ErrorReportValve" is related to the served 
> > CSS.
> 
> It's a *thin* argument related to fingerprinting the server's version. If
> you modify the CSS in Tomcat 9.0.28, a client can request a page known to
> produce this output, check the CSS, and determine if the version is
> before/after that patch. Well, to some degree of certainty.

This is likely, but the paranoid should swap the ErrorReportValve for a custom
one.

> > However, I have found a few more nits I am going through locally now where
> > the CSS will now cleanly apply to the ErrorReportValve as well as the
> > listing of DefaultServlet.
> 
> This should all really be replaced by external stylesheets, for a few
> reasons:
> 
> 1. They are trivially changed by administrators instead of hacking Java code
> 2. They can be completely blocked, replaced, etc. by a reverse proxy if
> desired
> 3. They are more compatible with a desire to reduce response entity byte
> count
> 4. They can be used with a "safe" CSF policies[1]

I agree here, but this is far more work than I do now at the moment. A lot of
stuff is hardcoded in Java, burried in static fields. All of our default apps
would require a rewrite -- and all of them are optional!

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



[tomcat] 01/02: Align with 8.5.x/9.0.x

2019-11-08 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 661f583a14dd509e39d084dc50c7c94ffc7993fd
Author: Mark Thomas 
AuthorDate: Fri Nov 8 22:10:46 2019 +

Align with 8.5.x/9.0.x
---
 .../apache/catalina/tribes/util/StringManager.java | 177 +
 1 file changed, 145 insertions(+), 32 deletions(-)

diff --git a/java/org/apache/catalina/tribes/util/StringManager.java 
b/java/org/apache/catalina/tribes/util/StringManager.java
index 2204245..53caf03 100644
--- a/java/org/apache/catalina/tribes/util/StringManager.java
+++ b/java/org/apache/catalina/tribes/util/StringManager.java
@@ -18,11 +18,15 @@
 package org.apache.catalina.tribes.util;
 
 import java.text.MessageFormat;
+import java.util.Enumeration;
 import java.util.Hashtable;
+import java.util.LinkedHashMap;
 import java.util.Locale;
+import java.util.Map;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
+
 /**
  * An internationalization / localization helper class which reduces
  * the bother of handling ResourceBundles and takes care of the
@@ -49,11 +53,14 @@ import java.util.ResourceBundle;
  */
 public class StringManager {
 
+private static int LOCALE_CACHE_SIZE = 10;
+
 /**
  * The ResourceBundle for this StringManager.
  */
-private ResourceBundle bundle;
-private Locale locale;
+private final ResourceBundle bundle;
+private final Locale locale;
+
 
 /**
  * Creates a new StringManager for a given package. This is a
@@ -63,53 +70,67 @@ public class StringManager {
  *
  * @param packageName Name of package to create StringManager for.
  */
-private StringManager(String packageName) {
+private StringManager(String packageName, Locale locale) {
 String bundleName = packageName + ".LocalStrings";
+ResourceBundle bnd = null;
 try {
-bundle = ResourceBundle.getBundle(bundleName, Locale.getDefault());
-} catch( MissingResourceException ex ) {
+bnd = ResourceBundle.getBundle(bundleName, locale);
+} catch (MissingResourceException ex) {
 // Try from the current loader (that's the case for trusted apps)
 // Should only be required if using a TC5 style classloader 
structure
 // where common != shared != server
 ClassLoader cl = Thread.currentThread().getContextClassLoader();
-if( cl != null ) {
+if (cl != null) {
 try {
-bundle = ResourceBundle.getBundle(
-bundleName, Locale.getDefault(), cl);
-} catch(MissingResourceException ex2) {
+bnd = ResourceBundle.getBundle(bundleName, locale, cl);
+} catch (MissingResourceException ex2) {
 // Ignore
 }
 }
 }
+bundle = bnd;
 // Get the actual locale, which may be different from the requested one
 if (bundle != null) {
-locale = bundle.getLocale();
+Locale bundleLocale = bundle.getLocale();
+if (bundleLocale.equals(Locale.ROOT)) {
+this.locale = Locale.ENGLISH;
+} else {
+this.locale = bundleLocale;
+}
+} else {
+this.locale = null;
 }
 }
 
-/**
-Get a string from the underlying resource bundle or return
-null if the String is not found.
 
-@param key to desired resource String
-@return resource String matching key from underlying
-bundle or null if not found.
-@throws IllegalArgumentException if key is null.
+/**
+ * Get a string from the underlying resource bundle or return null if the
+ * String is not found.
+ *
+ * @param key to desired resource String
+ *
+ * @return resource String matching key from underlying bundle or
+ * null if not found.
+ *
+ * @throws IllegalArgumentException if key is null
  */
 public String getString(String key) {
-if(key == null){
+if (key == null){
 String msg = "key may not have a null value";
-
 throw new IllegalArgumentException(msg);
 }
 
 String str = null;
 
 try {
-str = bundle.getString(key);
-} catch(MissingResourceException mre) {
+// Avoid NPE if bundle is null and treat it like an MRE
+if (bundle != null) {
+str = bundle.getString(key);
+}
+} catch (MissingResourceException mre) {
 //bad: shouldn't mask an exception the following way:
-//   str = "[cannot find message associated with key '" + key + "' 
due to " + mre + "]";
+//   str = "[cannot find message associated with key '" + key +
+

[tomcat] branch 7.0.x updated (c88cf8f -> a354f2d)

2019-11-08 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from c88cf8f  Improve clean-up after an OOME during request processing
 new 661f583  Align with 8.5.x/9.0.x
 new a354f2d  Fix some Javadoc warnings with Java 13

The 2 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:
 java/org/apache/catalina/ha/backend/Sender.java|  10 +-
 java/org/apache/catalina/ha/backend/TcpSender.java |   1 +
 .../apache/catalina/tribes/ChannelReceiver.java|   3 +-
 .../catalina/tribes/transport/ReceiverBase.java|  25 +--
 .../tribes/transport/bio/BioReplicationTask.java   |   9 +-
 .../catalina/tribes/transport/bio/BioSender.java   |  26 +--
 .../apache/catalina/tribes/util/StringManager.java | 177 +
 java/org/apache/tomcat/util/buf/ByteChunk.java |  23 ++-
 java/org/apache/tomcat/util/buf/MessageBytes.java  |  84 ++
 9 files changed, 251 insertions(+), 107 deletions(-)


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



[tomcat] 02/02: Fix some Javadoc warnings with Java 13

2019-11-08 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit a354f2d6dcf6c8ba5ecedbeb6b42a5d6dd5d986c
Author: Mark Thomas 
AuthorDate: Fri Nov 8 22:13:59 2019 +

Fix some Javadoc warnings with Java 13

Generally, fix by aligning with 8.5.x/9.0.x. Also include some
additional minor clean-up
---
 java/org/apache/catalina/ha/backend/Sender.java| 10 ++-
 java/org/apache/catalina/ha/backend/TcpSender.java |  1 +
 .../apache/catalina/tribes/ChannelReceiver.java|  3 +-
 .../catalina/tribes/transport/ReceiverBase.java| 25 +++
 .../tribes/transport/bio/BioReplicationTask.java   |  9 ++-
 .../catalina/tribes/transport/bio/BioSender.java   | 26 +++
 java/org/apache/tomcat/util/buf/ByteChunk.java | 23 --
 java/org/apache/tomcat/util/buf/MessageBytes.java  | 84 ++
 8 files changed, 106 insertions(+), 75 deletions(-)

diff --git a/java/org/apache/catalina/ha/backend/Sender.java 
b/java/org/apache/catalina/ha/backend/Sender.java
index 191a19c..8857445 100644
--- a/java/org/apache/catalina/ha/backend/Sender.java
+++ b/java/org/apache/catalina/ha/backend/Sender.java
@@ -18,19 +18,23 @@
 
 package org.apache.catalina.ha.backend;
 
-/*
- * Interface to send data to proxies
- *
+/**
+ * Interface to send data to proxies.
  */
 public interface Sender {
 
   /**
* Set the configuration parameters
+   * @param config The heartbeat listener configuration
+   * @throws Exception An error occurred
*/
   public void init(HeartbeatListener config) throws Exception;
 
   /**
* Send the message to the proxies
+   * @param mess The message that will be sent
+   * @return 0 if no error occurred, -1 otherwise
+   * @throws Exception An error occurred
*/
   public int send(String mess) throws Exception;
 }
diff --git a/java/org/apache/catalina/ha/backend/TcpSender.java 
b/java/org/apache/catalina/ha/backend/TcpSender.java
index 6c78e10..7dd9338 100644
--- a/java/org/apache/catalina/ha/backend/TcpSender.java
+++ b/java/org/apache/catalina/ha/backend/TcpSender.java
@@ -180,6 +180,7 @@ public class TcpSender
 
 /**
  * Close connection.
+ * @param i The index of the connection that will be closed
  */
 protected void close(int i) {
 try {
diff --git a/java/org/apache/catalina/tribes/ChannelReceiver.java 
b/java/org/apache/catalina/tribes/ChannelReceiver.java
index e90c3e2..b1dae2e 100644
--- a/java/org/apache/catalina/tribes/ChannelReceiver.java
+++ b/java/org/apache/catalina/tribes/ChannelReceiver.java
@@ -23,14 +23,13 @@ package org.apache.catalina.tribes;
  * The ChannelReceiver interface is the data receiver component
  * at the bottom layer, the IO layer (for layers see the javadoc for the 
{@link Channel} interface).
  * This class may optionally implement a thread pool for parallel processing 
of incoming messages.
- * @author Filip Hanik
  */
 public interface ChannelReceiver extends Heartbeat {
 public static final int MAX_UDP_SIZE = 65535;
 
 /**
  * Start listening for incoming messages on the host/port
- * @throws java.io.IOException
+ * @throws java.io.IOException Listen failed
  */
 public void start() throws java.io.IOException;
 
diff --git a/java/org/apache/catalina/tribes/transport/ReceiverBase.java 
b/java/org/apache/catalina/tribes/transport/ReceiverBase.java
index 380807c..43d99d5 100644
--- a/java/org/apache/catalina/tribes/transport/ReceiverBase.java
+++ b/java/org/apache/catalina/tribes/transport/ReceiverBase.java
@@ -36,16 +36,6 @@ import org.apache.catalina.tribes.util.ExecutorFactory;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 
-/**
- * Title: 
- *
- * Description: 
- *
- * Company: 
- *
- * @author not attributable
- * @version 1.0
- */
 public abstract class ReceiverBase implements ChannelReceiver, ListenCallback, 
RxTaskPool.TaskCreator {
 
 public static final int OPTION_DIRECT_BUFFER = 0x0004;
@@ -224,7 +214,7 @@ public abstract class ReceiverBase implements 
ChannelReceiver, ListenCallback, R
  * @param portstart Starting port for bind attempts
  * @param retries   Number of times to attempt to bind (port 
incremented
  *  between attempts)
- * @throws IOException
+ * @throws IOException Socket bind error
  */
 protected void bind(ServerSocket socket, int portstart, int retries) 
throws IOException {
 synchronized (bindLock) {
@@ -252,11 +242,12 @@ public abstract class ReceiverBase implements 
ChannelReceiver, ListenCallback, R
 
 /**
  * Same as bind() except it does it for the UDP port
- * @param socket
- * @param portstart
- * @param retries
- * @return int
- * @throws IOException
+ * @param socketThe socket to bind
+ * @param portstart Starting port for bind attempts
+ * @param retries   Number of times 

[Bug 63909] New: ExpiresFilter not account for 304 when content-type is null

2019-11-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63909

Bug ID: 63909
   Summary: ExpiresFilter not account for 304 when content-type is
null
   Product: Tomcat 8
   Version: 8.5.x-trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: some.java@gmail.com
  Target Milestone: 

Firstly, I apologize as I am quite new to contributing so I hope I am pursuing
the correct path.  I have struggled mightily recently trying to track down why
our caching configuration was not really working with tomcat 8.5.x and we
finally found the nugget in the ExpiresFilter.  Here is our ExpiresFilter
configuration snippet.


  ExpiresFilter
  org.apache.catalina.filters.ExpiresFilter
  
ExpiresByType image/gif
access plus 6 hours
  
  
ExpiresByType text/css
access plus 6 hours
  
  
ExpiresByType application/javascript
access plus 6 hours
  
  
ExpiresExcludedResponseStatusCodes
302, 500, 503
  



  CustomExpiresFilter
  /*
  REQUEST


The ExpiresFilter according to the documentation can be configured to expire
content by type or with a default or with both.  However, there is a hole in
the current logic of the getExpirationDate(XHttpServletResponse response)
method if the filter is not configured with a default.  When the response
status is 304 (which in our case not excluded - see config above) the
content-type is null in the first lines of the getExpirationDate method. The
ExpiresFilter is unable to set the appropriate cache-control and expires
headers because the content-type is not present.

The net effect is that once the content has expired with the ExpiresFilter
configuration settings above, the cache-control and expires headers cannot be
set by the ExpiresFilter and a slew of incoming browser requests for the same
static content are met with repeated 304s.  Essentially, using only
ExpiresByType in ExpiresFilter results in successful caching, but only until
the content expires, at which point, the wave of 304s begin.  I don't think
this was the intended effect.

One could argue that, even when a 304 is returned, one can still set the
cache-control and expires headers appropriately and extend the cache lifetime
thus reducing load as intended.  One way to do this is to add logic to the
ExpiresFilter to use the request URI and request file metadata to determine
what the content type would have been in this scenario - another might be an in
memory collection of URIs to content type for lookup.  I am sure there are
others but not knowing the source code surrounding this in depth, I cannot say
what would be best.

In our research several people have solved this issue by changing or entirely
removing other headers like the ETag header and the Last-Modified and that does
not seem correct.  I think it is perfectly valid to have ETag with a 304 and
cache-control and expires headers and maybe even more elegant and appropriate?

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



Re: [tomcat] branch master updated: Polish

2019-11-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mark,

That's some nice indenting work, there. No big plans for the weekend,
eh? :)

- -chris

On 11/8/19 17:07, ma...@apache.org wrote:
> This is an automated email from the ASF dual-hosted git
> repository.
> 
> markt pushed a commit to branch master in repository
> https://gitbox.apache.org/repos/asf/tomcat.git
> 
> 
> The following commit(s) were added to refs/heads/master by this
> push: new 58898a5  Polish 58898a5 is described below
> 
> commit 58898a573086dbe58ae77ac17cbb0cf77a62cdc5 Author: Mark Thomas
>  AuthorDate: Fri Nov 8 22:06:46 2019 +
> 
> Polish --- 
> java/org/apache/catalina/tribes/transport/ReceiverBase.java | 10
> +- 1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git
> a/java/org/apache/catalina/tribes/transport/ReceiverBase.java
> b/java/org/apache/catalina/tribes/transport/ReceiverBase.java index
> 8d82aaa..dd769cd 100644 ---
> a/java/org/apache/catalina/tribes/transport/ReceiverBase.java +++
> b/java/org/apache/catalina/tribes/transport/ReceiverBase.java @@
> -220,10 +220,10 @@ public abstract class ReceiverBase implements
> ChannelReceiver, ListenCallback, R
> 
> /** * Same as bind() except it does it for the UDP port - *
> @param socket The socket to bind - * @param portstart
> Starting port for bind attempts - * @param retries   Number
> of times to attempt to bind (port incremented - *
> between attempts) + * @param socketThe socket to bind +
> * @param portstart Starting port for bind attempts + * @param
> retries   Number of times to attempt to bind (port incremented +
> *  between attempts) * @return int The retry count 
> * @throws IOException Socket bind error */ @@ -603,4 +603,4 @@
> public abstract class ReceiverBase implements ChannelReceiver,
> ListenCallback, R this.maxIdleTime = maxIdleTime; }
> 
> -} \ No newline at end of file +}
> 
> 
> -
>
> 
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl3F6A4ACgkQHPApP6U8
pFjM7Q/8CdP7BPSMnji0zaR+1qyzmvmK8AglgGDBMsjBE3jhM8IvEwRoxt3oU4w8
ciGk4GptFkAbDQNAShZjdTO1e6JIu5f40IKruywOOzV9I0+R6AcQIQGi21NmDr6H
emRLOGWqDjLmZI2gwlHsBqmCn5INoQhwwC520qzm56hVByluZfYIZ+ccuhCQAXcV
4NCP99z7l7nraJ/QgnJzGhjXCxS/bdv6bUsK6mbqWuWFosf/xa+mpaJFq5gQ5cm1
w3mIewgOEJs8bIshIC6h+SUuuhxZvZW+5Bn4eaIQu9BuDXnVEL4gPO1nGmtyN5oz
tLc/jEtaaFcb2HFdc4V4xfbwiYD2PHx+z6KVfiUQll6ajOfpjIo4tDl34aTa5Rs6
/lafwHpLUQ8u+fH+Ov8s8PgF5qYo+WWs9gbnVqTuGrDTFhT/i4zj2JsfFmkklB13
Soh0K/C5I10Kpr64myukii5fZvIlhPyt8tWh4uSz6M0aLrhMaaKB91J0rixGYktD
nGU4svdO34Do9bxs4Z1Ro/o6wyZhGcVS6v95sJWcXci75AEmTfwAfQ9lEKSMGuE1
SXe64e/8IjXHIKuY1bgWyvyKJFmZm78sIq/9NaHczKuqqQXSURD+A3JvvFs2/uU2
pN40ibBVojb5dryWaO//fYHa9Nj4I5Mc+OTx0/6Xp09JHr8HEMc=
=mg5F
-END PGP SIGNATURE-

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



[Bug 63905] ErrorReportValve adds CSS even if both showReport and showServerInfo are set to false

2019-11-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63905

--- Comment #14 from Christopher Schultz  ---
(In reply to Michael Osipov from comment #13)
> I don't see how "securing the ErrorReportValve" is related to the served CSS.

It's a *thin* argument related to fingerprinting the server's version. If you
modify the CSS in Tomcat 9.0.28, a client can request a page known to produce
this output, check the CSS, and determine if the version is before/after that
patch. Well, to some degree of certainty.

> However, I have found a few more nits I am going through locally now where
> the CSS will now cleanly apply to the ErrorReportValve as well as the
> listing of DefaultServlet.

This should all really be replaced by external stylesheets, for a few reasons:

1. They are trivially changed by administrators instead of hacking Java code
2. They can be completely blocked, replaced, etc. by a reverse proxy if desired
3. They are more compatible with a desire to reduce response entity byte count
4. They can be used with a "safe" CSF policies[1]

[1]
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src

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



[tomcat] branch 8.5.x updated: Polish

2019-11-08 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new a12a166  Polish
a12a166 is described below

commit a12a1665b258a089b2ddbc59c08c2002b840b4dd
Author: Mark Thomas 
AuthorDate: Fri Nov 8 22:08:05 2019 +

Polish
---
 java/org/apache/catalina/tribes/transport/ReceiverBase.java | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/tribes/transport/ReceiverBase.java 
b/java/org/apache/catalina/tribes/transport/ReceiverBase.java
index 8d82aaa..185058d 100644
--- a/java/org/apache/catalina/tribes/transport/ReceiverBase.java
+++ b/java/org/apache/catalina/tribes/transport/ReceiverBase.java
@@ -220,10 +220,10 @@ public abstract class ReceiverBase implements 
ChannelReceiver, ListenCallback, R
 
 /**
  * Same as bind() except it does it for the UDP port
- * @param socket The socket to bind
- * @param portstart Starting port for bind attempts
- * @param retries   Number of times to attempt to bind (port 
incremented
- *  between attempts)
+ * @param socket   The socket to bind
+ * @param portstart Starting port for bind attempts
+ * @param retries   Number of times to attempt to bind (port incremented
+ *  between attempts)
  * @return int The retry count
  * @throws IOException Socket bind error
  */
@@ -603,4 +603,4 @@ public abstract class ReceiverBase implements 
ChannelReceiver, ListenCallback, R
 this.maxIdleTime = maxIdleTime;
 }
 
-}
\ No newline at end of file
+}


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



[tomcat] branch master updated: Polish

2019-11-08 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 58898a5  Polish
58898a5 is described below

commit 58898a573086dbe58ae77ac17cbb0cf77a62cdc5
Author: Mark Thomas 
AuthorDate: Fri Nov 8 22:06:46 2019 +

Polish
---
 java/org/apache/catalina/tribes/transport/ReceiverBase.java | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/tribes/transport/ReceiverBase.java 
b/java/org/apache/catalina/tribes/transport/ReceiverBase.java
index 8d82aaa..dd769cd 100644
--- a/java/org/apache/catalina/tribes/transport/ReceiverBase.java
+++ b/java/org/apache/catalina/tribes/transport/ReceiverBase.java
@@ -220,10 +220,10 @@ public abstract class ReceiverBase implements 
ChannelReceiver, ListenCallback, R
 
 /**
  * Same as bind() except it does it for the UDP port
- * @param socket The socket to bind
- * @param portstart Starting port for bind attempts
- * @param retries   Number of times to attempt to bind (port 
incremented
- *  between attempts)
+ * @param socketThe socket to bind
+ * @param portstart Starting port for bind attempts
+ * @param retries   Number of times to attempt to bind (port incremented
+ *  between attempts)
  * @return int The retry count
  * @throws IOException Socket bind error
  */
@@ -603,4 +603,4 @@ public abstract class ReceiverBase implements 
ChannelReceiver, ListenCallback, R
 this.maxIdleTime = maxIdleTime;
 }
 
-}
\ No newline at end of file
+}


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



[Bug 63905] ErrorReportValve adds CSS even if both showReport and showServerInfo are set to false

2019-11-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63905

--- Comment #13 from Michael Osipov  ---
I don't see how "securing the ErrorReportValve" is related to the served CSS.

However, I have found a few more nits I am going through locally now where the
CSS will now cleanly apply to the ErrorReportValve as well as the listing of
DefaultServlet.

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



[tomcat] 01/01: BZ 63905: Clean up Tomcat CSS

2019-11-08 Thread michaelo
This is an automated email from the ASF dual-hosted git repository.

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

commit 0346831b2abacc706a75f6e9807a449c89964ae4
Author: Michael Osipov 
AuthorDate: Thu Nov 7 22:21:27 2019 +0100

BZ 63905: Clean up Tomcat CSS

Remove duplication in Tomcat CSS which applies to ErrorReportValve,
DefaultServlet and ManagerServlet as well as update incorrect documentation.
---
 java/org/apache/catalina/util/TomcatCSS.java | 16 +++-
 webapps/docs/changelog.xml   |  3 +++
 webapps/docs/config/valve.xml|  5 ++---
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/catalina/util/TomcatCSS.java 
b/java/org/apache/catalina/util/TomcatCSS.java
index c4f6da3..93f15a9 100644
--- a/java/org/apache/catalina/util/TomcatCSS.java
+++ b/java/org/apache/catalina/util/TomcatCSS.java
@@ -22,15 +22,13 @@ package org.apache.catalina.util;
 public class TomcatCSS {
 
 public static final String TOMCAT_CSS =
-"h1 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
 " +
-"h2 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
 " +
-"h3 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
 " +
-"body 
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} " +
-"b 
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} " +
-"p 
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}
 " +
+"body {font-family:Tahoma,Arial,sans-serif;} " +
+"h1, h2, h3, b {color:white;background-color:#525D76;} " +
+"h1 {font-size:22px;} " +
+"h2 {font-size:16px;} " +
+"h3 {font-size:14px;} " +
+"p {font-size:12px;} " +
 "a {color:black;} " +
-"a.name {color:black;} " +
 ".line {height:1px;background-color:#525D76;border:none;}";
 
-
-}
\ No newline at end of file
+}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index c910d17..0e701f3 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -70,6 +70,9 @@
 to this change it was possible to see an updated last modified time but
 the content would be that prior to the modification. (markt)
   
+  
+63905 Clean up Tomcat CSS. (michaelo)
+  
 
   
   
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 5e05287..72f0584 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -1900,8 +1900,7 @@
 status codes and/or exception types.
 
 NOTE: Disabling both showServerInfo and showReport will
-only return the HTTP status code and remove all CSS from the default
-response.
+only return the HTTP status code.
 
   
 
@@ -1922,7 +1921,7 @@
 The location of the UTF-8 encoded HTML file to return for the HTTP
 error code represented by nnn. For example,
 errorCode.404 specifies the file to return for an HTTP 404
-error. The location may be relative or absolule. If relative, it must 
be
+error. The location may be relative or absolute. If relative, it must 
be
 relative to $CATALINA_BASE. The special value of
 errorCode.0 may be used to define a default error page to
 be used if no error page is defined for a status code. If no matching


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



[tomcat] branch BZ-63905/9.0.x updated (de12b4d -> 0346831)

2019-11-08 Thread michaelo
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch BZ-63905/9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


 discard de12b4d  BZ 63905: Clean up Tomcat CSS
 add 67909e0  Add comment to explain the cleanup
 add ffb553c  Fix logic that meant AJP was not always non-blocking between 
requests
 new 0346831  BZ 63905: Clean up Tomcat CSS

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (de12b4d)
\
 N -- N -- N   refs/heads/BZ-63905/9.0.x (0346831)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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:
 java/org/apache/coyote/ajp/AjpProcessor.java | 8 +---
 java/org/apache/tomcat/util/net/AprEndpoint.java | 2 ++
 webapps/docs/changelog.xml   | 9 +
 3 files changed, 16 insertions(+), 3 deletions(-)


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



[GitHub] [tomcat] michael-o commented on issue #218: WIP: BZ 63835: Add support for Keep-Alive header

2019-11-08 Thread GitBox
michael-o commented on issue #218: WIP: BZ 63835: Add support for Keep-Alive 
header
URL: https://github.com/apache/tomcat/pull/218#issuecomment-551985916
 
 
   That will be fine for me. Unless community does not insinst on tests. I 
won't able to work on the tests on Monday.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [tomcat] rmaucher commented on issue #218: WIP: BZ 63835: Add support for Keep-Alive header

2019-11-08 Thread GitBox
rmaucher commented on issue #218: WIP: BZ 63835: Add support for Keep-Alive 
header
URL: https://github.com/apache/tomcat/pull/218#issuecomment-551978388
 
 
   You should commit this rather quickly or you're going to miss the next tags.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[Bug 63905] ErrorReportValve adds CSS even if both showReport and showServerInfo are set to false

2019-11-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63905

--- Comment #12 from Mark Thomas  ---
Probably not. The argument against it was made in bug 56383. I'm not convinced.

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



[Bug 63905] ErrorReportValve adds CSS even if both showReport and showServerInfo are set to false

2019-11-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63905

--- Comment #11 from Remy Maucherat  ---
(In reply to Christopher Schultz from comment #10)
> CSS is not a requirement for a valid HTML document. There is no conflict
> between removing CSS entirely and returning a valid HTML document along with
> an error report.

The CSS provides a better user experience for the developer, the cost of having
it seems non existent too. Did I miss something ?

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



[tomcat] branch 8.5.x updated: Fix logic that meant AJP was not always non-blocking between requests

2019-11-08 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 420c883  Fix logic that meant AJP was not always non-blocking between 
requests
420c883 is described below

commit 420c88325879cc192a044f18ad8c4a98d63d980e
Author: Mark Thomas 
AuthorDate: Fri Nov 8 19:57:00 2019 +

Fix logic that meant AJP was not always non-blocking between requests
---
 java/org/apache/coyote/ajp/AjpProcessor.java | 11 +++
 webapps/docs/changelog.xml   |  6 ++
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java 
b/java/org/apache/coyote/ajp/AjpProcessor.java
index 912d509..81ab0b7 100644
--- a/java/org/apache/coyote/ajp/AjpProcessor.java
+++ b/java/org/apache/coyote/ajp/AjpProcessor.java
@@ -395,20 +395,24 @@ public class AjpProcessor extends AbstractProcessor {
 
 int soTimeout = endpoint.getConnectionTimeout();
 boolean cping = false;
-
-boolean keptAlive = false;
+// Expected to block on the first read as there should be at least one
+// AJP message to read.
+boolean firstRead = true;
 
 while (!getErrorState().isError() && !endpoint.isPaused()) {
 // Parsing the request header
 try {
 // Get first message of the request
-if (!readMessage(requestHeaderMessage, !keptAlive)) {
+if (!readMessage(requestHeaderMessage, firstRead)) {
 break;
 }
+firstRead = false;
+
 // Set back timeout if keep alive timeout is enabled
 if (keepAliveTimeout > 0) {
 socketWrapper.setReadTimeout(soTimeout);
 }
+
 // Check message type, process right away and break if
 // not regular request processing
 int type = requestHeaderMessage.getByte();
@@ -435,7 +439,6 @@ public class AjpProcessor extends AbstractProcessor {
 setErrorState(ErrorState.CLOSE_CONNECTION_NOW, null);
 break;
 }
-keptAlive = true;
 request.setStartTime(System.currentTimeMillis());
 } catch (IOException e) {
 setErrorState(ErrorState.CLOSE_CONNECTION_NOW, e);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2f9c2c7..7e38941 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -115,6 +115,12 @@
 certificateVerificationDepth are correctly passed to the
 OpenSSL based SSLEngine implementation. (remm/markt)
   
+  
+Do not perform a blocking read after a CPING message is
+received by the AJP connector because, if the JK Connector is 
configured
+with ping_mode=I, the CPING
+message will not always be followed by the start of a request. (markt)
+  
 
   
   


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



[tomcat] branch master updated: Fix logic that meant AJP was not always non-blocking between requests

2019-11-08 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new ffb553c  Fix logic that meant AJP was not always non-blocking between 
requests
ffb553c is described below

commit ffb553c4c4315219762ed215965b73ee4f4d19c0
Author: Mark Thomas 
AuthorDate: Fri Nov 8 19:57:00 2019 +

Fix logic that meant AJP was not always non-blocking between requests
---
 java/org/apache/coyote/ajp/AjpProcessor.java | 8 +---
 webapps/docs/changelog.xml   | 6 ++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java 
b/java/org/apache/coyote/ajp/AjpProcessor.java
index a56fb7a..280a340 100644
--- a/java/org/apache/coyote/ajp/AjpProcessor.java
+++ b/java/org/apache/coyote/ajp/AjpProcessor.java
@@ -313,15 +313,18 @@ public class AjpProcessor extends AbstractProcessor {
 this.socketWrapper = socket;
 
 boolean cping = false;
-boolean keptAlive = false;
+// Expected to block on the first read as there should be at least one
+// AJP message to read.
+boolean firstRead = true;
 
 while (!getErrorState().isError() && !protocol.isPaused()) {
 // Parsing the request header
 try {
 // Get first message of the request
-if (!readMessage(requestHeaderMessage, !keptAlive)) {
+if (!readMessage(requestHeaderMessage, firstRead)) {
 break;
 }
+firstRead = false;
 
 // Processing the request so make sure the connection rather
 // than keep-alive timeout is used
@@ -353,7 +356,6 @@ public class AjpProcessor extends AbstractProcessor {
 setErrorState(ErrorState.CLOSE_CONNECTION_NOW, null);
 break;
 }
-keptAlive = true;
 request.setStartTime(System.currentTimeMillis());
 } catch (IOException e) {
 setErrorState(ErrorState.CLOSE_CONNECTION_NOW, e);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index fcc8dd5..c910d17 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -126,6 +126,12 @@
   
 Improve cleanup after errors when setting socket options. (remm)
   
+  
+Do not perform a blocking read after a CPING message is
+received by the AJP connector because, if the JK Connector is 
configured
+with ping_mode=I, the CPING
+message will not always be followed by the start of a request. (markt)
+  
 
   
   


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



[Bug 63905] ErrorReportValve adds CSS even if both showReport and showServerInfo are set to false

2019-11-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63905

--- Comment #10 from Christopher Schultz  ---
(In reply to Michael Osipov from comment #6)
> (In reply to Christopher Schultz from comment #4)
> > Or we could just drop the CSS because... who cares? If the response entity
> > is  > lang="??">ErrorError > html> then it's fine. No styling is necessary for such a minimal page.
> 
> That would be inconsistent with the rest. The Servlet spec requires an HTML
> page, we will comply.

CSS is not a requirement for a valid HTML document. There is no conflict
between removing CSS entirely and returning a valid HTML document along with an
error report.

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



[Bug 63859] AJP cping/cpong mode failing on Tomcat 9.x

2019-11-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63859

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

--- Comment #14 from Mark Thomas  ---
I am unable to reproduce this.

CPing/CPong mode "A" is equivalent to mode "CPI". Clearly, mode "C" is not an
issue but it would be useful to know if it is enabling P or I that triggers the
issue. You can use mode "CP" and "CI" to test this.

I've been looking through the mod_jk logs in more detail and it is a P test
that fails and takes Tomcat off-line but I see "I" test failures as well.

It is interesting that - in the logs we have - it is only srv09 that is seeing
these errors. Is there something about those two instances that is unique?

I have also been looking at the Tomcat code. I do see something that isn't
quite right (after a CPing/CPong Tomcat always does a blocking read) but I
don't see how that could be triggering the error you see. I'll fix this anyway
for 9.0.x and 8.5.x.

The debug logging (as previously mentioned for Tomcat) may help. If not, we'll
need to ad more logging on the Tomcat side to try and get to the bottom of
this.

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



[GitHub] [tomcat] michael-o commented on issue #218: WIP: BZ 63835: Add support for Keep-Alive header

2019-11-08 Thread GitBox
michael-o commented on issue #218: WIP: BZ 63835: Add support for Keep-Alive 
header
URL: https://github.com/apache/tomcat/pull/218#issuecomment-551842002
 
 
   If there are no further objections I'd add test code next week and merge 
this into master.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[tomcat] branch master updated: Add comment to explain the cleanup

2019-11-08 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 67909e0  Add comment to explain the cleanup
67909e0 is described below

commit 67909e03e2a8c00a5fe6b8214f26305a67548fd1
Author: remm 
AuthorDate: Fri Nov 8 09:38:14 2019 +0100

Add comment to explain the cleanup
---
 java/org/apache/tomcat/util/net/AprEndpoint.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java 
b/java/org/apache/tomcat/util/net/AprEndpoint.java
index 0315075..1d40f29 100644
--- a/java/org/apache/tomcat/util/net/AprEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AprEndpoint.java
@@ -695,6 +695,8 @@ public class AprEndpoint extends 
AbstractEndpoint implements SNICallB
 // the pool and its queue are full
 log.error(sm.getString("endpoint.process.fail"), t);
 }
+// Note: doing connections.remove is not needed since closeSocket will
+// be called, which then calls close on the wrapper
 return false;
 }
 


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