[tomcat] branch main updated: XML is not Javadoc

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 24f542c70a XML is not Javadoc
24f542c70a is described below

commit 24f542c70af43016ab2eb1347b1cb8177cc8cdf3
Author: Mark Thomas 
AuthorDate: Fri Jan 20 08:56:18 2023 +

XML is not Javadoc
---
 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 9fd2f679a3..be9e36c616 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -123,7 +123,7 @@
   
   
 Implement the new Servlet API methods for setting character encodings
-that accept {@code Charset} objects. (markt)
+that accept Charset objects. (markt)
   
   
 The default HEAD response no longer includes the payload HTTP header


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



[tomcat] branch main updated: Fix typo in changelog.

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

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


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

commit 099f5062a578d2a7df39c303eaa85a8ae7609091
Author: Rainer Jung 
AuthorDate: Fri Jan 20 10:24:13 2023 +0100

Fix 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 be9e36c616..32076954cb 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -167,7 +167,7 @@
 name that required escaping when used in a URI path. (markt)
   
   
-66392: Change the default value of 
AccessLogValue's
+66392: Change the default value of 
AccessLogValve's
 file encoding to UTF-8 and update documentation. (lihan)
   
   


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



[tomcat] branch 10.1.x updated: Fix typo in changelog.

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

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


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

commit bad914bac82a2eac2d327b8d2bee280b8050b4d9
Author: Rainer Jung 
AuthorDate: Fri Jan 20 10:26:06 2023 +0100

Fix 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 1558ef3159..066872b6f7 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -139,7 +139,7 @@
 name that required escaping when used in a URI path. (markt)
   
   
-66392: Change the default value of 
AccessLogValue's
+66392: Change the default value of 
AccessLogValve's
 file encoding to UTF-8 and update documentation. (lihan)
   
   


-
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 typo in changelog.

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 929153dacd Fix typo in changelog.
929153dacd is described below

commit 929153dacde36282497db4e5776bca02e8e71b2a
Author: Rainer Jung 
AuthorDate: Fri Jan 20 10:27:32 2023 +0100

Fix 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 2b4c3ffd89..ded49284b6 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -139,7 +139,7 @@
 name that required escaping when used in a URI path. (markt)
   
   
-66392: Change the default value of 
AccessLogValue's
+66392: Change the default value of 
AccessLogValve's
 file encoding to UTF-8 and update documentation. (lihan)
   
   


-
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 typo in changelog.

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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 4f84a8d2fc Fix typo in changelog.
4f84a8d2fc is described below

commit 4f84a8d2fca84e6314d9aaadb376f1a66ef7
Author: Rainer Jung 
AuthorDate: Fri Jan 20 10:28:07 2023 +0100

Fix 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 26476439f8..06ce5b368f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -142,7 +142,7 @@
 name that required escaping when used in a URI path. (markt)
   
   
-66392: Change the default value of 
AccessLogValue's
+66392: Change the default value of 
AccessLogValve's
 file encoding to UTF-8 and update documentation. (lihan)
   
   


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



Re: [tomcat] branch main updated: Update the default HEAD response to exclude payload headers

2023-01-20 Thread Konstantin Kolinko
чт, 19 янв. 2023 г. в 23:41, :
changelog.xml
> index 7570715faa..9fd2f679a3 100644
> --- a/webapps/docs/changelog.xml
> +++ b/webapps/docs/changelog.xml
> @@ -125,6 +125,10 @@
>  Implement the new Servlet API methods for setting character encodings
>  that accept {@code Charset} objects. (markt)
>
> +  
> +The default HEAD response no longer includes the payload HTTP header
> +fields as per section 9.3.2 of RFC 9110. (markt)
> +  

1. I think that you are actually referring to section 4.3.2."HEAD" of RFC 7231.
I do see words (an explicit "MAY") that allow such behaviour in
4.3.2.of RFC 7231,
but I fail to see them in 9.3.2 of RFC 9110.

I mean that RFC 7231 explicitly says
"except that the payload header fields (Section 3.3) MAY be omitted"

I do not see such words in RFC 9110.
and I do not see the term "payload HTTP header fields" (as mentioned
in our changelog) in RFC 9110.

I wish that RFC 9110 were more clear.


2. Trying to investigate, I see the following:

1) According to "B.3. Changes from RFC 7231" of RFC 9110, there was a
rename of terms:

[quote]
The terms "payload" and "payload body" have been replaced with
"content", to better align with its usage elsewhere (e.g., in field
names) and to avoid confusion with frame payloads in HTTP/2 and
HTTP/3. (Section 6.4)
[/quote]

2) A consequence is that "3.3. Payload Semantics" of RFC 7231 became
"6.4.1. Content Semantics " in RFC 9110.

The table listing "Payload header fields" in section 3.3 of RFC 7231
is gone in RFC 9110, and the term is gone.

3. I wonder whether it makes sense to make this feature configurable.

- I do not like it to be configurable, but I have a vague feeling that
I "know" about Content-Length header in responses to HEAD requests,
and that I used it for something, but I do not remember the details.

If one really used the value, I agree that such code (relying on a
Content-Length header received in response to a HEAD request) is
fragile. Has anyone seen such code in the wild?

- I agree that removing "Content-Length" and other headers makes
sense, as it aligns these responses with other no-content responses,
and as such makes behaviour more robust (and in this sense more
secure).

As such, it makes sense to backport it to earlier versions.

- It looks that we may omit any headers per 9.3.2. of RFC 9110, and
not only those four listed in 3.3 of RFC 7231:

First, 9.3.2. of RFC 9110 says "The server SHOULD send the same header fields",
It is "SHOULD", not "MUST".

Second, it mentions as an example that the "Vary" header may differ.

- Looking for examples in the wild,
https://stackoverflow.com/a/3854872
has an example of "Content-Length" / "Transfer-Encoding" headers being
present in responses generated in 2010.

4. Maybe keep this as is for Tomcat 11, but change the words in
changelog. They should not say "payload" when referring to RFC 9110,

Best regards,
Konstantin Kolinko

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



[tomcat-taglibs-parent] 02/02: Need newer version of BND to avoid ConcurrentModificationException on Java 15+

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 49e45f67efd71fc8e1659d006080b454c1bac0b6
Author: Mark Thomas 
AuthorDate: Fri Jan 20 10:06:29 2023 +

Need newer version of BND to avoid ConcurrentModificationException on Java 
15+
---
 pom.xml | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/pom.xml b/pom.xml
index 62975d1..704d937 100644
--- a/pom.xml
+++ b/pom.xml
@@ -142,6 +142,13 @@
 ${project.url}
   
 
+
+  
+biz.aQute.bnd
+biz.aQute.bndlib
+6.4.0
+  
+
   
 
   


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



[tomcat-taglibs-parent] 01/02: Need to be able to pass --add-opens=... when on Java 9+

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 437106e1bd7fc3865ce1b2ea894c8f0501045034
Author: Mark Thomas 
AuthorDate: Fri Jan 20 10:05:25 2023 +

Need to be able to pass --add-opens=... when on Java 9+
---
 pom.xml | 4 
 1 file changed, 4 insertions(+)

diff --git a/pom.xml b/pom.xml
index 3e0d74c..62975d1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,6 +40,7 @@
 8
 UTF-8
 UTF-8
+
   
 
   
@@ -116,6 +117,9 @@
   org.apache.maven.plugins
   maven-surefire-plugin
   3.0.0-M4
+  
+${surefire.argLine}
+  
 
 
   org.apache.maven.plugins


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



[tomcat-taglibs-parent] branch main updated (5c359d0 -> 49e45f6)

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 5c359d0  simplify Jenkinsfile
 new 437106e  Need to be able to pass --add-opens=... when on Java 9+
 new 49e45f6  Need newer version of BND to avoid 
ConcurrentModificationException on Java 15+

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:
 pom.xml | 11 +++
 1 file changed, 11 insertions(+)


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



[tomcat-taglibs-standard] branch main updated (4d3880e5 -> bc354858)

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 4d3880e5 minor changes as the code is now java 1.8
 add bc354858 Fix build for Java 17+ (detected by Gump)

No new revisions were added by this update.

Summary of changes:
 pom.xml | 13 +
 1 file changed, 13 insertions(+)


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



[GitHub] [tomcat-taglibs-standard] dependabot[bot] opened a new pull request, #6: Bump junit from 4.8.1 to 4.13.1

2023-01-20 Thread GitBox


