[GitHub] [tomcat] martin-g commented on pull request #351: Remove White Spaces from the JSP files
martin-g commented on pull request #351: URL: https://github.com/apache/tomcat/pull/351#issuecomment-698157237 Since there is no new test for this I am not sure but looking at the code I think "Remove white space" is not quite accurate. It is rather "Remove empty lines". Because BLANK_LINE_PATTERN would match only if there zero or more empty spaces, followed by at least one new line, followed by 0 or more empty spaces. So the example above: ``` | | Quick Servlet Demo | ``` won't produce: ``` | | Quick Servlet Demo | ``` In addition: why preserve 1 new line ? HTML minifiers would produce something like `.` 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 - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch master updated: Update version numbers
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 6e509a8 Update version numbers 6e509a8 is described below commit 6e509a856bfb9c2912b7451183f851afe77ed67a Author: remm AuthorDate: Thu Sep 24 10:12:10 2020 +0200 Update version numbers --- modules/stuffed/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/stuffed/pom.xml b/modules/stuffed/pom.xml index f1c84a3..c8dfa78 100644 --- a/modules/stuffed/pom.xml +++ b/modules/stuffed/pom.xml @@ -29,8 +29,8 @@ UTF-8 org.apache.catalina.startup.Tomcat -10.0.0-M7 - +10.0.0-M8 + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 64762] CoyoteInputStream getInputStream() read (wait after premature end and the rest comes)
https://bz.apache.org/bugzilla/show_bug.cgi?id=64762 --- Comment #5 from mgrigorov --- Can you reproduce this without Struts ? I.e. with plain Servlet -- 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 64762] CoyoteInputStream getInputStream() read (wait after premature end and the rest comes)
https://bz.apache.org/bugzilla/show_bug.cgi?id=64762 --- Comment #6 from Mark Thomas --- Whether it requires Struts or not, a *minimal* WAR (with source) that allows us to reproduce this would be very helpful. -- 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 master updated: Fix a typo in changelog
This is an automated email from the ASF dual-hosted git repository. mgrigorov 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 c58633a Fix a typo in changelog c58633a is described below commit c58633a695c3329d9f385dc55f72784cb0896b73 Author: Martin Tzvetanov Grigorov AuthorDate: Thu Sep 24 11:46:17 2020 +0300 Fix a typo in changelog --- 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 701d9d0..685c7ad 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -131,7 +131,7 @@ Update the Manager How-To in the documentation web application to clarify when a user may wish to deploy additional instances of the -Maanger web application. (markt) +Manager web application. (markt) - 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: Fix a typo in changelog
This is an automated email from the ASF dual-hosted git repository. mgrigorov 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 7bd8c64 Fix a typo in changelog 7bd8c64 is described below commit 7bd8c649a6f39d263f40297de6fc9bf4519d64dc Author: Martin Tzvetanov Grigorov AuthorDate: Thu Sep 24 11:46:17 2020 +0300 Fix a typo in changelog (cherry picked from commit c58633a695c3329d9f385dc55f72784cb0896b73) --- 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 a9e3ca7..0f65809 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -73,7 +73,7 @@ Update the Manager How-To in the documentation web application to clarify when a user may wish to deploy additional instances of the -Maanger web application. (markt) +Manager web application. (markt) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 9.0.x updated: Fix a typo in changelog
This is an automated email from the ASF dual-hosted git repository. mgrigorov 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 9c04df2 Fix a typo in changelog 9c04df2 is described below commit 9c04df2a48d2f0786a7d09a00ac9b5d3cc309fc7 Author: Martin Tzvetanov Grigorov AuthorDate: Thu Sep 24 11:46:17 2020 +0300 Fix a typo in changelog (cherry picked from commit c58633a695c3329d9f385dc55f72784cb0896b73) --- 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 959d6eb..96a0162 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -130,7 +130,7 @@ Update the Manager How-To in the documentation web application to clarify when a user may wish to deploy additional instances of the -Maanger web application. (markt) +Manager web application. (markt) - 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 a typo in changelog
This is an automated email from the ASF dual-hosted git repository. mgrigorov 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 ce17721 Fix a typo in changelog ce17721 is described below commit ce177213f6d5463bec9355b5642c14da2a29fa8b Author: Martin Tzvetanov Grigorov AuthorDate: Thu Sep 24 11:46:17 2020 +0300 Fix a typo in changelog (cherry picked from commit c58633a695c3329d9f385dc55f72784cb0896b73) --- 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 4750c1a..cdc6c96 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -106,7 +106,7 @@ Update the Manager How-To in the documentation web application to clarify when a user may wish to deploy additional instances of the -Maanger web application. (markt) +Manager web application. (markt) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch master updated: OWB 2.0.18
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 8713546 OWB 2.0.18 8713546 is described below commit 8713546e8eaede2038e4ae9d293e8a335931b9dc Author: remm AuthorDate: Thu Sep 24 11:16:31 2020 +0200 OWB 2.0.18 --- modules/owb/pom.xml| 4 ++-- webapps/docs/changelog.xml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/owb/pom.xml b/modules/owb/pom.xml index 2fd627b..b62360d 100644 --- a/modules/owb/pom.xml +++ b/modules/owb/pom.xml @@ -29,14 +29,14 @@ Apache Tomcat CDI 2 support Apache Tomcat CDI 2 support using Apache OpenWebBeans -2.0.17 +2.0.18 jar 1.0 1.0 1.0.1 -10.0.0-M6 +10.0.0-M8 diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 685c7ad..a6d3b84 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -156,6 +156,9 @@ Expand coverage of Russian translations. Pull request provided by Nikolay Gribanov. (markt) + +Update the OWB module to Apache OpenWebBeans 2.0.18. (remm) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 64762] CoyoteInputStream getInputStream() read (wait after premature end and the rest comes)
https://bz.apache.org/bugzilla/show_bug.cgi?id=64762 --- Comment #7 from Ralf Hauser --- (In reply to mgrigorov from comment #5) > Can you reproduce this without Struts ? I.e. with plain Servlet Yes, it happens also with the Axis2 Servlet where there is no struts in-between. As the CoyoteInputStream.markSupported() returns false from the parent java.io.InputStream.java this only happens upon the first read of the stream We'll provide more insights and possible some code once we progress further - many thanks for the quick responses -- 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 master updated (8713546 -> 6f17800)
This is an automated email from the ASF dual-hosted git repository. mgrigorov pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git. from 8713546 OWB 2.0.18 new d2ed8ff Small optimizations in HpackEncoder new 6f17800 http2: Add 'EndOfStream' to the logs for writeHeaders and writeBody 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/coyote/http2/HpackEncoder.java | 12 +--- .../coyote/http2/Http2AsyncUpgradeHandler.java | 6 +++--- .../apache/coyote/http2/Http2UpgradeHandler.java | 22 -- .../apache/coyote/http2/LocalStrings.properties| 4 ++-- 4 files changed, 26 insertions(+), 18 deletions(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 01/02: Small optimizations in HpackEncoder
This is an automated email from the ASF dual-hosted git repository. mgrigorov pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git commit d2ed8ffc75c5e3b425888b456ffc51036d94ac39 Author: Martin Tzvetanov Grigorov AuthorDate: Thu Sep 24 13:42:18 2020 +0300 Small optimizations in HpackEncoder 1) Use switch(String) instead of series of String.equals() calls. The switch uses String.hashCode() and falls back to .equals() only if there are cases with the same hash code. 2) Reduce memory allocations: no need to Map.Entry since the key is never used --- java/org/apache/coyote/http2/HpackEncoder.java | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/java/org/apache/coyote/http2/HpackEncoder.java b/java/org/apache/coyote/http2/HpackEncoder.java index dda5714..ae81033 100644 --- a/java/org/apache/coyote/http2/HpackEncoder.java +++ b/java/org/apache/coyote/http2/HpackEncoder.java @@ -44,7 +44,13 @@ class HpackEncoder { public boolean shouldUseIndexing(String headerName, String value) { //content length and date change all the time //no need to index them, or they will churn the table -return !headerName.equals("content-length") && !headerName.equals("date"); +switch (headerName) { +case "content-length": +case "date": +return false; +default: +return true; +} } @Override @@ -258,8 +264,8 @@ class HpackEncoder { private void preventPositionRollover() { //if the position counter is about to roll over we iterate all the table entries //and set their position to their actual position -for (Map.Entry> entry : dynamicTable.entrySet()) { -for (TableEntry t : entry.getValue()) { +for (List tableEntries : dynamicTable.values()) { +for (TableEntry t : tableEntries) { t.position = t.getPosition(); } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 02/02: http2: Add 'EndOfStream' to the logs for writeHeaders and writeBody
This is an automated email from the ASF dual-hosted git repository. mgrigorov pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 6f178006f246ce9248a349705ba79d054d189b70 Author: Martin Tzvetanov Grigorov AuthorDate: Thu Sep 24 13:46:31 2020 +0300 http2: Add 'EndOfStream' to the logs for writeHeaders and writeBody Mark Http2AsyncUpgradeHandler#errorCompletion and #applicationErrorCompletion as final. Call streams.size() just once. Extract local variables and reuse them instead of calling getters on every usage --- .../coyote/http2/Http2AsyncUpgradeHandler.java | 6 +++--- .../apache/coyote/http2/Http2UpgradeHandler.java | 22 -- .../apache/coyote/http2/LocalStrings.properties| 4 ++-- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java index 951c21c..9c274ac 100644 --- a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java +++ b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java @@ -51,7 +51,7 @@ public class Http2AsyncUpgradeHandler extends Http2UpgradeHandler { super(protocol, adapter, coyoteRequest); } -private CompletionHandler errorCompletion = new CompletionHandler() { +private final CompletionHandler errorCompletion = new CompletionHandler() { @Override public void completed(Long result, Void attachment) { } @@ -60,7 +60,7 @@ public class Http2AsyncUpgradeHandler extends Http2UpgradeHandler { error = t; } }; -private CompletionHandler applicationErrorCompletion = new CompletionHandler() { +private final CompletionHandler applicationErrorCompletion = new CompletionHandler() { @Override public void completed(Long result, Void attachment) { } @@ -199,7 +199,7 @@ public class Http2AsyncUpgradeHandler extends Http2UpgradeHandler { void writeBody(Stream stream, ByteBuffer data, int len, boolean finished) throws IOException { if (log.isDebugEnabled()) { log.debug(sm.getString("upgradeHandler.writeBody", connectionId, stream.getIdAsString(), -Integer.toString(len))); +Integer.toString(len), Boolean.valueOf(finished))); } // Need to check this now since sending end of stream will change this. boolean writeable = stream.canWrite(); diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java b/java/org/apache/coyote/http2/Http2UpgradeHandler.java index bc6fed0..152b2f3 100644 --- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java +++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java @@ -665,7 +665,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH if (log.isDebugEnabled()) { if (pushedStreamId == 0) { log.debug(sm.getString("upgradeHandler.writeHeaders", connectionId, -stream.getIdAsString())); +stream.getIdAsString(), Boolean.valueOf(endOfStream))); } else { log.debug(sm.getString("upgradeHandler.writePushHeaders", connectionId, stream.getIdAsString(), Integer.valueOf(pushedStreamId), @@ -1160,9 +1160,10 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH // maximum number of concurrent streams long max = localSettings.getMaxConcurrentStreams(); +final int size = streams.size(); if (log.isDebugEnabled()) { log.debug(sm.getString("upgradeHandler.pruneStart", connectionId, -Long.toString(max), Integer.toString(streams.size(; +Long.toString(max), Integer.toString(size))); } // Allow an additional 10% for closed streams that are used in the @@ -1172,7 +1173,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH max = Integer.MAX_VALUE; } -int toClose = streams.size() - (int) max; +int toClose = size - (int) max; if (toClose < 1) { return; } @@ -1199,16 +1200,17 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH continue; } +final Integer streamIdentifier = entry.getKey(); if (stream.isClosedFinal()) { // This stream went from IDLE to CLOSED and is likely to have // been created by the client as part of the priority tree. -candidatesStepThree.add(entry.getKey()); +candidatesStepThree.add(streamIdentifier); } else if (stream.getChildStreams().size() == 0) { // Closed, no children -candidatesStepOne.add(entry.ge
[tomcat] 01/02: Small optimizations in HpackEncoder
This is an automated email from the ASF dual-hosted git repository. mgrigorov pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 92d2f1317a68f88f60ebfe56cf123bfbd510ab58 Author: Martin Tzvetanov Grigorov AuthorDate: Thu Sep 24 13:42:18 2020 +0300 Small optimizations in HpackEncoder 1) Use switch(String) instead of series of String.equals() calls. The switch uses String.hashCode() and falls back to .equals() only if there are cases with the same hash code. 2) Reduce memory allocations: no need to Map.Entry since the key is never used (cherry picked from commit d2ed8ffc75c5e3b425888b456ffc51036d94ac39) --- java/org/apache/coyote/http2/HpackEncoder.java | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/java/org/apache/coyote/http2/HpackEncoder.java b/java/org/apache/coyote/http2/HpackEncoder.java index dda5714..ae81033 100644 --- a/java/org/apache/coyote/http2/HpackEncoder.java +++ b/java/org/apache/coyote/http2/HpackEncoder.java @@ -44,7 +44,13 @@ class HpackEncoder { public boolean shouldUseIndexing(String headerName, String value) { //content length and date change all the time //no need to index them, or they will churn the table -return !headerName.equals("content-length") && !headerName.equals("date"); +switch (headerName) { +case "content-length": +case "date": +return false; +default: +return true; +} } @Override @@ -258,8 +264,8 @@ class HpackEncoder { private void preventPositionRollover() { //if the position counter is about to roll over we iterate all the table entries //and set their position to their actual position -for (Map.Entry> entry : dynamicTable.entrySet()) { -for (TableEntry t : entry.getValue()) { +for (List tableEntries : dynamicTable.values()) { +for (TableEntry t : tableEntries) { t.position = t.getPosition(); } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 02/02: http2: Add 'EndOfStream' to the logs for writeHeaders and writeBody
This is an automated email from the ASF dual-hosted git repository. mgrigorov pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit b8e5607a4fccfd47ad653c5788ac1ba052411094 Author: Martin Tzvetanov Grigorov AuthorDate: Thu Sep 24 13:46:31 2020 +0300 http2: Add 'EndOfStream' to the logs for writeHeaders and writeBody Mark Http2AsyncUpgradeHandler#errorCompletion and #applicationErrorCompletion as final. Call streams.size() just once. Extract local variables and reuse them instead of calling getters on every usage (cherry picked from commit 6f178006f246ce9248a349705ba79d054d189b70) --- .../coyote/http2/Http2AsyncUpgradeHandler.java | 6 +++--- .../apache/coyote/http2/Http2UpgradeHandler.java | 22 -- .../apache/coyote/http2/LocalStrings.properties| 4 ++-- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java index 21c8fa8..eb116a7 100644 --- a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java +++ b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java @@ -51,7 +51,7 @@ public class Http2AsyncUpgradeHandler extends Http2UpgradeHandler { super(protocol, adapter, coyoteRequest); } -private CompletionHandler errorCompletion = new CompletionHandler() { +private final CompletionHandler errorCompletion = new CompletionHandler() { @Override public void completed(Long result, Void attachment) { } @@ -60,7 +60,7 @@ public class Http2AsyncUpgradeHandler extends Http2UpgradeHandler { error = t; } }; -private CompletionHandler applicationErrorCompletion = new CompletionHandler() { +private final CompletionHandler applicationErrorCompletion = new CompletionHandler() { @Override public void completed(Long result, Void attachment) { } @@ -199,7 +199,7 @@ public class Http2AsyncUpgradeHandler extends Http2UpgradeHandler { void writeBody(Stream stream, ByteBuffer data, int len, boolean finished) throws IOException { if (log.isDebugEnabled()) { log.debug(sm.getString("upgradeHandler.writeBody", connectionId, stream.getIdAsString(), -Integer.toString(len))); +Integer.toString(len), Boolean.valueOf(finished))); } // Need to check this now since sending end of stream will change this. boolean writeable = stream.canWrite(); diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java b/java/org/apache/coyote/http2/Http2UpgradeHandler.java index 98a5438..dbd7491 100644 --- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java +++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java @@ -665,7 +665,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH if (log.isDebugEnabled()) { if (pushedStreamId == 0) { log.debug(sm.getString("upgradeHandler.writeHeaders", connectionId, -stream.getIdAsString())); +stream.getIdAsString(), Boolean.valueOf(endOfStream))); } else { log.debug(sm.getString("upgradeHandler.writePushHeaders", connectionId, stream.getIdAsString(), Integer.valueOf(pushedStreamId), @@ -1160,9 +1160,10 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH // maximum number of concurrent streams long max = localSettings.getMaxConcurrentStreams(); +final int size = streams.size(); if (log.isDebugEnabled()) { log.debug(sm.getString("upgradeHandler.pruneStart", connectionId, -Long.toString(max), Integer.toString(streams.size(; +Long.toString(max), Integer.toString(size))); } // Allow an additional 10% for closed streams that are used in the @@ -1172,7 +1173,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH max = Integer.MAX_VALUE; } -int toClose = streams.size() - (int) max; +int toClose = size - (int) max; if (toClose < 1) { return; } @@ -1199,16 +1200,17 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH continue; } +final Integer streamIdentifier = entry.getKey(); if (stream.isClosedFinal()) { // This stream went from IDLE to CLOSED and is likely to have // been created by the client as part of the priority tree. -candidatesStepThree.add(entry.getKey()); +candidatesStepThree.add(streamIdentifier); } else if (stream.getChildStreams().size() == 0) {
[tomcat] branch 9.0.x updated (9c04df2 -> b8e5607)
This is an automated email from the ASF dual-hosted git repository. mgrigorov pushed a change to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git. from 9c04df2 Fix a typo in changelog new 92d2f13 Small optimizations in HpackEncoder new b8e5607 http2: Add 'EndOfStream' to the logs for writeHeaders and writeBody 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/coyote/http2/HpackEncoder.java | 12 +--- .../coyote/http2/Http2AsyncUpgradeHandler.java | 6 +++--- .../apache/coyote/http2/Http2UpgradeHandler.java | 22 -- .../apache/coyote/http2/LocalStrings.properties| 4 ++-- 4 files changed, 26 insertions(+), 18 deletions(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: [tomcat] 01/02: Small optimizations in HpackEncoder
On Thu, Sep 24, 2020 at 1:50 PM wrote: > This is an automated email from the ASF dual-hosted git repository. > > mgrigorov pushed a commit to branch master > in repository https://gitbox.apache.org/repos/asf/tomcat.git > > commit d2ed8ffc75c5e3b425888b456ffc51036d94ac39 > Author: Martin Tzvetanov Grigorov > AuthorDate: Thu Sep 24 13:42:18 2020 +0300 > > Small optimizations in HpackEncoder > > 1) Use switch(String) instead of series of String.equals() calls. The > switch uses String.hashCode() and falls back to .equals() only if there are > cases with the same hash code. > 2) Reduce memory allocations: no need to Map.Entry since the key is > never used > this should read: ... no need to *create* Map.Entry > --- > java/org/apache/coyote/http2/HpackEncoder.java | 12 +--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/java/org/apache/coyote/http2/HpackEncoder.java > b/java/org/apache/coyote/http2/HpackEncoder.java > index dda5714..ae81033 100644 > --- a/java/org/apache/coyote/http2/HpackEncoder.java > +++ b/java/org/apache/coyote/http2/HpackEncoder.java > @@ -44,7 +44,13 @@ class HpackEncoder { > public boolean shouldUseIndexing(String headerName, String value) > { > //content length and date change all the time > //no need to index them, or they will churn the table > -return !headerName.equals("content-length") && > !headerName.equals("date"); > +switch (headerName) { > +case "content-length": > +case "date": > +return false; > +default: > +return true; > +} > } > > @Override > @@ -258,8 +264,8 @@ class HpackEncoder { > private void preventPositionRollover() { > //if the position counter is about to roll over we iterate all > the table entries > //and set their position to their actual position > -for (Map.Entry> entry : > dynamicTable.entrySet()) { > -for (TableEntry t : entry.getValue()) { > +for (List tableEntries : dynamicTable.values()) { > +for (TableEntry t : tableEntries) { > t.position = t.getPosition(); > } > } > > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > >
buildbot failure in on tomcat-9-trunk
The Buildbot has detected a new failure on builder tomcat-9-trunk while building tomcat. Full details are available at: https://ci.apache.org/builders/tomcat-9-trunk/builds/462 Buildbot URL: https://ci.apache.org/ Buildslave for this Build: asf946_ubuntu Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-9-commit' triggered this build Build Source Stamp: [branch 9.0.x] b8e5607a4fccfd47ad653c5788ac1ba052411094 Blamelist: Martin Tzvetanov Grigorov 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
[tomcat] branch master updated: Throw SQLException instead of NullpointerException when failing to connect to the database
This is an automated email from the ASF dual-hosted git repository. kfujino 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 c5eefc7 Throw SQLException instead of NullpointerException when failing to connect to the database c5eefc7 is described below commit c5eefc75a84b9f02ac5b50a06b95bcc18537569f Author: KeiichiFujino AuthorDate: Thu Sep 24 21:48:52 2020 +0900 Throw SQLException instead of NullpointerException when failing to connect to the database --- java/org/apache/catalina/session/JDBCStore.java | 3 +++ java/org/apache/catalina/session/LocalStrings.properties | 1 + webapps/docs/changelog.xml | 5 + 3 files changed, 9 insertions(+) diff --git a/java/org/apache/catalina/session/JDBCStore.java b/java/org/apache/catalina/session/JDBCStore.java index bb57db0..63370c8 100644 --- a/java/org/apache/catalina/session/JDBCStore.java +++ b/java/org/apache/catalina/session/JDBCStore.java @@ -936,6 +936,9 @@ public class JDBCStore extends StoreBase { if (connectionPassword != null) props.put("password", connectionPassword); dbConnection = driver.connect(connectionURL, props); +if (dbConnection == null) { +throw new SQLException(sm.getString(getStoreName() + ".connectError", connectionURL)); +} dbConnection.setAutoCommit(true); return dbConnection; diff --git a/java/org/apache/catalina/session/LocalStrings.properties b/java/org/apache/catalina/session/LocalStrings.properties index 127cd43..dae4f68 100644 --- a/java/org/apache/catalina/session/LocalStrings.properties +++ b/java/org/apache/catalina/session/LocalStrings.properties @@ -25,6 +25,7 @@ JDBCStore.missingDataSourceName=No valid JNDI name was given. JDBCStore.removing=Removing Session [{0}] at database [{1}] JDBCStore.saving=Saving Session [{0}] to database [{1}] JDBCStore.wrongDataSource=Cannot open JNDI DataSource [{0}] +JDBCStore.connectError=Cannot connect to database [{0}] fileStore.createFailed=Unable to create directory [{0}] for the storage of session data fileStore.deleteFailed=Unable to delete file [{0}] which is preventing the creation of the session storage location diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index a6d3b84..a10d2c3 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -84,6 +84,11 @@ speed of applications with a large number of JARs. Patch provided by Jatin Kamnani. (remm) + +Throw SQLException instead of +NullpointerException when failing to connect to the +database. (kfujino) + - 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: Throw SQLException instead of NullpointerException when failing to connect to the database
This is an automated email from the ASF dual-hosted git repository. kfujino 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 478ac96 Throw SQLException instead of NullpointerException when failing to connect to the database 478ac96 is described below commit 478ac96b071ff32d4f649469cd88226ea7374680 Author: KeiichiFujino AuthorDate: Thu Sep 24 21:59:42 2020 +0900 Throw SQLException instead of NullpointerException when failing to connect to the database --- java/org/apache/catalina/session/JDBCStore.java | 3 +++ java/org/apache/catalina/session/LocalStrings.properties | 1 + webapps/docs/changelog.xml | 5 + 3 files changed, 9 insertions(+) diff --git a/java/org/apache/catalina/session/JDBCStore.java b/java/org/apache/catalina/session/JDBCStore.java index bb57db0..63370c8 100644 --- a/java/org/apache/catalina/session/JDBCStore.java +++ b/java/org/apache/catalina/session/JDBCStore.java @@ -936,6 +936,9 @@ public class JDBCStore extends StoreBase { if (connectionPassword != null) props.put("password", connectionPassword); dbConnection = driver.connect(connectionURL, props); +if (dbConnection == null) { +throw new SQLException(sm.getString(getStoreName() + ".connectError", connectionURL)); +} dbConnection.setAutoCommit(true); return dbConnection; diff --git a/java/org/apache/catalina/session/LocalStrings.properties b/java/org/apache/catalina/session/LocalStrings.properties index 127cd43..dae4f68 100644 --- a/java/org/apache/catalina/session/LocalStrings.properties +++ b/java/org/apache/catalina/session/LocalStrings.properties @@ -25,6 +25,7 @@ JDBCStore.missingDataSourceName=No valid JNDI name was given. JDBCStore.removing=Removing Session [{0}] at database [{1}] JDBCStore.saving=Saving Session [{0}] to database [{1}] JDBCStore.wrongDataSource=Cannot open JNDI DataSource [{0}] +JDBCStore.connectError=Cannot connect to database [{0}] fileStore.createFailed=Unable to create directory [{0}] for the storage of session data fileStore.deleteFailed=Unable to delete file [{0}] which is preventing the creation of the session storage location diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 96a0162..6f7f2c6 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -83,6 +83,11 @@ speed of applications with a large number of JARs. Patch provided by Jatin Kamnani. (remm) + +Throw SQLException instead of +NullpointerException when failing to connect to the +database. (kfujino) + - 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: Throw SQLException instead of NullpointerException when failing to connect to the database
This is an automated email from the ASF dual-hosted git repository. kfujino 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 2336406 Throw SQLException instead of NullpointerException when failing to connect to the database 2336406 is described below commit 2336406ef98ee096e81b64e656dcbf9e0e5a9b10 Author: KeiichiFujino AuthorDate: Thu Sep 24 22:07:53 2020 +0900 Throw SQLException instead of NullpointerException when failing to connect to the database --- java/org/apache/catalina/session/JDBCStore.java | 3 +++ java/org/apache/catalina/session/LocalStrings.properties | 1 + webapps/docs/changelog.xml | 5 + 3 files changed, 9 insertions(+) diff --git a/java/org/apache/catalina/session/JDBCStore.java b/java/org/apache/catalina/session/JDBCStore.java index 78f5e11..6e16d59 100644 --- a/java/org/apache/catalina/session/JDBCStore.java +++ b/java/org/apache/catalina/session/JDBCStore.java @@ -935,6 +935,9 @@ public class JDBCStore extends StoreBase { if (connectionPassword != null) props.put("password", connectionPassword); dbConnection = driver.connect(connectionURL, props); +if (dbConnection == null) { +throw new SQLException(sm.getString(getStoreName() + ".connectError", connectionURL)); +} dbConnection.setAutoCommit(true); return dbConnection; diff --git a/java/org/apache/catalina/session/LocalStrings.properties b/java/org/apache/catalina/session/LocalStrings.properties index 127cd43..dae4f68 100644 --- a/java/org/apache/catalina/session/LocalStrings.properties +++ b/java/org/apache/catalina/session/LocalStrings.properties @@ -25,6 +25,7 @@ JDBCStore.missingDataSourceName=No valid JNDI name was given. JDBCStore.removing=Removing Session [{0}] at database [{1}] JDBCStore.saving=Saving Session [{0}] to database [{1}] JDBCStore.wrongDataSource=Cannot open JNDI DataSource [{0}] +JDBCStore.connectError=Cannot connect to database [{0}] fileStore.createFailed=Unable to create directory [{0}] for the storage of session data fileStore.deleteFailed=Unable to delete file [{0}] which is preventing the creation of the session storage location diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index cdc6c96..1c0d118 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -62,6 +62,11 @@ 64715: Add PasswordValidationCallback to the JASPIC implementation. Patch provided by Robert Rodewald. (markt) + +Throw SQLException instead of +NullpointerException when failing to connect to the +database. (kfujino) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch master updated: Update to CXF 3.4.0
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 d2f30cf Update to CXF 3.4.0 new 38e42dd Merge branch 'master' of g...@github.com:apache/tomcat.git d2f30cf is described below commit d2f30cf0760c0ef3f6a2b3945411618fe8411a46 Author: remm AuthorDate: Thu Sep 24 15:08:06 2020 +0200 Update to CXF 3.4.0 --- modules/cxf/pom.xml| 10 -- webapps/docs/changelog.xml | 3 +++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/cxf/pom.xml b/modules/cxf/pom.xml index 220ae64..aa869ad 100644 --- a/modules/cxf/pom.xml +++ b/modules/cxf/pom.xml @@ -29,7 +29,7 @@ Apache CXF for Apache Tomcat CDI Apache CXF packaged for Apache Tomcat CDI -3.3.6 +3.4.0 jar @@ -127,11 +127,9 @@ jakarta.annotation:jakarta.annotation-api jakarta.el:* - javax.annotation:javax.annotation-api -javax.el:* - javax.enterprise:cdi-api - javax.inject:* - javax.interceptor:* + jakarta.enterprise:jakarta.enterprise.cdi-api + jakarta.inject:* + jakarta.interceptor:* org.apache.ant:* org.codehaus.woodstox:* diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index a6d3b84..f58a592 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -159,6 +159,9 @@ Update the OWB module to Apache OpenWebBeans 2.0.18. (remm) + +Update the CXF module to Apache CXF 3.4.0. (remm) + - 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: OWB 2.0.18
This is an automated email from the ASF dual-hosted git repository. remm 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 6cbf57d OWB 2.0.18 6cbf57d is described below commit 6cbf57d0c2853b46c51b758609400164111dd635 Author: remm AuthorDate: Thu Sep 24 15:12:15 2020 +0200 OWB 2.0.18 --- modules/owb/pom.xml| 4 ++-- webapps/docs/changelog.xml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/owb/pom.xml b/modules/owb/pom.xml index 7fe93e5..f9bc4f8 100644 --- a/modules/owb/pom.xml +++ b/modules/owb/pom.xml @@ -29,14 +29,14 @@ Apache Tomcat CDI 2 support Apache Tomcat CDI 2 support using Apache OpenWebBeans -2.0.17 +2.0.18 jar 1.0 1.0 1.0.1 -9.0.36 +9.0.38 diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 6f7f2c6..be4a6f9 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -160,6 +160,9 @@ Expand coverage of Russian translations. Pull request provided by Nikolay Gribanov. (markt) + +Update the OWB module to Apache OpenWebBeans 2.0.18. (remm) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch master updated: Fix new shade plugin warnings
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 a8852a6 Fix new shade plugin warnings a8852a6 is described below commit a8852a6fa609d7353d9701ffaa331174f63e7330 Author: remm AuthorDate: Thu Sep 24 16:02:58 2020 +0200 Fix new shade plugin warnings --- modules/cxf/pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/cxf/pom.xml b/modules/cxf/pom.xml index aa869ad..495ec6b 100644 --- a/modules/cxf/pom.xml +++ b/modules/cxf/pom.xml @@ -125,6 +125,7 @@ +jakarta.activation:* jakarta.annotation:jakarta.annotation-api jakarta.el:* jakarta.enterprise:jakarta.enterprise.cdi-api @@ -152,6 +153,7 @@ META-INF/NOTICE.txt META-INF/NOTICE +module-info.class META-INF/cxf/cxf.* META-INF/cxf/cxf-servlet.* META-INF/cxf/org.apache.cxf.bus.factory - 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: Update to CXF 3.4.0
This is an automated email from the ASF dual-hosted git repository. remm 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 199f501 Update to CXF 3.4.0 199f501 is described below commit 199f501ad225154fcb8a307ddd645f83bd6dada8 Author: remm AuthorDate: Thu Sep 24 16:04:22 2020 +0200 Update to CXF 3.4.0 --- modules/cxf/pom.xml| 14 -- webapps/docs/changelog.xml | 3 +++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/modules/cxf/pom.xml b/modules/cxf/pom.xml index 5fe8f7d..84aec80 100644 --- a/modules/cxf/pom.xml +++ b/modules/cxf/pom.xml @@ -29,7 +29,7 @@ Apache CXF for Apache Tomcat CDI Apache CXF packaged for Apache Tomcat CDI -3.3.6 +3.4.0 jar @@ -125,11 +125,12 @@ - javax.annotation:javax.annotation-api - javax.el:* - javax.enterprise:cdi-api - javax.inject:* - javax.interceptor:* +jakarta.activation:* + jakarta.annotation:jakarta.annotation-api +jakarta.el:* + jakarta.enterprise:jakarta.enterprise.cdi-api +jakarta.inject:* +jakarta.interceptor:* org.apache.ant:* org.codehaus.woodstox:* @@ -152,6 +153,7 @@ META-INF/NOTICE.txt META-INF/NOTICE +module-info.class META-INF/cxf/cxf.* META-INF/cxf/cxf-servlet.* META-INF/cxf/org.apache.cxf.bus.factory diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index be4a6f9..32c2ba7 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -163,6 +163,9 @@ Update the OWB module to Apache OpenWebBeans 2.0.18. (remm) + +Update the CXF module to Apache CXF 3.4.0. (remm) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 01/02: Improve handling of HTTP/2 connection preface
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 commit 9083cea2ef8b1bc4a8fdbe5dcd544f4edc204dea Author: Mark Thomas AuthorDate: Thu Sep 24 15:50:35 2020 +0100 Improve handling of HTTP/2 connection preface Only process the connection if the preface is processed without error. If an error is detected, trigger the connection close. --- java/org/apache/coyote/http2/Http2AsyncParser.java | 9 + webapps/docs/changelog.xml | 5 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/java/org/apache/coyote/http2/Http2AsyncParser.java b/java/org/apache/coyote/http2/Http2AsyncParser.java index c76effc..ed565fd 100644 --- a/java/org/apache/coyote/http2/Http2AsyncParser.java +++ b/java/org/apache/coyote/http2/Http2AsyncParser.java @@ -35,7 +35,7 @@ class Http2AsyncParser extends Http2Parser { private final SocketWrapperBase socketWrapper; private final Http2AsyncUpgradeHandler upgradeHandler; -private Throwable error = null; +private volatile Throwable error = null; Http2AsyncParser(String connectionId, Input input, Output output, SocketWrapperBase socketWrapper, Http2AsyncUpgradeHandler upgradeHandler) { super(connectionId, input, output); @@ -117,13 +117,14 @@ class Http2AsyncParser extends Http2Parser { if (payload.hasRemaining()) { socketWrapper.unRead(payload); } +// Finish processing the connection +upgradeHandler.processConnectionCallback(webConnection, stream); +} else { +upgradeHandler.closeConnection(new ConnectionException(error.getMessage(), Http2Error.PROTOCOL_ERROR, error)); } -// Finish processing the connection -upgradeHandler.processConnectionCallback(webConnection, stream); // Continue reading frames upgradeHandler.upgradeDispatch(SocketEvent.OPEN_READ); } - } @Override diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 005a046..85b7eee 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -115,6 +115,11 @@ in-flight asynchronous requests. The tracking enables Tomcat to shutdown gracefully when asynchronous processing is in use. (markt) + +Improve the error handling for the HTTP/2 connection preface when the +Connector is configured with useAsycIO="true". +(markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch master updated (a8852a6 -> e1a1a32)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git. from a8852a6 Fix new shade plugin warnings new 9083cea Improve handling of HTTP/2 connection preface new e1a1a32 Improve test for invalid client preface 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/coyote/http2/Http2AsyncParser.java | 9 +++--- .../apache/coyote/http2/TestHttp2Section_3_5.java | 32 ++ webapps/docs/changelog.xml | 5 3 files changed, 36 insertions(+), 10 deletions(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 02/02: Improve test for invalid client preface
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 commit e1a1a324e93b568804153e02281bc4ec625c3ba7 Author: Mark Thomas AuthorDate: Thu Sep 24 15:57:14 2020 +0100 Improve test for invalid client preface --- .../apache/coyote/http2/TestHttp2Section_3_5.java | 32 ++ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/test/org/apache/coyote/http2/TestHttp2Section_3_5.java b/test/org/apache/coyote/http2/TestHttp2Section_3_5.java index dc09ca4..e9a9e0e 100644 --- a/test/org/apache/coyote/http2/TestHttp2Section_3_5.java +++ b/test/org/apache/coyote/http2/TestHttp2Section_3_5.java @@ -18,22 +18,42 @@ package org.apache.coyote.http2; import java.io.IOException; +import org.junit.Assert; import org.junit.Test; public class TestHttp2Section_3_5 extends Http2TestBase { -@Test(expected=IOException.class) +@Test public void testNoConnectionPreface() throws Exception { enableHttp2(); configureAndStartWebApplication(); openClientConnection(); doHttpUpgrade(); -// Should send client preface here -sendPing(); -// Send several pings else server will block waiting for the client -// preface which is longer than a single ping. + +// Server settings +parser.readFrame(true); +Assert.assertEquals("0-Settings-[3]-[200]\n" + +"0-Settings-End\n" +, output.getTrace()); +output.clearTrace(); + +// Should send client preface here. This will trigger an error. +// Send two pings (2*(9+8)=34 bytes) as server looks for entire preface +// of 24 bytes. sendPing(); sendPing(); -validateHttp2InitialResponse(); + +// If the client preface had been valid, this would be an +// acknowledgement. Of the settings. As the preface was invalid, it +// should be a GOAWAY frame. +try { +parser.readFrame(true); +Assert.assertTrue(output.getTrace(), output.getTrace().startsWith("0-Goaway-[1]-[1]-[")); +} catch (IOException ioe) { +// Ignore +// This is expected on some platforms and depends on timing. Once +// the server closes the connection the client may see an exception +// when trying to read the GOAWAY frame. +} } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 01/02: Improve handling of HTTP/2 connection preface
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit c688f8d0b728ca37ffad44d7f50f1aa5778c200f Author: Mark Thomas AuthorDate: Thu Sep 24 15:50:35 2020 +0100 Improve handling of HTTP/2 connection preface Only process the connection if the preface is processed without error. If an error is detected, trigger the connection close. --- java/org/apache/coyote/http2/Http2AsyncParser.java | 9 + webapps/docs/changelog.xml | 5 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/java/org/apache/coyote/http2/Http2AsyncParser.java b/java/org/apache/coyote/http2/Http2AsyncParser.java index 2452572..12fa3bb 100644 --- a/java/org/apache/coyote/http2/Http2AsyncParser.java +++ b/java/org/apache/coyote/http2/Http2AsyncParser.java @@ -35,7 +35,7 @@ class Http2AsyncParser extends Http2Parser { private final SocketWrapperBase socketWrapper; private final Http2AsyncUpgradeHandler upgradeHandler; -private Throwable error = null; +private volatile Throwable error = null; Http2AsyncParser(String connectionId, Input input, Output output, SocketWrapperBase socketWrapper, Http2AsyncUpgradeHandler upgradeHandler) { super(connectionId, input, output); @@ -117,13 +117,14 @@ class Http2AsyncParser extends Http2Parser { if (payload.hasRemaining()) { socketWrapper.unRead(payload); } +// Finish processing the connection +upgradeHandler.processConnectionCallback(webConnection, stream); +} else { +upgradeHandler.closeConnection(new ConnectionException(error.getMessage(), Http2Error.PROTOCOL_ERROR, error)); } -// Finish processing the connection -upgradeHandler.processConnectionCallback(webConnection, stream); // Continue reading frames upgradeHandler.upgradeDispatch(SocketEvent.OPEN_READ); } - } @Override diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 32c2ba7..06ec832 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -114,6 +114,11 @@ in-flight asynchronous requests. The tracking enables Tomcat to shutdown gracefully when asynchronous processing is in use. (markt) + +Improve the error handling for the HTTP/2 connection preface when the +Connector is configured with useAsycIO="true". +(markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 02/02: Improve test for invalid client preface
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit cb137e09d3445e0edaf69ccc75fea5eb0c60ce3d Author: Mark Thomas AuthorDate: Thu Sep 24 15:57:14 2020 +0100 Improve test for invalid client preface --- .../apache/coyote/http2/TestHttp2Section_3_5.java | 32 ++ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/test/org/apache/coyote/http2/TestHttp2Section_3_5.java b/test/org/apache/coyote/http2/TestHttp2Section_3_5.java index dc09ca4..e9a9e0e 100644 --- a/test/org/apache/coyote/http2/TestHttp2Section_3_5.java +++ b/test/org/apache/coyote/http2/TestHttp2Section_3_5.java @@ -18,22 +18,42 @@ package org.apache.coyote.http2; import java.io.IOException; +import org.junit.Assert; import org.junit.Test; public class TestHttp2Section_3_5 extends Http2TestBase { -@Test(expected=IOException.class) +@Test public void testNoConnectionPreface() throws Exception { enableHttp2(); configureAndStartWebApplication(); openClientConnection(); doHttpUpgrade(); -// Should send client preface here -sendPing(); -// Send several pings else server will block waiting for the client -// preface which is longer than a single ping. + +// Server settings +parser.readFrame(true); +Assert.assertEquals("0-Settings-[3]-[200]\n" + +"0-Settings-End\n" +, output.getTrace()); +output.clearTrace(); + +// Should send client preface here. This will trigger an error. +// Send two pings (2*(9+8)=34 bytes) as server looks for entire preface +// of 24 bytes. sendPing(); sendPing(); -validateHttp2InitialResponse(); + +// If the client preface had been valid, this would be an +// acknowledgement. Of the settings. As the preface was invalid, it +// should be a GOAWAY frame. +try { +parser.readFrame(true); +Assert.assertTrue(output.getTrace(), output.getTrace().startsWith("0-Goaway-[1]-[1]-[")); +} catch (IOException ioe) { +// Ignore +// This is expected on some platforms and depends on timing. Once +// the server closes the connection the client may see an exception +// when trying to read the GOAWAY frame. +} } } - 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 (199f501 -> cb137e0)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git. from 199f501 Update to CXF 3.4.0 new c688f8d Improve handling of HTTP/2 connection preface new cb137e0 Improve test for invalid client preface 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/coyote/http2/Http2AsyncParser.java | 9 +++--- .../apache/coyote/http2/TestHttp2Section_3_5.java | 32 ++ webapps/docs/changelog.xml | 5 3 files changed, 36 insertions(+), 10 deletions(-) - 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 test for invalid client preface
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 cd573af Improve test for invalid client preface cd573af is described below commit cd573afbaed8256c4d39bdf07e579b30f15e1409 Author: Mark Thomas AuthorDate: Thu Sep 24 15:57:14 2020 +0100 Improve test for invalid client preface --- .../apache/coyote/http2/TestHttp2Section_3_5.java | 32 ++ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/test/org/apache/coyote/http2/TestHttp2Section_3_5.java b/test/org/apache/coyote/http2/TestHttp2Section_3_5.java index dc09ca4..e9a9e0e 100644 --- a/test/org/apache/coyote/http2/TestHttp2Section_3_5.java +++ b/test/org/apache/coyote/http2/TestHttp2Section_3_5.java @@ -18,22 +18,42 @@ package org.apache.coyote.http2; import java.io.IOException; +import org.junit.Assert; import org.junit.Test; public class TestHttp2Section_3_5 extends Http2TestBase { -@Test(expected=IOException.class) +@Test public void testNoConnectionPreface() throws Exception { enableHttp2(); configureAndStartWebApplication(); openClientConnection(); doHttpUpgrade(); -// Should send client preface here -sendPing(); -// Send several pings else server will block waiting for the client -// preface which is longer than a single ping. + +// Server settings +parser.readFrame(true); +Assert.assertEquals("0-Settings-[3]-[200]\n" + +"0-Settings-End\n" +, output.getTrace()); +output.clearTrace(); + +// Should send client preface here. This will trigger an error. +// Send two pings (2*(9+8)=34 bytes) as server looks for entire preface +// of 24 bytes. sendPing(); sendPing(); -validateHttp2InitialResponse(); + +// If the client preface had been valid, this would be an +// acknowledgement. Of the settings. As the preface was invalid, it +// should be a GOAWAY frame. +try { +parser.readFrame(true); +Assert.assertTrue(output.getTrace(), output.getTrace().startsWith("0-Goaway-[1]-[1]-[")); +} catch (IOException ioe) { +// Ignore +// This is expected on some platforms and depends on timing. Once +// the server closes the connection the client may see an exception +// when trying to read the GOAWAY frame. +} } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 64765] New: ThreadPoolExecutor#submittedCount wrong after undeploy
https://bz.apache.org/bugzilla/show_bug.cgi?id=64765 Bug ID: 64765 Summary: ThreadPoolExecutor#submittedCount wrong after undeploy Product: Tomcat 9 Version: 9.0.38 Hardware: PC OS: All Status: NEW Severity: normal Priority: P2 Component: Util Assignee: dev@tomcat.apache.org Reporter: m...@bsi-software.com Target Milestone: - Created attachment 37468 --> https://bz.apache.org/bugzilla/attachment.cgi?id=37468&action=edit screenshots Steps to reproduce: 1. download Tomcat 9.0.38 (older versions are affected as well) 2. configure user for the manager application 3. start Tomcat 4. navigate to the manager web application and install a webapp having a servlet that performs some long running tasks (e.g. 30 seconds for one request) 5. Open several browsers (because some browsers limit the number of connections to the same host) and navigate to the installed webapp (e.g. query the servlet 20 times in parallel). This puts the worker threads of the internal thread pool at load. 6. In the manager web application undeploy the webapp again while the 20 requests are still running. 7. After a few seconds the webapp is undeployed. 8. Redeploy the webapp again 9. Refresh the 20 web pages to put the worker threads at load again. Observation after the redeploy: Some of the requests arrive at the servlet immediately (as it should) and some only arrive after a long delay (e.g. 30 seconds). Problem Analysis: The Thread Pool uses a core pool size of 10 and a max pool size of 200. So basically, there is space to create more worker threads. However, the pool enqueues the request in the work queue without creating a new worker for it. And as the other workers are all busy handling the 30 seconds long requests, it stays in the queue until a worker finishes. Expected behavior would be that a new worker thread is created and the request is processed immediately. The reason why no worker is created can be found in code line [1]: The queue uses the submittedCount property of the pool to decide whether new workers are required. Unfortunately, at this point the value returned is wrong (too low). As a result, the runnable is just saved without creating more workers. The submittedCount value of the pool is running out of sync during the undeploy of the webapp. At a certain point (if the webapp is undeployed while there are long running requests working) this number becomes a negative value. The attached screenshots illustrate the moment in which the submittedCount would become negative: Screenshot 0 shows the two stack frames both standing at [2]. Screenshot 1 shows that at this moment the submittedCount property already has the value 0 and would become negative right afterwards. Screenshot 2 shows the position of worker "exec-11" currently executing "afterExecute" for task with id=617 Screenshot 3 shows the position of worker "exec-13" currently executing "afterExecute" for the same task but in the catch block (see [4]). Screenshot 4 shows the position of worker "exec-13" again but indicating that the exception is of type "StopPooledThreadException". After all threads completed their work, submittedCount in the thread pool has a value of e.g. -8. If the webapp is deployed again and e.g. 10 worker threads are still in the pool, the 10 first requests to the webapp are processed immediately as there are workers available. And as these requests are quite long, these 10 workers stay in use. The next request would basically be the first that requires a new worker thread to be created. But as the submittedCount now has the value 2 (-8 after the deploy + 10 new requests) the task queue will return at [1] putting the request in the waiting queue. The correct behavior would be to return false (two lines further down) which would instruct the pool to create new workers. The request will only be processed when the next 30 seconds request ends. In this situation tomcat must be restarted because responsiveness drops rapidly. Some thoughts: - I am not sure about the internals but is correct that the "afterExecute" is called several times in parallel for the same task as shown in the screenshots? - In case the StopPooledThreadException is thrown at [3] it is caught from [4] which executes "afterExecute" again as shown in screenshot 3. Is this correct? In general, somehow should be ensured that the submittedCount of "org.apache.tomcat.util.threads.ThreadPoolExecutor" cannot become negative. Otherwise the whole thread pool is broken. [1] https://github.com/apache/tomcat/blob/9.0.38/java/org/apache/tomcat/util/threads/TaskQueue.java#L79 [2] https://github.com/apache/tomcat/blob/9.0.38/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java#L95 [3] https://github.com/apache/tomcat/blob/9.0.38/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java#L118 [4] https://github.com/openjdk/jdk/blob/jdk-11%2B7
[Bug 64765] ThreadPoolExecutor#submittedCount wrong after undeploy
https://bz.apache.org/bugzilla/show_bug.cgi?id=64765 --- Comment #1 from m...@bsi-software.com --- Possible workaround: In the context.xml: set the renewThreadsWhenStoppingContext property to false. See https://tomcat.apache.org/tomcat-9.0-doc/config/context.html -- 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
buildbot success in on tomcat-9-trunk
The Buildbot has detected a restored build on builder tomcat-9-trunk while building tomcat. Full details are available at: https://ci.apache.org/builders/tomcat-9-trunk/builds/463 Buildbot URL: https://ci.apache.org/ Buildslave for this Build: asf946_ubuntu Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-9-commit' triggered this build Build Source Stamp: [branch 9.0.x] 199f501ad225154fcb8a307ddd645f83bd6dada8 Blamelist: KeiichiFujino ,remm Build succeeded! 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-85-trunk
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/2483 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] cd573afbaed8256c4d39bdf07e579b30f15e1409 Blamelist: KeiichiFujino ,Mark Thomas BUILD FAILED: failed shell_11 Sincerely, -The Buildbot - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[GitHub] [tomcat] kamnani commented on a change in pull request #351: Remove White Spaces from the JSP files
kamnani commented on a change in pull request #351: URL: https://github.com/apache/tomcat/pull/351#discussion_r494418331 ## File path: java/org/apache/jasper/compiler/Generator.java ## @@ -2095,6 +2101,20 @@ public void visit(Node.JspElement n) throws JasperException { public void visit(Node.TemplateText n) throws JasperException { String text = n.getText(); +// If the flag is active, attempt to minimize the frequency of +// regex operations. +if ((ctxt!=null) && +ctxt.getOptions().getJSPWhiteSpaceTrimFlag() && +text.contains("\n")) { +// Ensure there are no or tags embedded in this +// text - if there are, we want to NOT modify the whitespace. +Matcher preMatcher = PRE_TAG_PATTERN.matcher(text); +if (!preMatcher.matches()) { +Matcher matcher = BLANK_LINE_PATTERN.matcher(text); +String revisedText = matcher.replaceAll("\n"); Review comment: yes, it is intentional. We replace it with just one "\n. 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 - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[GitHub] [tomcat] kamnani commented on pull request #351: Remove White Spaces from the JSP files
kamnani commented on pull request #351: URL: https://github.com/apache/tomcat/pull/351#issuecomment-698430292 > Since there is no new test for this I am not sure but looking at the code I think "Remove white space" is not quite accurate. > It is rather "Remove empty lines". Because BLANK_LINE_PATTERN would match only if there zero or more empty spaces, followed by at least one new line, followed by 0 or more empty spaces. > So the example above: > > ``` > | > | Quick Servlet Demo > | > ``` > > won't produce: > > ``` > | > | Quick Servlet Demo > | > ``` > > In addition: why preserve 1 new line ? HTML minifiers would produce something like `.` I think the node text comes like this `\n` and this will be caught by the BLANK_LINE_PATTERN and thus will later be turned down to `\n` after the processing. I assume you are not taking the node correctly. But on a broader aspect ``` | | Quick Servlet Demo | ``` Will produce ``` | | Quick Servlet Demo | ``` 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 - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[GitHub] [tomcat] kamnani edited a comment on pull request #351: Remove White Spaces from the JSP files
kamnani edited a comment on pull request #351: URL: https://github.com/apache/tomcat/pull/351#issuecomment-698430292 > Since there is no new test for this I am not sure but looking at the code I think "Remove white space" is not quite accurate. > It is rather "Remove empty lines". Because BLANK_LINE_PATTERN would match only if there zero or more empty spaces, followed by at least one new line, followed by 0 or more empty spaces. > So the example above: > > ``` > | > | Quick Servlet Demo > | > ``` > > won't produce: > > ``` > | > | Quick Servlet Demo > | > ``` > > In addition: why preserve 1 new line ? HTML minifiers would produce something like `.` I think the node text comes like this `\n` and this will be caught by the BLANK_LINE_PATTERN and thus will later be turned down to `\n` after the processing. I assume you are not taking the node correctly. But on a broader aspect ``` | | Quick Servlet Demo | ``` Will produce ``` | | Quick Servlet Demo | ``` I agree to the minifying part, so we can rather just replace it with an empty character in the end instead of new line character and that will do the job too and will thus be more optimized. 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 - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
buildbot failure in on tomcat-9-trunk
The Buildbot has detected a new failure on builder tomcat-9-trunk while building tomcat. Full details are available at: https://ci.apache.org/builders/tomcat-9-trunk/builds/464 Buildbot URL: https://ci.apache.org/ Buildslave for this Build: asf946_ubuntu Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-9-commit' triggered this build Build Source Stamp: [branch 9.0.x] cb137e09d3445e0edaf69ccc75fea5eb0c60ce3d Blamelist: Mark Thomas BUILD FAILED: failed shell_11 Sincerely, -The Buildbot - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[GitHub] [tomcat] kdillane commented on pull request #351: Remove White Spaces from the JSP files
kdillane commented on pull request #351: URL: https://github.com/apache/tomcat/pull/351#issuecomment-698458135 > > Since there is no new test for this I am not sure but looking at the code I think "Remove white space" is not quite accurate. > > It is rather "Remove empty lines". Because BLANK_LINE_PATTERN would match only if there zero or more empty spaces, followed by at least one new line, followed by 0 or more empty spaces. > > So the example above: > > ``` > > | > > | Quick Servlet Demo > > | > > ``` > > > > > > won't produce: > > ``` > > | > > | Quick Servlet Demo > > | > > ``` > > > > > > In addition: why preserve 1 new line ? HTML minifiers would produce something like `.` > > I think the node text comes like this `\n` and this will be caught by the BLANK_LINE_PATTERN and thus will later be turned down to `\n` after the processing. I assume you are not taking the node correctly. > > But on a broader aspect > > ``` > | > | Quick Servlet Demo > | > ``` > > Will produce > > ``` > | > | Quick Servlet Demo > | > ``` > > I agree to the minifying part, so we can rather just replace it with an empty character in the end instead of new line character and that will do the job too and will thus be more optimized. I'd recommend adding a test to cover this use-case. 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 - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org