dependabot[bot] opened a new pull request, #6:
URL: https://github.com/apache/tomcat-taglibs-standard/pull/6

   Bumps [junit](https://github.com/junit-team/junit4) from 4.8.1 to 4.13.1.
   
   Release notes
   Sourced from https://github.com/junit-team/junit4/releases";>junit's 
releases.
   
   JUnit 4.13.1
   Please refer to the https://github.com/junit-team/junit/blob/HEAD/doc/ReleaseNotes4.13.1.md";>release
 notes for details.
   JUnit 4.13
   Please refer to the https://github.com/junit-team/junit/blob/HEAD/doc/ReleaseNotes4.13.md";>release
 notes for details.
   JUnit 4.13 RC 2
   Please refer to the https://github.com/junit-team/junit4/wiki/4.13-Release-Notes";>release 
notes for details.
   JUnit 4.13 RC 1
   Please refer to the https://github.com/junit-team/junit4/wiki/4.13-Release-Notes";>release 
notes for details.
   JUnit 4.13 Beta 3
   Please refer to the https://github.com/junit-team/junit4/wiki/4.13-Release-Notes";>release 
notes for details.
   JUnit 4.13 Beta 2
   Please refer to the https://github.com/junit-team/junit4/wiki/4.13-Release-Notes";>release 
notes for details.
   JUnit 4.13 Beta 1
   Please refer to the https://github.com/junit-team/junit4/wiki/4.13-Release-Notes";>release 
notes for details.
   JUnit 4.12
   Please refer to the https://github.com/junit-team/junit/blob/HEAD/doc/ReleaseNotes4.12.md";>release
 notes for details.
   JUnit 4.12 Beta 3
   Please refer to the https://github.com/junit-team/junit/blob/HEAD/doc/ReleaseNotes4.12.md";>release
 notes for details.
   JUnit 4.12 Beta 2
   No release notes provided.
   JUnit 4.12 Beta 1
   No release notes provided.
   JUnit 4.11
   No release notes provided.
   
   
   
   Changelog
   Sourced from https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md";>junit's
 changelog.
   
   Summary of changes in version 4.13.1
   Rules
   Security fix: TemporaryFolder now limits access to 
temporary folders on Java 1.7 or later
   A local information disclosure vulnerability in 
TemporaryFolder has been fixed. See the published https://github.com/junit-team/junit4/security/advisories/GHSA-269g-pwp5-87pp";>security
 advisory for details.
   Test Runners
   [Pull request https://github-redirect.dependabot.com/junit-team/junit4/issues/1669";>#1669:](https://github-redirect.dependabot.com/junit-team/junit/pull/1669";>junit-team/junit#1669)
 Make FrameworkField constructor public
   Prior to this change, custom runners could make 
FrameworkMethod instances, but not FrameworkField 
instances. This small change allows for both now, because 
FrameworkField's constructor has been promoted from 
package-private to public.
   
   
   
   Commits
   
   https://github.com/junit-team/junit4/commit/1b683f4ec07bcfa40149f086d32240f805487e66";>1b683f4
 [maven-release-plugin] prepare release r4.13.1
   https://github.com/junit-team/junit4/commit/ce6ce3aadc070db2902698fe0d3dc6729cd631f2";>ce6ce3a
 Draft 4.13.1 release notes
   https://github.com/junit-team/junit4/commit/c29dd8239d6b353e699397eb090a1fd27411fa24";>c29dd82
 Change version to 4.13.1-SNAPSHOT
   https://github.com/junit-team/junit4/commit/1d174861f0b64f97ab0722bb324a760bfb02f567";>1d17486
 Add a link to assertThrows in exception testing
   https://github.com/junit-team/junit4/commit/543905df72ff10364b94dda27552efebf3dd04e9";>543905d
 Use separate line for annotation in Javadoc
   https://github.com/junit-team/junit4/commit/510e906b391e7e46a346e1c852416dc7be934944";>510e906
 Add sub headlines to class Javadoc
   https://github.com/junit-team/junit4/commit/610155b8c22138329f0723eec22521627dbc52ae";>610155b
 Merge pull request from GHSA-269g-pwp5-87pp
   https://github.com/junit-team/junit4/commit/b6cfd1e3d736cc2106242a8be799615b472c7fec";>b6cfd1e
 Explicitly wrap float parameter for consistency (https://github-redirect.dependabot.com/junit-team/junit4/issues/1671";>#1671)
   https://github.com/junit-team/junit4/commit/a5d205c7956dbed302b3bb5ecde5ba4299f0b646";>a5d205c
 Fix GitHub link in FAQ (https://github-redirect.dependabot.com/junit-team/junit4/issues/1672";>#1672)
   https://github.com/junit-team/junit4/commit/3a5c6b4d08f408c8ca6a8e0bae71a9bc5a8f97e8";>3a5c6b4
 Deprecated since jdk9 replacing constructor instance of Double and Float (https://github-redirect.dependabot.com/junit-team/junit4/issues/1660";>#1660)
   Additional commits viewable in https://github.com/junit-team/junit4/compare/r4.8.1...r4.13.1";>compare 
view
   
   
   
   
   
   [![Dependabot compatibility 
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=junit:junit&package-manager=maven&previous-version=4.8.1&new-version=4.13.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
   
   Dependabot will resolve any conflicts with this PR as long as you don't 
alter it yourself. You can also trigger a rebase manually by commenting 
`@dependabot rebase`.
   
   [//]: # (dependabot-auto

[tomcat-taglibs-standard] branch dependabot/maven/junit-junit-4.13.1 created (now 3ce805e1)

2023-01-20 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch dependabot/maven/junit-junit-4.13.1
in repository https://gitbox.apache.org/repos/asf/tomcat-taglibs-standard.git


  at 3ce805e1 Bump junit from 4.8.1 to 4.13.1

No new revisions were added by this update.


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



[GitHub] [tomcat-taglibs-standard] dependabot[bot] opened a new pull request, #7: Bump taglibs-standard-impl from 1.2.3-SNAPSHOT to 1.2.3 in /standard-test

2023-01-20 Thread GitBox


dependabot[bot] opened a new pull request, #7:
URL: https://github.com/apache/tomcat-taglibs-standard/pull/7

   Bumps taglibs-standard-impl from 1.2.3-SNAPSHOT to 1.2.3.
   
   
   [![Dependabot compatibility 
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=org.apache.taglibs:taglibs-standard-impl&package-manager=maven&previous-version=1.2.3-SNAPSHOT&new-version=1.2.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
   
   Dependabot will resolve any conflicts with this PR as long as you don't 
alter it yourself. You can also trigger a rebase manually by commenting 
`@dependabot rebase`.
   
   [//]: # (dependabot-automerge-start)
   [//]: # (dependabot-automerge-end)
   
   ---
   
   
   Dependabot commands and options
   
   
   You can trigger Dependabot actions by commenting on this PR:
   - `@dependabot rebase` will rebase this PR
   - `@dependabot recreate` will recreate this PR, overwriting any edits that 
have been made to it
   - `@dependabot merge` will merge this PR after your CI passes on it
   - `@dependabot squash and merge` will squash and merge this PR after your CI 
passes on it
   - `@dependabot cancel merge` will cancel a previously requested merge and 
block automerging
   - `@dependabot reopen` will reopen this PR if it is closed
   - `@dependabot close` will close this PR and stop Dependabot recreating it. 
You can achieve the same result by closing it manually
   - `@dependabot ignore this major version` will close this PR and stop 
Dependabot creating any more for this major version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this minor version` will close this PR and stop 
Dependabot creating any more for this minor version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this dependency` will close this PR and stop 
Dependabot creating any more for this dependency (unless you reopen the PR or 
upgrade to it yourself)
   - `@dependabot use these labels` will set the current labels as the default 
for future PRs for this repo and language
   - `@dependabot use these reviewers` will set the current reviewers as the 
default for future PRs for this repo and language
   - `@dependabot use these assignees` will set the current assignees as the 
default for future PRs for this repo and language
   - `@dependabot use this milestone` will set the current milestone as the 
default for future PRs for this repo and language
   
   You can disable automated security fix PRs for this repo from the [Security 
Alerts page](https://github.com/apache/tomcat-taglibs-standard/network/alerts).
   
   


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

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

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-taglibs-standard] branch dependabot/maven/standard-test/org.apache.taglibs-taglibs-standard-impl-1.2.3 created (now a662aaaf)

2023-01-20 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/maven/standard-test/org.apache.taglibs-taglibs-standard-impl-1.2.3
in repository https://gitbox.apache.org/repos/asf/tomcat-taglibs-standard.git


  at a662aaaf Bump taglibs-standard-impl in /standard-test

No new revisions were added by this update.


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



Re: [tomcat] branch main updated: Update the default HEAD response to exclude payload headers

2023-01-20 Thread Mark Thomas

On 20/01/2023 09:39, Konstantin Kolinko wrote:

чт, 19 янв. 2023 г. в 23:41, :
changelog.xml

index 7570715faa..9fd2f679a3 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -125,6 +125,10 @@
  Implement the new Servlet API methods for setting character encodings
  that accept {@code Charset} objects. (markt)

+  
+The default HEAD response no longer includes the payload HTTP header
+fields as per section 9.3.2 of RFC 9110. (markt)
+  


Thanks for the thorough review.


1. I think that you are actually referring to section 4.3.2."HEAD" of RFC 7231.
I do see words (an explicit "MAY") that allow such behaviour in
4.3.2.of RFC 7231,
but I fail to see them in 9.3.2 of RFC 9110.

I mean that RFC 7231 explicitly says
"except that the payload header fields (Section 3.3) MAY be omitted"

I do not see such words in RFC 9110.
and I do not see the term "payload HTTP header fields" (as mentioned
in our changelog) in RFC 9110.

I wish that RFC 9110 were more clear.


The text in 9110 is

"...a server MAY omit header fields for which a value is determined only 
while generating the content."



2. Trying to investigate, I see the following:

1) According to "B.3. Changes from RFC 7231" of RFC 9110, there was a
rename of terms:

[quote]
The terms "payload" and "payload body" have been replaced with
"content", to better align with its usage elsewhere (e.g., in field
names) and to avoid confusion with frame payloads in HTTP/2 and
HTTP/3. (Section 6.4)
[/quote]

2) A consequence is that "3.3. Payload Semantics" of RFC 7231 became
"6.4.1. Content Semantics " in RFC 9110.

The table listing "Payload header fields" in section 3.3 of RFC 7231
is gone in RFC 9110, and the term is gone.


Good point. I agree with your point below that the change log (and the 
code comments) need an update.



3. I wonder whether it makes sense to make this feature configurable.

- I do not like it to be configurable, but I have a vague feeling that
I "know" about Content-Length header in responses to HEAD requests,
and that I used it for something, but I do not remember the details.

If one really used the value, I agree that such code (relying on a
Content-Length header received in response to a HEAD request) is
fragile. Has anyone seen such code in the wild?

- I agree that removing "Content-Length" and other headers makes
sense, as it aligns these responses with other no-content responses,
and as such makes behaviour more robust (and in this sense more
secure).

As such, it makes sense to backport it to earlier versions.


I'd only want to back-port it if we made it configurable.


- It looks that we may omit any headers per 9.3.2. of RFC 9110, and
not only those four listed in 3.3 of RFC 7231:


Not quite any header. See the RFC 9110 quote above.


First, 9.3.2. of RFC 9110 says "The server SHOULD send the same header fields",
It is "SHOULD", not "MUST".

Second, it mentions as an example that the "Vary" header may differ.

- Looking for examples in the wild,
https://stackoverflow.com/a/3854872
has an example of "Content-Length" / "Transfer-Encoding" headers being
present in responses generated in 2010.

4. Maybe keep this as is for Tomcat 11, but change the words in
changelog. They should not say "payload" when referring to RFC 9110,


I'm really not sure about back-porting. This change was partly driven by 
the changes in the HTTP spec and partly by the Servlet spec making 
containers responsible for HEAD requests. There were lots of edge cases 
in that and this simplifies some of those.


I'll update the comments now.

Mark

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



[tomcat] branch main updated: Update terminology - thanks to review by kkolinko

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new e0b25a379e Update terminology - thanks to review by kkolinko
e0b25a379e is described below

commit e0b25a379e1653874521595f9dcb0d42e9591ab6
Author: Mark Thomas 
AuthorDate: Fri Jan 20 10:53:44 2023 +

Update terminology - thanks to review by kkolinko
---
 java/org/apache/coyote/http11/Http11Processor.java   | 2 ++
 java/org/apache/coyote/http2/StreamProcessor.java| 3 ++-
 test/jakarta/servlet/http/HttpServletDoHeadBaseTest.java | 9 ++---
 test/jakarta/servlet/http/TestHttpServlet.java   | 6 +++---
 webapps/docs/changelog.xml   | 5 +++--
 5 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 951d276593..ac23d73128 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -1057,6 +1057,8 @@ public class Http11Processor extends AbstractProcessor {
 headers.setValue("Server").setString(server);
 }
 
+// Exclude some HTTP header fields where the value is determined only
+// while generating the content as per section 9.3.2 of RFC 9110.
 if (head) {
 headers.removeHeader("content-length");
 headers.removeHeader("content-range");
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index acd9dce237..dba23bd09c 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -221,7 +221,8 @@ class StreamProcessor extends AbstractProcessor {
 
headers.addValue("date").setString(FastHttpDateFormat.getCurrentDate());
 }
 
-// Remove payload headers for HEAD requests
+// Exclude some HTTP header fields where the value is determined only
+// while generating the content as per section 9.3.2 of RFC 9110.
 if (coyoteRequest != null && 
"HEAD".equals(coyoteRequest.method().toString())) {
 headers.removeHeader("content-length");
 headers.removeHeader("content-range");
diff --git a/test/jakarta/servlet/http/HttpServletDoHeadBaseTest.java 
b/test/jakarta/servlet/http/HttpServletDoHeadBaseTest.java
index e513be2430..a8842431f3 100644
--- a/test/jakarta/servlet/http/HttpServletDoHeadBaseTest.java
+++ b/test/jakarta/servlet/http/HttpServletDoHeadBaseTest.java
@@ -97,8 +97,9 @@ public class HttpServletDoHeadBaseTest extends Http2TestBase {
 
 // Headers should be the same part from:
 // - Date header may be different
-// - HEAD requests don't include payload headers
-//   (RFC 7231, section 4.3.2)
+// Exclude some HTTP header fields where the value is determined only
+// while generating the content as per section 9.3.2 of RFC 9110.
+// (previously RFC 7231, section 4.3.2)
 getHeaders.remove("content-length");
 getHeaders.remove("content-range");
 getHeaders.remove("trailer");
@@ -168,7 +169,9 @@ public class HttpServletDoHeadBaseTest extends 
Http2TestBase {
 int i = 0;
 int j = 0;
 for (; i < getHeaders.length; i++) {
-// Ignore payload headers
+// Exclude some HTTP header fields where the value is 
determined
+// only while generating the content as per section 9.3.2 of 
RFC
+// 9110.
 if (getHeaders[i].contains("content-length") || 
getHeaders[i].contains("content-range") ) {
 // Skip
 } else {
diff --git a/test/jakarta/servlet/http/TestHttpServlet.java 
b/test/jakarta/servlet/http/TestHttpServlet.java
index 077467454e..03a78c46e3 100644
--- a/test/jakarta/servlet/http/TestHttpServlet.java
+++ b/test/jakarta/servlet/http/TestHttpServlet.java
@@ -47,7 +47,7 @@ public class TestHttpServlet extends TomcatBaseTest {
 
 /*
  * Nature of test has changed from original bug report since content-length
- * is no longer returned for HEAD requests as allowed by RFC 7231.
+ * is no longer returned for HEAD requests as allowed by RFC 9110.
  */
 @Test
 public void testBug53454() throws Exception {
@@ -181,7 +181,7 @@ public class TestHttpServlet extends TomcatBaseTest {
 
 int rc = getUrl(path, out, getHeaders);
 Assert.assertEquals(HttpServletResponse.SC_OK, rc);
-removePayloadHeaders(getHeaders);
+removeGeneratingContentHeaders(getHeaders);
 out.recycle();
 
 Map> headHeaders = new HashMap<>();
@@ -212,7 +212,7 @@ public class TestHttpServlet extends TomcatBaseTest {
  * Removes headers 

[tomcat] branch main updated (e0b25a379e -> 31ab0b3974)

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from e0b25a379e Update terminology - thanks to review by kkolinko
 new bed84c18da Fix logic
 new abf5114ab3 Add NO_RFC7540_PRIORITIES setting to enum
 new a68294971e Send setting to disable RFC 7540 settings by default
 new 89f7e83ac7 Ensure RFC 7540 priorities are not re-enabled
 new f35647a02f Don't process priority frames
 new fb22e14158 Remove RFC 7450 priorities tests
 new 14d3637bec Implement new allocation algorithm
 new f59c112ff0 Remove unused code
 new 6448ade045 Remove unnecessary i18n strings
 new 7b6eed79a0 Process received priority headers
 new 77d5efdc46 Add support for reading priority update frame
 new 31ab0b3974 Add a unit test for RFC 9218 priority handling

The 12 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:
 .../apache/coyote/http2/AbstractNonZeroStream.java |  94 -
 java/org/apache/coyote/http2/AbstractStream.java   |  47 ---
 .../coyote/http2/ConnectionSettingsBase.java   |  16 +
 java/org/apache/coyote/http2/Constants.java|   6 +-
 java/org/apache/coyote/http2/FrameType.java|  25 +-
 java/org/apache/coyote/http2/Http2AsyncParser.java |   3 +
 java/org/apache/coyote/http2/Http2Parser.java  |  80 ++--
 .../apache/coyote/http2/Http2UpgradeHandler.java   | 358 ++
 .../apache/coyote/http2/LocalStrings.properties|   9 +-
 .../apache/coyote/http2/LocalStrings_cs.properties |   1 -
 .../apache/coyote/http2/LocalStrings_es.properties |   3 -
 .../apache/coyote/http2/LocalStrings_fr.properties |   5 -
 .../apache/coyote/http2/LocalStrings_ja.properties |   5 -
 .../apache/coyote/http2/LocalStrings_ko.properties |   5 -
 .../coyote/http2/LocalStrings_zh_CN.properties |   5 -
 java/org/apache/coyote/http2/Setting.java  |   4 +
 java/org/apache/coyote/http2/Stream.java   |  36 +-
 .../apache/tomcat/util/http/parser/Priority.java   |   2 +-
 test/org/apache/coyote/http2/Http2TestBase.java|  47 ++-
 .../apache/coyote/http2/TestAbstractStream.java| 407 -
 .../apache/coyote/http2/TestHttp2Section_5_3.java  | 258 -
 test/org/apache/coyote/http2/TestRfc9218.java  | 165 +
 22 files changed, 458 insertions(+), 1123 deletions(-)
 delete mode 100644 test/org/apache/coyote/http2/TestAbstractStream.java
 delete mode 100644 test/org/apache/coyote/http2/TestHttp2Section_5_3.java
 create mode 100644 test/org/apache/coyote/http2/TestRfc9218.java


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



[tomcat] 02/12: Add NO_RFC7540_PRIORITIES setting to enum

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit abf5114ab3c230bdd3c033c50e56004b3e486164
Author: Mark Thomas 
AuthorDate: Tue Dec 6 18:00:48 2022 +

Add NO_RFC7540_PRIORITIES setting to enum
---
 java/org/apache/coyote/http2/Setting.java | 4 
 1 file changed, 4 insertions(+)

diff --git a/java/org/apache/coyote/http2/Setting.java 
b/java/org/apache/coyote/http2/Setting.java
index 54b99dacba..29dc73f201 100644
--- a/java/org/apache/coyote/http2/Setting.java
+++ b/java/org/apache/coyote/http2/Setting.java
@@ -23,6 +23,7 @@ enum Setting {
 INITIAL_WINDOW_SIZE(4),
 MAX_FRAME_SIZE(5),
 MAX_HEADER_LIST_SIZE(6),
+NO_RFC7540_PRIORITIES(9),
 UNKNOWN(Integer.MAX_VALUE);
 
 private final int id;
@@ -60,6 +61,9 @@ enum Setting {
 case 6: {
 return MAX_HEADER_LIST_SIZE;
 }
+case 9: {
+return NO_RFC7540_PRIORITIES;
+}
 default: {
 return Setting.UNKNOWN;
 }


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



[tomcat] 01/12: Fix logic

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit bed84c18dab26993dd43cd3e28ed7fc0f8f7b737
Author: Mark Thomas 
AuthorDate: Fri Jan 20 14:38:56 2023 +

Fix logic
---
 java/org/apache/tomcat/util/http/parser/Priority.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/http/parser/Priority.java 
b/java/org/apache/tomcat/util/http/parser/Priority.java
index 3142ba251c..0690bd0c41 100644
--- a/java/org/apache/tomcat/util/http/parser/Priority.java
+++ b/java/org/apache/tomcat/util/http/parser/Priority.java
@@ -73,7 +73,7 @@ public class Priority {
 if (urgencyListMember instanceof SfInteger) {
 long urgency = ((SfInteger) 
urgencyListMember).getVaue().longValue();
 // If out of range, ignore it
-if (urgency < 0 || urgency > 7) {
+if (urgency > -1 && urgency < 8) {
 result.setUrgency((int) urgency);
 }
 }


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



[tomcat] 03/12: Send setting to disable RFC 7540 settings by default

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit a68294971e894aa81e172cceb6fb35410d6984f4
Author: Mark Thomas 
AuthorDate: Tue Dec 6 18:05:38 2022 +

Send setting to disable RFC 7540 settings by default
---
 java/org/apache/coyote/http2/ConnectionSettingsBase.java | 16 
 java/org/apache/coyote/http2/LocalStrings.properties |  1 +
 2 files changed, 17 insertions(+)

diff --git a/java/org/apache/coyote/http2/ConnectionSettingsBase.java 
b/java/org/apache/coyote/http2/ConnectionSettingsBase.java
index ef4a20010a..bd880f669f 100644
--- a/java/org/apache/coyote/http2/ConnectionSettingsBase.java
+++ b/java/org/apache/coyote/http2/ConnectionSettingsBase.java
@@ -45,6 +45,9 @@ abstract class ConnectionSettingsBase {
 static final int DEFAULT_MAX_FRAME_SIZE = MIN_MAX_FRAME_SIZE;
 static final long DEFAULT_MAX_HEADER_LIST_SIZE = 1 << 15;
 
+// Defaults (defined by Tomcat)
+static final long DEFAULT_NO_RFC7540_PRIORITIES = 1;
+
 Map current = new ConcurrentHashMap<>();
 Map pending = new ConcurrentHashMap<>();
 
@@ -58,6 +61,7 @@ abstract class ConnectionSettingsBase {
 current.put(Setting.INITIAL_WINDOW_SIZE,
Long.valueOf(DEFAULT_INITIAL_WINDOW_SIZE));
 current.put(Setting.MAX_FRAME_SIZE, 
Long.valueOf(DEFAULT_MAX_FRAME_SIZE));
 current.put(Setting.MAX_HEADER_LIST_SIZE,   
Long.valueOf(DEFAULT_MAX_HEADER_LIST_SIZE));
+current.put(Setting.NO_RFC7540_PRIORITIES,  
Long.valueOf(DEFAULT_NO_RFC7540_PRIORITIES));
 }
 
 
@@ -86,6 +90,9 @@ abstract class ConnectionSettingsBase {
 case MAX_HEADER_LIST_SIZE:
 // No further validation required
 break;
+case NO_RFC7540_PRIORITIES:
+validateNoRfc7540Priorities(value);
+break;
 case UNKNOWN:
 // Unrecognised. Ignore it.
 return;
@@ -212,6 +219,15 @@ abstract class ConnectionSettingsBase 
{
 }
 
 
+private void validateNoRfc7540Priorities(long noRfc7540Priorities) throws 
T {
+if (noRfc7540Priorities < 0 || noRfc7540Priorities > 1) {
+String msg = 
sm.getString("connectionSettings.noRfc7540PrioritiesInvalid",
+connectionId, Long.toString(noRfc7540Priorities));
+throwException(msg, Http2Error.PROTOCOL_ERROR);
+}
+}
+
+
 abstract void throwException(String msg, Http2Error error) throws T;
 
 abstract String getEndpointName();
diff --git a/java/org/apache/coyote/http2/LocalStrings.properties 
b/java/org/apache/coyote/http2/LocalStrings.properties
index 8972c4fb6e..7587a86f33 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -26,6 +26,7 @@ connectionSettings.debug=Connection [{0}], Endpoint [{1}], 
Parameter type [{2}]
 connectionSettings.enablePushInvalid=Connection [{0}], The requested value for 
enable push [{1}] is not one of the permitted values (zero or one)
 connectionSettings.headerTableSizeLimit=Connection [{0}], Attempted to set a 
header table size of [{1}] but the limit is 16k
 connectionSettings.maxFrameSizeInvalid=Connection [{0}], The requested maximum 
frame size of [{1}] is outside the permitted range of [{2}] to [{3}]
+connectionSettings.noRfc7540PrioritiesInvalid=Connection [{0}], The requested 
no RFC 7540 priorities setting [{1}] was not zero or one
 connectionSettings.unknown=Connection [{0}], An unknown setting with 
identifier [{1}] and value [{2}] was ignored
 connectionSettings.windowSizeTooBig=Connection [{0}], The requested window 
size of [{1}] is bigger than the maximum permitted value of [{2}]
 


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



[tomcat] 10/12: Process received priority headers

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 7b6eed79a0aea84ffb20332a13bb2ed6ed190bba
Author: Mark Thomas 
AuthorDate: Fri Dec 9 15:00:39 2022 +

Process received priority headers
---
 java/org/apache/coyote/http2/Stream.java | 12 
 1 file changed, 12 insertions(+)

diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index f255029993..88017a7fb5 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -17,6 +17,7 @@
 package org.apache.coyote.http2;
 
 import java.io.IOException;
+import java.io.StringReader;
 import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
 import java.util.Collections;
@@ -42,6 +43,7 @@ import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.http.MimeHeaders;
 import org.apache.tomcat.util.http.parser.Host;
+import org.apache.tomcat.util.http.parser.Priority;
 import org.apache.tomcat.util.net.ApplicationBufferHandler;
 import org.apache.tomcat.util.net.WriteBuffer;
 import org.apache.tomcat.util.res.StringManager;
@@ -419,6 +421,16 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
 }
 break;
 }
+case "priority": {
+try {
+Priority p = Priority.parsePriority(new StringReader(value));
+setUrgency(p.getUrgency());
+setIncremental(p.getIncremental());
+} catch (IOException ioe) {
+// Not possible with StringReader
+}
+break;
+}
 default: {
 if (headerState == HEADER_STATE_TRAILER &&
 !handler.getProtocol().isTrailerHeaderAllowed(name)) {


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



[tomcat] 05/12: Don't process priority frames

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit f35647a02f2c6dced285dd839a907bd9377938da
Author: Mark Thomas 
AuthorDate: Tue Dec 6 19:16:41 2022 +

Don't process priority frames
---
 java/org/apache/coyote/http2/Http2Parser.java  | 39 +++---
 .../apache/coyote/http2/Http2UpgradeHandler.java   | 31 ++---
 .../apache/coyote/http2/LocalStrings.properties|  1 -
 .../apache/coyote/http2/LocalStrings_fr.properties |  1 -
 .../apache/coyote/http2/LocalStrings_ja.properties |  1 -
 .../apache/coyote/http2/LocalStrings_ko.properties |  1 -
 .../coyote/http2/LocalStrings_zh_CN.properties |  1 -
 test/org/apache/coyote/http2/Http2TestBase.java| 13 
 8 files changed, 20 insertions(+), 68 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2Parser.java 
b/java/org/apache/coyote/http2/Http2Parser.java
index 60669491d5..a68ce25dcb 100644
--- a/java/org/apache/coyote/http2/Http2Parser.java
+++ b/java/org/apache/coyote/http2/Http2Parser.java
@@ -254,12 +254,8 @@ class Http2Parser {
 Integer.toString(payloadSize)), 
Http2Error.PROTOCOL_ERROR);
 }
 }
-if (priority) {
-boolean exclusive = ByteUtil.isBit7Set(optional[optionalPos]);
-int parentStreamId = ByteUtil.get31Bits(optional, optionalPos);
-int weight = ByteUtil.getOneByte(optional, optionalPos + 4) + 
1;
-output.reprioritise(streamId, parentStreamId, exclusive, 
weight);
-}
+
+// Ignore RFC 7450 priority data if present
 
 payloadSize -= optionalLen;
 payloadSize -= padLength;
@@ -277,24 +273,15 @@ class Http2Parser {
 }
 
 
-protected void readPriorityFrame(int streamId, ByteBuffer buffer) throws 
Http2Exception, IOException {
-byte[] payload = new byte[5];
-if (buffer == null) {
-input.fill(true, payload);
-} else {
-buffer.get(payload);
-}
-
-boolean exclusive = ByteUtil.isBit7Set(payload[0]);
-int parentStreamId = ByteUtil.get31Bits(payload, 0);
-int weight = ByteUtil.getOneByte(payload, 4) + 1;
-
-if (streamId == parentStreamId) {
-throw new 
StreamException(sm.getString("http2Parser.processFramePriority.invalidParent",
-connectionId, Integer.valueOf(streamId)), 
Http2Error.PROTOCOL_ERROR, streamId);
+protected void readPriorityFrame(int streamId, ByteBuffer buffer) throws 
IOException {
+// RFC 7450 priority frames are ignored. Still need to treat as 
overhead.
+try {
+swallowPayload(streamId, FrameType.PRIORITY.getId(), 5, false, 
buffer);
+} catch (ConnectionException e) {
+// Will never happen because swallowPayload() is called with 
isPadding set
+// to false
 }
-
-output.reprioritise(streamId, parentStreamId, exclusive, weight);
+output.increaseOverheadCount(FrameType.PRIORITY);
 }
 
 
@@ -780,10 +767,6 @@ class Http2Parser {
 void headersContinue(int payloadSize, boolean endOfHeaders);
 void headersEnd(int streamId) throws Http2Exception;
 
-// Priority frames (also headers)
-void reprioritise(int streamId, int parentStreamId, boolean exclusive, 
int weight)
-throws Http2Exception;
-
 // Reset frames
 void reset(int streamId, long errorCode) throws Http2Exception;
 
@@ -815,5 +798,7 @@ class Http2Parser {
  * frame
  */
 void onSwallowedUnknownFrame(int streamId, int frameTypeId, int flags, 
int size) throws IOException;
+
+void increaseOverheadCount(FrameType frameType);
 }
 }
diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index c89fe44c1f..a2405994a8 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -1489,7 +1489,8 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 }
 
 
-private void increaseOverheadCount(FrameType frameType) {
+@Override
+public void increaseOverheadCount(FrameType frameType) {
 // An overhead frame increases the overhead count by
 // overheadCountFactor. By default, this means an overhead frame
 // increases the overhead count by 10. A simple browser request is
@@ -1708,34 +1709,6 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 }
 
 
-@Override
-public void reprioritise(int streamId, int parentStreamId,
-boolean exclusive, int weight) throws Http2Exception {
-if (streamId == parentStreamId) {
-throw new 
ConnectionException(sm.get

[tomcat] 08/12: Remove unused code

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit f59c112ff0dc0b69f234b5f45c858550d87bd1ac
Author: Mark Thomas 
AuthorDate: Thu Dec 8 19:49:10 2022 +

Remove unused code
---
 .../apache/coyote/http2/AbstractNonZeroStream.java | 43 --
 1 file changed, 43 deletions(-)

diff --git a/java/org/apache/coyote/http2/AbstractNonZeroStream.java 
b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
index 5a9c3e3a48..f6a00e20e0 100644
--- a/java/org/apache/coyote/http2/AbstractNonZeroStream.java
+++ b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
@@ -18,19 +18,12 @@ package org.apache.coyote.http2;
 
 import java.nio.ByteBuffer;
 
-import org.apache.juli.logging.Log;
-import org.apache.juli.logging.LogFactory;
-import org.apache.tomcat.util.res.StringManager;
-
 /**
  * Base class for all streams other than stream 0, the connection. Primarily
  * provides functionality shared between full Stream and RecycledStream.
  */
 abstract class AbstractNonZeroStream extends AbstractStream {
 
-private static final Log log = 
LogFactory.getLog(AbstractNonZeroStream.class);
-private static final StringManager sm = 
StringManager.getManager(AbstractNonZeroStream.class);
-
 protected static final ByteBuffer ZERO_LENGTH_BYTEBUFFER = 
ByteBuffer.allocate(0);
 
 protected final StreamStateMachine state;
@@ -48,42 +41,6 @@ abstract class AbstractNonZeroStream extends AbstractStream {
 }
 
 
-/*
- * General method used when reprioritising a stream and care needs to be
- * taken not to create circular references.
- *
- * Changes to the priority tree need to be synchronized at the connection
- * level. This is the caller's responsibility.
- */
-final void rePrioritise(AbstractStream parent, boolean exclusive, int 
weight) {
-if (log.isDebugEnabled()) {
-log.debug(sm.getString("stream.reprioritisation.debug",
-getConnectionId(), getIdAsString(), 
Boolean.toString(exclusive),
-parent.getIdAsString(), Integer.toString(weight)));
-}
-
-// TODO
-}
-
-
-/*
- * Used when removing closed streams from the tree and we know there is no
- * need to check for circular references.
- *
- * Changes to the priority tree need to be synchronized at the connection
- * level. This is the caller's responsibility.
- */
-final void rePrioritise(AbstractStream parent, int weight) {
-if (log.isDebugEnabled()) {
-log.debug(sm.getString("stream.reprioritisation.debug",
-getConnectionId(), getIdAsString(), Boolean.FALSE,
-parent.getIdAsString(), Integer.toString(weight)));
-}
-
-// TODO
-}
-
-
 final boolean isClosedFinal() {
 return state.isClosedFinal();
 }


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



[tomcat] 04/12: Ensure RFC 7540 priorities are not re-enabled

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 89f7e83ac7664fad5eaeb5bd6df11ba3e368acab
Author: Mark Thomas 
AuthorDate: Tue Dec 6 18:14:00 2022 +

Ensure RFC 7540 priorities are not re-enabled
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 5 +
 java/org/apache/coyote/http2/LocalStrings.properties  | 1 +
 2 files changed, 6 insertions(+)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 8d402c64b9..c89fe44c1f 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -1835,6 +1835,11 @@ class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpUpgradeH
 h2e.getError(), stream.getIdAsInt()));
}
 }
+} else if (setting == Setting.NO_RFC7540_PRIORITIES) {
+// This should not be changed after the initial setting
+if (value != ConnectionSettingsBase.DEFAULT_NO_RFC7540_PRIORITIES) 
{
+throw new 
ConnectionException(sm.getString("upgradeHandler.enableRfc7450Priorities", 
connectionId), Http2Error.PROTOCOL_ERROR);
+}
 } else {
 remoteSettings.set(setting, value);
 }
diff --git a/java/org/apache/coyote/http2/LocalStrings.properties 
b/java/org/apache/coyote/http2/LocalStrings.properties
index 7587a86f33..7f7bf3a8c6 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -148,6 +148,7 @@ upgradeHandler.pruned=Connection [{0}] Pruned completed 
stream [{1}]
 upgradeHandler.prunedPriority=Connection [{0}] Pruned unused stream [{1}] that 
may have been part of the priority tree
 upgradeHandler.releaseBacklog=Connection [{0}], Stream [{1}] released from 
backlog
 upgradeHandler.reset.receive=Connection [{0}], Stream [{1}], Reset received 
due to [{2}]
+upgradeHandler.enableRfc7450Priorities=Connection [{0}], RFC 7450 priorities 
may not be enabled after being disabled in the initial connection settings 
frame (see RFC 9218)
 upgradeHandler.rst.debug=Connection [{0}], Stream [{1}], Error [{2}], Message 
[{3}],  RST (closing stream)
 upgradeHandler.sendPrefaceFail=Connection [{0}], Failed to send preface to 
client
 upgradeHandler.sendfile.reservation=Connection [{0}], Stream [{1}], Connection 
reservation [{2}], Stream reservation [{3}] prior to sendfile write


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



[tomcat] 11/12: Add support for reading priority update frame

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 77d5efdc462052205a05c9382494c4383dd5f938
Author: Mark Thomas 
AuthorDate: Fri Dec 9 15:49:32 2022 +

Add support for reading priority update frame
---
 java/org/apache/coyote/http2/FrameType.java| 25 +++--
 java/org/apache/coyote/http2/Http2AsyncParser.java |  3 ++
 java/org/apache/coyote/http2/Http2Parser.java  | 41 ++
 .../apache/coyote/http2/Http2UpgradeHandler.java   | 12 +++
 .../apache/coyote/http2/LocalStrings.properties|  2 ++
 test/org/apache/coyote/http2/Http2TestBase.java|  7 
 6 files changed, 79 insertions(+), 11 deletions(-)

diff --git a/java/org/apache/coyote/http2/FrameType.java 
b/java/org/apache/coyote/http2/FrameType.java
index 8734944595..acd60eaa2c 100644
--- a/java/org/apache/coyote/http2/FrameType.java
+++ b/java/org/apache/coyote/http2/FrameType.java
@@ -22,17 +22,18 @@ import org.apache.tomcat.util.res.StringManager;
 
 enum FrameType {
 
-DATA  (0,   false,  true, null,  false),
-HEADERS   (1,   false,  true, null,   true),
-PRIORITY  (2,   false,  true, (x) -> x == 5, false),
-RST   (3,   false,  true, (x) -> x == 4, false),
-SETTINGS  (4,true, false, (x) -> x % 6 == 0,  true),
-PUSH_PROMISE  (5,   false,  true, (x) -> x >= 4,  true),
-PING  (6,true, false, (x) -> x == 8, false),
-GOAWAY(7,true, false, (x) -> x >= 8, false),
-WINDOW_UPDATE (8,true,  true, (x) -> x == 4,  true),
-CONTINUATION  (9,   false,  true, null,   true),
-UNKNOWN   (256,  true,  true, null,  false);
+DATA(  0, false,  true, null,  false),
+HEADERS (  1, false,  true, null,   true),
+PRIORITY(  2, false,  true, (x) -> x == 5, false),
+RST (  3, false,  true, (x) -> x == 4, false),
+SETTINGS(  4,  true, false, (x) -> x % 6 == 0,  true),
+PUSH_PROMISE(  5, false,  true, (x) -> x >= 4,  true),
+PING(  6,  true, false, (x) -> x == 8, false),
+GOAWAY  (  7,  true, false, (x) -> x >= 8, false),
+WINDOW_UPDATE   (  8,  true,  true, (x) -> x == 4,  true),
+CONTINUATION(  9, false,  true, null,   true),
+PRIORITY_UPDATE ( 16,  true, false, (x) -> x >= 4,  true),
+UNKNOWN (256,  true,  true, null,  false);
 
 private static final StringManager sm = 
StringManager.getManager(FrameType.class);
 
@@ -107,6 +108,8 @@ enum FrameType {
 return WINDOW_UPDATE;
 case 9:
 return CONTINUATION;
+case 16:
+return PRIORITY_UPDATE;
 default:
 return UNKNOWN;
 }
diff --git a/java/org/apache/coyote/http2/Http2AsyncParser.java 
b/java/org/apache/coyote/http2/Http2AsyncParser.java
index a2043557b7..e05eeea4a2 100644
--- a/java/org/apache/coyote/http2/Http2AsyncParser.java
+++ b/java/org/apache/coyote/http2/Http2AsyncParser.java
@@ -276,6 +276,9 @@ class Http2AsyncParser extends Http2Parser {
 case CONTINUATION:
 readContinuationFrame(streamId, flags, 
payloadSize, payload);
 break;
+case PRIORITY_UPDATE:
+readPriorityUpdateFrame(payloadSize, payload);
+break;
 case UNKNOWN:
 readUnknownFrame(streamId, frameTypeId, flags, 
payloadSize, payload);
 }
diff --git a/java/org/apache/coyote/http2/Http2Parser.java 
b/java/org/apache/coyote/http2/Http2Parser.java
index a68ce25dcb..bf3689d9c0 100644
--- a/java/org/apache/coyote/http2/Http2Parser.java
+++ b/java/org/apache/coyote/http2/Http2Parser.java
@@ -16,7 +16,11 @@
  */
 package org.apache.coyote.http2;
 
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
 import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
 import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
 
@@ -27,6 +31,7 @@ import org.apache.coyote.http2.HpackDecoder.HeaderEmitter;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.buf.ByteBufferUtils;
+import org.apache.tomcat.util.http.parser.Priority;
 import org.apache.tomcat.util.res.StringManager;
 
 class Http2Parser {
@@ -121,6 +126,9 @@ class Http2Parser {
 case CONTINUATION:
 readContinuationFrame(streamId, flags, payloadSize, null);
 break;
+case PRIORITY_UPDATE:
+readPriorityUpdateFrame(payloadSize, null);
+break;
  

[tomcat] 12/12: Add a unit test for RFC 9218 priority handling

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 31ab0b3974e6f0eaa429b16b049b60cc30db5579
Author: Mark Thomas 
AuthorDate: Fri Jan 20 17:06:12 2023 +

Add a unit test for RFC 9218 priority handling
---
 test/org/apache/coyote/http2/Http2TestBase.java |  27 
 test/org/apache/coyote/http2/TestRfc9218.java   | 165 
 2 files changed, 192 insertions(+)

diff --git a/test/org/apache/coyote/http2/Http2TestBase.java 
b/test/org/apache/coyote/http2/Http2TestBase.java
index b068520a80..4dc566fb9a 100644
--- a/test/org/apache/coyote/http2/Http2TestBase.java
+++ b/test/org/apache/coyote/http2/Http2TestBase.java
@@ -947,6 +947,33 @@ public abstract class Http2TestBase extends TomcatBaseTest 
{
 }
 
 
+void sendPriorityUpdate(int streamId, int urgency, boolean incremental) 
throws IOException {
+// Need to know the payload length first
+StringBuilder sb = new StringBuilder("u=");
+sb.append(urgency);
+if (incremental) {
+sb.append(", i");
+}
+byte[] payload = sb.toString().getBytes(StandardCharsets.US_ASCII);
+
+byte[] priorityUpdateFrame = new byte[13 + payload.length];
+
+// length
+ByteUtil.setThreeBytes(priorityUpdateFrame, 0, 4 + payload.length);
+// type
+priorityUpdateFrame[3] = FrameType.PRIORITY_UPDATE.getIdByte();
+// Stream ID
+ByteUtil.set31Bits(priorityUpdateFrame, 5, 0);
+
+// Payload
+ByteUtil.set31Bits(priorityUpdateFrame, 9, streamId);
+System.arraycopy(payload, 0, priorityUpdateFrame, 13, payload.length);
+
+os.write(priorityUpdateFrame);
+os.flush();
+}
+
+
 void sendSettings(int streamId, boolean ack, SettingValue... settings) 
throws IOException {
 // length
 int settingsCount;
diff --git a/test/org/apache/coyote/http2/TestRfc9218.java 
b/test/org/apache/coyote/http2/TestRfc9218.java
new file mode 100644
index 00..85dd834eee
--- /dev/null
+++ b/test/org/apache/coyote/http2/TestRfc9218.java
@@ -0,0 +1,165 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.coyote.http2;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestRfc9218 extends Http2TestBase {
+
+@Test
+public void testPriority() throws Exception {
+http2Connect();
+
+/*
+ * This test uses small window updates and data frames that will 
trigger the excessive overhead protection so
+ * disable it.
+ */
+http2Protocol.setOverheadWindowUpdateThreshold(0);
+http2Protocol.setOverheadDataThreshold(0);
+
+// Default connection window size is 64k - 1. Initial request will 
have used 8k (56k -1). Increase it to 57k.
+sendWindowUpdate(0, 1 + 1024);
+
+// Consume 56k of the connection window
+for (int i = 3; i < 17; i += 2) {
+sendSimpleGetRequest(i);
+readSimpleGetResponse();
+}
+
+// At this point the connection window should be 1k
+
+// Process a request on stream 17. This should consume the connection 
window.
+sendSimpleGetRequest(17);
+// 17-headers, 17-1k-body
+parser.readFrame();
+parser.readFrame();
+output.clearTrace();
+
+// Send additional requests. Connection window is empty so only 
headers will be returned.
+sendSimpleGetRequest(19);
+sendSimpleGetRequest(21);
+
+// 19-headers, 21-headers
+parser.readFrame();
+parser.readFrame();
+output.clearTrace();
+
+// At this point 17, 19 and 21 are all blocked because the connection 
window is zero.
+// 17 - 7k body left
+// 19 - 8k body left
+// 21 - 8k body left
+
+// Add 1k to the connection window. Should be used for stream 17.
+sendWindowUpdate(0, 1024);
+parser.readFrame();
+Assert.assertEquals("17-Body-1024\n", output.getTrace());
+output.clearTrace();
+
+// 17 - 6k body left
+// 19 - 8k body left
+// 21 

[tomcat] 09/12: Remove unnecessary i18n strings

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 6448ade0450e1687adeb245587cde03ace15231b
Author: Mark Thomas 
AuthorDate: Thu Dec 8 19:59:27 2022 +

Remove unnecessary i18n strings
---
 java/org/apache/coyote/http2/LocalStrings.properties   | 2 --
 java/org/apache/coyote/http2/LocalStrings_es.properties| 1 -
 java/org/apache/coyote/http2/LocalStrings_fr.properties| 2 --
 java/org/apache/coyote/http2/LocalStrings_ja.properties| 2 --
 java/org/apache/coyote/http2/LocalStrings_ko.properties| 2 --
 java/org/apache/coyote/http2/LocalStrings_zh_CN.properties | 2 --
 6 files changed, 11 deletions(-)

diff --git a/java/org/apache/coyote/http2/LocalStrings.properties 
b/java/org/apache/coyote/http2/LocalStrings.properties
index 3670d60f42..7dfa1676f6 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -73,7 +73,6 @@ http2Parser.processFrameData.window=Connection [{0}], Client 
sent more data than
 http2Parser.processFrameHeaders.decodingDataLeft=Data left over after HPACK 
decoding - it should have been consumed
 http2Parser.processFrameHeaders.decodingFailed=There was an error during the 
HPACK decoding of HTTP headers
 http2Parser.processFrameHeaders.payload=Connection [{0}], Stream [{1}], 
Processing headers payload of size [{2}]
-http2Parser.processFramePriority.invalidParent=Connection [{0}], Stream [{1}], 
A stream may not depend on itself
 http2Parser.processFramePushPromise=Connection [{0}], Stream [{1}], Push 
promise frames should not be sent by the client
 http2Parser.processFrameSettings.ackWithNonZeroPayload=Settings frame received 
with the ACK flag set and payload present
 http2Parser.processFrameWindowUpdate.debug=Connection [{0}], Stream [{1}], 
Window size increment [{2}]
@@ -109,7 +108,6 @@ stream.inputBuffer.swallowUnread=Swallowing [{0}] bytes 
previously read into inp
 stream.notWritable=Connection [{0}], Stream [{1}], This stream is not writable
 stream.outputBuffer.flush.debug=Connection [{0}], Stream [{1}], flushing 
output with buffer at position [{2}], writeInProgress [{3}] and closed [{4}]
 stream.recycle=Connection [{0}], Stream [{1}] has been recycled
-stream.reprioritisation.debug=Connection [{0}], Stream [{1}], Exclusive [{2}], 
Parent [{3}], Weight [{4}]
 stream.reset.fail=Connection [{0}], Stream [{1}], Failed to reset stream
 stream.reset.receive=Connection [{0}], Stream [{1}], Reset received due to 
[{2}]
 stream.reset.send=Connection [{0}], Stream [{1}], Reset sent due to [{2}]
diff --git a/java/org/apache/coyote/http2/LocalStrings_es.properties 
b/java/org/apache/coyote/http2/LocalStrings_es.properties
index 2664cc5f8c..513511c9ed 100644
--- a/java/org/apache/coyote/http2/LocalStrings_es.properties
+++ b/java/org/apache/coyote/http2/LocalStrings_es.properties
@@ -37,7 +37,6 @@ stream.header.noPath=Conexión [{0}], Flujo [{1}], El [:path] 
de la seudo cabece
 stream.header.unknownPseudoHeader=Conexión [{0}], Flujo [{1}], Se recibió una 
Pseudo cabecera desconocida [{2}]
 stream.inputBuffer.reset=Reinicio de flujo
 stream.inputBuffer.signal=Se adicionaron datos al inBuffer cuando el hilo esta 
esperando. Señalizando al hilo que a continuar
-stream.reprioritisation.debug=Conexión [{0}], Flujo [{1}], Exclusivo [{2}], 
Padre [{3}], Peso [{4}]
 
 streamProcessor.error.connection=Conexión [{0}], Flujo [{1}], Ha ocurrido un 
error el procesamiento que fue fatal para la conexión
 
diff --git a/java/org/apache/coyote/http2/LocalStrings_fr.properties 
b/java/org/apache/coyote/http2/LocalStrings_fr.properties
index 9044d4f47f..6cd75243f5 100644
--- a/java/org/apache/coyote/http2/LocalStrings_fr.properties
+++ b/java/org/apache/coyote/http2/LocalStrings_fr.properties
@@ -72,7 +72,6 @@ http2Parser.processFrameData.window=Connection [{0}], le 
client a envoyé plus d
 http2Parser.processFrameHeaders.decodingDataLeft=Des données restent après le 
décodage de HPACK, elles auraient dû être consommées
 http2Parser.processFrameHeaders.decodingFailed=Une erreur de décodage HPACK 
des en-têtes HTTP s'est produite
 http2Parser.processFrameHeaders.payload=Connection [{0}], Flux [{1}], 
Traitement des en-têtes avec une taille de données de [{2}]
-http2Parser.processFramePriority.invalidParent=Connection [{0}], Flux [{1}], 
Un flux ne peut pas dépendre de lui-même
 http2Parser.processFramePushPromise=Connexion [{0}], Flux (Stream) [{1}], les 
trames de promesse d''envoi ("Push promise frames") ne doivent pas être 
envoyées par le client.
 http2Parser.processFrameSettings.ackWithNonZeroPayload=La trame de paramètres 
a été reçue avec un indicateur ACK activé et des données présentes
 http2Parser.processFrameWindowUpdate.debug=Connection [{0}], Flux [{1}], 
Incrémentation de [{2}] de la taille de fenêtre
@@ -108,7 +107,6 @@ stream.inputBuffer.swallowUnread=[{0}] bytes qui ont été 

[tomcat] 07/12: Implement new allocation algorithm

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 14d3637bec7708d6a359165db889b6362d03925a
Author: Mark Thomas 
AuthorDate: Wed Dec 7 11:14:46 2022 +

Implement new allocation algorithm

Currently using defaults as priorities aren't read yet.
---
 .../apache/coyote/http2/AbstractNonZeroStream.java |  55 +---
 java/org/apache/coyote/http2/AbstractStream.java   |  47 
 java/org/apache/coyote/http2/Constants.java|   6 +-
 .../apache/coyote/http2/Http2UpgradeHandler.java   | 310 +++--
 .../apache/coyote/http2/LocalStrings.properties|   2 -
 .../apache/coyote/http2/LocalStrings_cs.properties |   1 -
 .../apache/coyote/http2/LocalStrings_es.properties |   2 -
 .../apache/coyote/http2/LocalStrings_fr.properties |   2 -
 .../apache/coyote/http2/LocalStrings_ja.properties |   2 -
 .../apache/coyote/http2/LocalStrings_ko.properties |   2 -
 .../coyote/http2/LocalStrings_zh_CN.properties |   2 -
 java/org/apache/coyote/http2/Stream.java   |  24 +-
 12 files changed, 129 insertions(+), 326 deletions(-)

diff --git a/java/org/apache/coyote/http2/AbstractNonZeroStream.java 
b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
index 0876fc88c6..5a9c3e3a48 100644
--- a/java/org/apache/coyote/http2/AbstractNonZeroStream.java
+++ b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
@@ -17,7 +17,6 @@
 package org.apache.coyote.http2;
 
 import java.nio.ByteBuffer;
-import java.util.Iterator;
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -36,8 +35,6 @@ abstract class AbstractNonZeroStream extends AbstractStream {
 
 protected final StreamStateMachine state;
 
-private volatile int weight = Constants.DEFAULT_WEIGHT;
-
 
 AbstractNonZeroStream(String connectionId, Integer identifier) {
 super(identifier);
@@ -51,12 +48,6 @@ abstract class AbstractNonZeroStream extends AbstractStream {
 }
 
 
-@Override
-final int getWeight() {
-return weight;
-}
-
-
 /*
  * General method used when reprioritising a stream and care needs to be
  * taken not to create circular references.
@@ -71,27 +62,7 @@ abstract class AbstractNonZeroStream extends AbstractStream {
 parent.getIdAsString(), Integer.toString(weight)));
 }
 
-// Check if new parent is a descendant of this stream
-if (isDescendant(parent)) {
-parent.detachFromParent();
-// Cast is always safe since any descendant of this stream must be
-// an instance of AbstractNonZeroStream
-getParentStream().addChild((AbstractNonZeroStream) parent);
-}
-
-if (exclusive) {
-// Need to move children of the new parent to be children of this
-// stream. Slightly convoluted to avoid concurrent modification.
-Iterator parentsChildren = 
parent.getChildStreams().iterator();
-while (parentsChildren.hasNext()) {
-AbstractNonZeroStream parentsChild = parentsChildren.next();
-parentsChildren.remove();
-this.addChild(parentsChild);
-}
-}
-detachFromParent();
-parent.addChild(this);
-this.weight = weight;
+// TODO
 }
 
 
@@ -109,29 +80,7 @@ abstract class AbstractNonZeroStream extends AbstractStream 
{
 parent.getIdAsString(), Integer.toString(weight)));
 }
 
-parent.addChild(this);
-this.weight = weight;
-}
-
-
-/*
- * Used when "recycling" a stream and replacing a Stream instance with a
- * RecycledStream instance.
- *
- * Replace this stream with the provided stream in the parent/child
- * hierarchy.
- *
- * Changes to the priority tree need to be synchronized at the connection
- * level. This is the caller's responsibility.
- */
-void replaceStream(AbstractNonZeroStream replacement) {
-getParentStream().addChild(replacement);
-detachFromParent();
-for (AbstractNonZeroStream child : getChildStreams()) {
-replacement.addChild(child);
-}
-getChildStreams().clear();
-replacement.weight = weight;
+// TODO
 }
 
 
diff --git a/java/org/apache/coyote/http2/AbstractStream.java 
b/java/org/apache/coyote/http2/AbstractStream.java
index dc651d30e9..d3533c5bd8 100644
--- a/java/org/apache/coyote/http2/AbstractStream.java
+++ b/java/org/apache/coyote/http2/AbstractStream.java
@@ -16,9 +16,6 @@
  */
 package org.apache.coyote.http2;
 
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.res.StringManager;
@@ -35,8 +32,6 @@ abstract class AbstractStream {
 private final Integer identi

[tomcat] 06/12: Remove RFC 7450 priorities tests

2023-01-20 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit fb22e14158226b6074c2af636725f38f0b0ae44d
Author: Mark Thomas 
AuthorDate: Tue Dec 6 19:45:04 2022 +

Remove RFC 7450 priorities tests
---
 .../apache/coyote/http2/TestAbstractStream.java| 407 -
 .../apache/coyote/http2/TestHttp2Section_5_3.java  | 258 -
 2 files changed, 665 deletions(-)

diff --git a/test/org/apache/coyote/http2/TestAbstractStream.java 
b/test/org/apache/coyote/http2/TestAbstractStream.java
deleted file mode 100644
index 79dca9ab23..00
--- a/test/org/apache/coyote/http2/TestAbstractStream.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.apache.coyote.http2;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.channels.CompletionHandler;
-import java.util.concurrent.Semaphore;
-import java.util.concurrent.TimeUnit;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import org.apache.tomcat.util.net.ApplicationBufferHandler;
-import org.apache.tomcat.util.net.NioChannel;
-import org.apache.tomcat.util.net.NioEndpoint;
-import org.apache.tomcat.util.net.SSLSupport;
-import org.apache.tomcat.util.net.SendfileDataBase;
-import org.apache.tomcat.util.net.SendfileState;
-import org.apache.tomcat.util.net.SocketWrapperBase;
-
-/*
- * This tests use A=1, B=2, etc to map stream IDs to the names used in the
- * figures.
- */
-public class TestAbstractStream {
-
-@Test
-public void testDependenciesFig3() {
-// Setup
-Http2UpgradeHandler handler =
-new Http2UpgradeHandler(new Http2Protocol(), null, null, new 
TesterSocketWrapper());
-Stream a = new Stream(Integer.valueOf(1), handler);
-Stream b = new Stream(Integer.valueOf(2), handler);
-Stream c = new Stream(Integer.valueOf(3), handler);
-Stream d = new Stream(Integer.valueOf(4), handler);
-b.rePrioritise(a, false, 16);
-c.rePrioritise(a, false, 16);
-
-// Action
-d.rePrioritise(a, false, 16);
-
-// Check parents
-Assert.assertEquals(handler, a.getParentStream());
-Assert.assertEquals(a, b.getParentStream());
-Assert.assertEquals(a, c.getParentStream());
-Assert.assertEquals(a, d.getParentStream());
-
-// Check children
-Assert.assertEquals(3,  a.getChildStreams().size());
-Assert.assertTrue(a.getChildStreams().contains(b));
-Assert.assertTrue(a.getChildStreams().contains(c));
-Assert.assertTrue(a.getChildStreams().contains(d));
-Assert.assertEquals(0,  b.getChildStreams().size());
-Assert.assertEquals(0,  c.getChildStreams().size());
-Assert.assertEquals(0,  d.getChildStreams().size());
-}
-
-
-@Test
-public void testDependenciesFig4() {
-// Setup
-Http2UpgradeHandler handler =
-new Http2UpgradeHandler(new Http2Protocol(), null, null, new 
TesterSocketWrapper());
-Stream a = new Stream(Integer.valueOf(1), handler);
-Stream b = new Stream(Integer.valueOf(2), handler);
-Stream c = new Stream(Integer.valueOf(3), handler);
-Stream d = new Stream(Integer.valueOf(4), handler);
-b.rePrioritise(a, false, 16);
-c.rePrioritise(a, false, 16);
-
-// Action
-d.rePrioritise(a, true, 16);
-
-// Check parents
-Assert.assertEquals(handler, a.getParentStream());
-Assert.assertEquals(d, b.getParentStream());
-Assert.assertEquals(d, c.getParentStream());
-Assert.assertEquals(a, d.getParentStream());
-
-// Check children
-Assert.assertEquals(1,  a.getChildStreams().size());
-Assert.assertTrue(a.getChildStreams().contains(d));
-Assert.assertEquals(2,  d.getChildStreams().size());
-Assert.assertTrue(d.getChildStreams().contains(b));
-Assert.assertTrue(d.getChildStreams().contains(c));
-Assert.assertEquals(0,  b.getChildStreams().size());
-Assert.assertEquals(0,  c.getChildStreams().size());
-   

RFC 9218 priorities - back-port?

2023-01-20 Thread Mark Thomas

Hi all,

You will have seen I've just committed the updated priorities 
implementation for HTTP/2. The open question is whether or not we want 
to back-port this and if so, how far.


Thoughts?

Mark

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