Native Compilation, Continuation 2022

2022-04-11 Thread Filip Hanik
Hi folks,

I'm jumping in on the bandwagon again. Specifically to talk some more about
native compilation. The graal compiler is making headway, and it's becoming
better and better at native compilation [1].

I'll put some historical context at the bottom of this post for clarity. I
have a few suggestions that I'd like some input on

1. Get rid of tomcat-embed-programmatic
2. Refactor existing graal JSON instructions [2]
3. Potentially introduce tomcat-embed-graal
4. Add in build feature flags to the code or code optimizations

Today
The amount of input we can provide to the graal compiler today, lets us
work around many of the issues that were the reason for the
tomcat-embed-programmatic.

For example, graal can apply build time code substitution, like mentioned
here [4]. We can also provide multiple JSON files [2], and effectively
create profiles. So there can be an NIO profile, an NIO2 profile and an APR
profile, if that's desired.

Back to Proposal
1. Remove tomcat-embed-programmatic
I believe this served its purpose.

2. Refactor existing graal JSON files
This can allow us to create profiles with various memory footprints
depending on functionality desired.

3. Potentially introduce tomcat-embed-graal
This can have various code substitutions that we find beneficial. [4]

4. Add in build feature flags to the code or code optimizations
graal can still do static analysis to optimize inclusion of code paths. as
demonstrated in this example [5]. As this seems to pollute our codebase
with graal specific stuff when it could have been done as a substitution,
I'm still presenting it to gather more opinions.

Filip

Historical Context
When we created tomcat-embed-programmatic, we did so to reduce the memory
footprint[3] of the simplest tomcat installation. At the time, the graal
compiler was indiscriminate and would absorb virtually any class file in a
library. So we created an experimental jar, tomcat-embed-programmatic, that
was reduced to be embedded,  no resource files, no XML support, and removed
the reflection property setters for configurable components.

References
[1]
https://github.com/spring-projects-experimental/spring-native/issues/1426
[2]
https://github.com/apache/tomcat/tree/main/res/graal/tomcat-embed-core/native-image
[3]
https://github.com/spring-projects-experimental/spring-native/issues/1426#issuecomment-1019546681
[4]
https://github.com/spring-projects-experimental/spring-native/issues/1426#issue-1095362633
[5]
https://github.com/spring-projects-experimental/spring-native/issues/1426#issuecomment-1072581363


[Bug 65991] NPE in SSLAuthenticator.java:201 if bindOnInit="false"

2022-04-11 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65991

--- Comment #6 from Amit Pande  ---
Hello Remy,

Running into the same issue even without using bindOnInit as mentioned in
comment #4.

This is the connector configuration in use.







---

I see this in logs -

Caused by: org.apache.catalina.LifecycleException: Failed to start
component
[SSLAuthenticator[StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]]
at
org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at
org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:176)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5147)
... 10 more
Caused by: java.lang.NullPointerException
at
org.apache.catalina.authenticator.SSLAuthenticator.startInternal(SSLAuthenticator.java:201)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 13 more

Also, any inputs on why this is seen only on Linux and not on Windows.

-- 
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 66005] New: Apache crashes, if there is a tomcat server, which can not be resolved

2022-04-11 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66005

Bug ID: 66005
   Summary: Apache crashes, if there is a tomcat server, which can
not be resolved
   Product: Tomcat Connectors
   Version: 1.2.48
  Hardware: Other
OS: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: mod_jk
  Assignee: dev@tomcat.apache.org
  Reporter: lothar.web...@gmail.com
  Target Milestone: ---

Dear Tomcat development team,
I am not sure, if this is the correct way, for reporting this bug.

We have the Issue, that apache crashes immediatly after startup,
if I add a single worker, which could not be resolved:

Tried with apache 2.4.52/2.4.53 and mod_jk 1.2.48

[debug] build_worker_map::jk_worker.c (249): creating worker myworker
[debug] wc_create_worker::jk_worker.c (153): about to create instance
myworker of ajp13
[debug] ajp_worker_factory::jk_ajp_common.c (3218): ajp worker
'myworker' type=2 created
[debug] wc_create_worker::jk_worker.c (166): about to validate and init
myworker
[debug] ajp_validate::jk_ajp_common.c (2862): worker myworker target
is 'host1.internal.example.org:8009'
[error] ajp_validate::jk_ajp_common.c (2868): worker myworker can't
resolve tomcat address host1.internal.example.org
[debug] ajp_validate::jk_ajp_common.c (2873): worker myworker contact
is disabled
[debug] jk_ajp_push::jk_ajp_common.c (1190): syncing shm for ajp
worker 'myworker' from mem (0->0) [0->0]
[debug] ajp_init::jk_ajp_common.c (3076): (alex) setting endpoint options:
[debug] ajp_init::jk_ajp_common.c (3080): keepalive:  0
[debug] ajp_init::jk_ajp_common.c (3084): socket timeout: 0
[debug] ajp_init::jk_ajp_common.c (3088): socket connect timeout: 0
[debug] ajp_init::jk_ajp_common.c (3092): buffer size:0
[debug] ajp_init::jk_ajp_common.c (3096): pool timeout:   0
[debug] ajp_init::jk_ajp_common.c (3100): ping timeout:   1
[debug] ajp_init::jk_ajp_common.c (3104): connect timeout:0
[debug] ajp_init::jk_ajp_common.c (3108): reply timeout:  0
[debug] ajp_init::jk_ajp_common.c (3112): prepost timeout:0
[debug] ajp_init::jk_ajp_common.c (3116): recovery options:   0
[debug] ajp_init::jk_ajp_common.c (3120): retries:2
[debug] ajp_init::jk_ajp_common.c (3124): max packet size:8192
[debug] ajp_init::jk_ajp_common.c (3128): retry interval: 100
[debug] ajp_init::jk_ajp_common.c (3132): busy limit: 0
[debug] ajp_create_endpoint_cache::jk_ajp_common.c (2932): (myworker)
setting connection pool size to 1 with min 1 and acquire timeout 200

There is a known bug: https://bz.apache.org/bugzilla/show_bug.cgi?id=59164
This was fixed with 1.2.42
I tried to reopen it, but I was forwarded to
"Tomcat users mailing list"

Could you help me please. May be there is a workarround.

Thanks a lot and kind Regards, Lothar

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



[GitHub] [tomcat] CrazyHZM closed pull request #502: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


CrazyHZM closed pull request #502: Support max http request header size and max 
http header size configuration separation
URL: https://github.com/apache/tomcat/pull/502


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



[GitHub] [tomcat] CrazyHZM closed pull request #503: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


CrazyHZM closed pull request #503: Support max http request header size and max 
http header size configuration separation
URL: https://github.com/apache/tomcat/pull/503


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



[GitHub] [tomcat] CrazyHZM opened a new pull request, #503: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


CrazyHZM opened a new pull request, #503:
URL: https://github.com/apache/tomcat/pull/503

   Mail link:https://bz.apache.org/bugzilla/show_bug.cgi?id=65866


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



[GitHub] [tomcat] CrazyHZM commented on pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


CrazyHZM commented on PR #501:
URL: https://github.com/apache/tomcat/pull/501#issuecomment-1094939842

   @rmaucher 
   Do i need to resubmit a clean pr?


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



[Bug 65866] Allow AbstractHttp11Protocol.setMaxHttpHeaderSize to apply to request or response only

2022-04-11 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65866

Remy Maucherat  changed:

   What|Removed |Added

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

--- Comment #4 from Remy Maucherat  ---
The enhancement will be in Tomcat 10.1.0-M15, 10.0.21, 9.0.63 and 8.5.79.
Thanks.

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



[GitHub] [tomcat] rmaucher commented on pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


rmaucher commented on PR #501:
URL: https://github.com/apache/tomcat/pull/501#issuecomment-1094929661

   Merged with changed. I didn't understand the changes to TestHttp2Limits, 
HTTP/2 should use the new request header size and that should be it. Also 
updated docs and changelog.


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



[GitHub] [tomcat] rmaucher closed pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


rmaucher closed pull request #501: Support max http request header size and max 
http header size configuration separation
URL: https://github.com/apache/tomcat/pull/501


-- 
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] branch 8.5.x updated: PR501: Add header size attributes

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

remm 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 5567e2e30e PR501: Add header size attributes
5567e2e30e is described below

commit 5567e2e30e8a2ec40a084274edcabb045a18246f
Author: remm 
AuthorDate: Mon Apr 11 13:14:17 2022 +0200

PR501: Add header size attributes

Add new maxHttpRequestHeaderSize and maxHttpResponseHeaderSize
attributes which allow setting the maximum HTTP header sizes
independently. If not specified, the value of the maxHttpHeaderSize
connector attribute will be used.
Added documentation.
Submitted by Zhongming Hua.
---
 .../coyote/http11/AbstractHttp11Protocol.java  | 28 ++
 java/org/apache/coyote/http11/Http11Processor.java |  4 ++--
 webapps/docs/changelog.xml | 11 +
 webapps/docs/config/http.xml   | 12 ++
 4 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java 
b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
index 8c5b3f49d0..4d706ba53d 100644
--- a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
+++ b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
@@ -273,6 +273,34 @@ public abstract class AbstractHttp11Protocol extends 
AbstractProtocol {
 public void setMaxHttpHeaderSize(int valueI) { maxHttpHeaderSize = valueI; 
}
 
 
+/**
+ * Maximum size of the HTTP request message header.
+ */
+private int maxHttpRequestHeaderSize = -1;
+
+public int getMaxHttpRequestHeaderSize() {
+return maxHttpRequestHeaderSize == -1 ? getMaxHttpHeaderSize() : 
maxHttpRequestHeaderSize;
+}
+
+public void setMaxHttpRequestHeaderSize(int valueI) {
+maxHttpRequestHeaderSize = valueI;
+}
+
+
+/**
+ * Maximum size of the HTTP response message header.
+ */
+private int maxHttpResponseHeaderSize = -1;
+
+public int getMaxHttpResponseHeaderSize() {
+return maxHttpResponseHeaderSize == -1 ? getMaxHttpHeaderSize() : 
maxHttpResponseHeaderSize;
+}
+
+public void setMaxHttpResponseHeaderSize(int valueI) {
+maxHttpResponseHeaderSize = valueI;
+}
+
+
 private int connectionUploadTimeout = 30;
 /**
  * Specifies a different (usually longer) connection timeout during data
diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index eafd286b88..cd4148f4f8 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -190,11 +190,11 @@ public class Http11Processor extends AbstractProcessor {
 httpParser = new HttpParser(protocol.getRelaxedPathChars(),
 protocol.getRelaxedQueryChars());
 
-inputBuffer = new Http11InputBuffer(request, 
protocol.getMaxHttpHeaderSize(),
+inputBuffer = new Http11InputBuffer(request, 
protocol.getMaxHttpRequestHeaderSize(),
 protocol.getRejectIllegalHeader(), httpParser);
 request.setInputBuffer(inputBuffer);
 
-outputBuffer = new Http11OutputBuffer(response, 
protocol.getMaxHttpHeaderSize(),
+outputBuffer = new Http11OutputBuffer(response, 
protocol.getMaxHttpResponseHeaderSize(),
 protocol.getSendReasonPhrase());
 response.setOutputBuffer(outputBuffer);
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 9498e8286f..e407303283 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -114,6 +114,17 @@
   
 
   
+  
+
+  
+501: Add new maxHttpRequestHeaderSize and
+maxHttpResponseHeaderSize attributes which allow setting
+the maximum HTTP header sizes independently. If not specified, the
+value of the maxHttpHeaderSize connector attribute will
+be used. Submitted by Zhongming Hua. (remm)
+  
+
+  
 
 
   
diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index d85bc3aecc..fd393a777c 100644
--- a/webapps/docs/config/http.xml
+++ b/webapps/docs/config/http.xml
@@ -522,6 +522,18 @@
   in bytes. If not specified, this attribute is set to 8192 (8 KB).
 
 
+
+  The maximum size of the request HTTP header, specified
+  in bytes. If not specified, this attribute is set to the value of
+  the maxHttpHeaderSize attribute.
+
+
+
+  The maximum size of the response HTTP header, specified
+  in bytes. If not specified, this attribute is set to the value of
+  the maxHttpHeaderSize attribute.
+
+
 
   The maximum number of HTTP requests which can be pipelined until
   the connection is closed by the server. Setting this attribute to 1 will



[tomcat] branch 9.0.x updated: PR501: Add header size attributes

2022-04-11 Thread remm
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 431f08b66e PR501: Add header size attributes
431f08b66e is described below

commit 431f08b66e27411decb52e1333dd886cc181a854
Author: remm 
AuthorDate: Mon Apr 11 13:14:17 2022 +0200

PR501: Add header size attributes

Add new maxHttpRequestHeaderSize and maxHttpResponseHeaderSize
attributes which allow setting the maximum HTTP header sizes
independently. If not specified, the value of the maxHttpHeaderSize
connector attribute will be used.
Added documentation.
Submitted by Zhongming Hua.
---
 .../coyote/http11/AbstractHttp11Protocol.java  | 28 ++
 java/org/apache/coyote/http11/Http11Processor.java |  4 ++--
 webapps/docs/changelog.xml | 11 +
 webapps/docs/config/http.xml   | 12 ++
 4 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java 
b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
index 4c64197162..5f7d144536 100644
--- a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
+++ b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
@@ -271,6 +271,34 @@ public abstract class AbstractHttp11Protocol extends 
AbstractProtocol {
 public void setMaxHttpHeaderSize(int valueI) { maxHttpHeaderSize = valueI; 
}
 
 
+/**
+ * Maximum size of the HTTP request message header.
+ */
+private int maxHttpRequestHeaderSize = -1;
+
+public int getMaxHttpRequestHeaderSize() {
+return maxHttpRequestHeaderSize == -1 ? getMaxHttpHeaderSize() : 
maxHttpRequestHeaderSize;
+}
+
+public void setMaxHttpRequestHeaderSize(int valueI) {
+maxHttpRequestHeaderSize = valueI;
+}
+
+
+/**
+ * Maximum size of the HTTP response message header.
+ */
+private int maxHttpResponseHeaderSize = -1;
+
+public int getMaxHttpResponseHeaderSize() {
+return maxHttpResponseHeaderSize == -1 ? getMaxHttpHeaderSize() : 
maxHttpResponseHeaderSize;
+}
+
+public void setMaxHttpResponseHeaderSize(int valueI) {
+maxHttpResponseHeaderSize = valueI;
+}
+
+
 private int connectionUploadTimeout = 30;
 /**
  * Specifies a different (usually longer) connection timeout during data
diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index eb9199df80..a401025a83 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -158,11 +158,11 @@ public class Http11Processor extends AbstractProcessor {
 httpParser = new HttpParser(protocol.getRelaxedPathChars(),
 protocol.getRelaxedQueryChars());
 
-inputBuffer = new Http11InputBuffer(request, 
protocol.getMaxHttpHeaderSize(),
+inputBuffer = new Http11InputBuffer(request, 
protocol.getMaxHttpRequestHeaderSize(),
 protocol.getRejectIllegalHeader(), httpParser);
 request.setInputBuffer(inputBuffer);
 
-outputBuffer = new Http11OutputBuffer(response, 
protocol.getMaxHttpHeaderSize());
+outputBuffer = new Http11OutputBuffer(response, 
protocol.getMaxHttpResponseHeaderSize());
 response.setOutputBuffer(outputBuffer);
 
 // Create and add the identity filters.
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 92d3ce20e2..76db0f1f13 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -114,6 +114,17 @@
   
 
   
+  
+
+  
+501: Add new maxHttpRequestHeaderSize and
+maxHttpResponseHeaderSize attributes which allow setting
+the maximum HTTP header sizes independently. If not specified, the
+value of the maxHttpHeaderSize connector attribute will
+be used. Submitted by Zhongming Hua. (remm)
+  
+
+  
 
 
   
diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index c79a5dc3ba..e01a8666e3 100644
--- a/webapps/docs/config/http.xml
+++ b/webapps/docs/config/http.xml
@@ -518,6 +518,18 @@
   in bytes. If not specified, this attribute is set to 8192 (8 KB).
 
 
+
+  The maximum size of the request HTTP header, specified
+  in bytes. If not specified, this attribute is set to the value of
+  the maxHttpHeaderSize attribute.
+
+
+
+  The maximum size of the response HTTP header, specified
+  in bytes. If not specified, this attribute is set to the value of
+  the maxHttpHeaderSize attribute.
+
+
 
   The maximum number of HTTP requests which can be pipelined until
   the connection is closed by the server. Setting this attribute to 1 will



[tomcat] branch 10.0.x updated: PR501: Add header size attributes

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

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new de48ef4877 PR501: Add header size attributes
de48ef4877 is described below

commit de48ef4877f760dd34ad18e72892e83292b36877
Author: remm 
AuthorDate: Mon Apr 11 13:14:17 2022 +0200

PR501: Add header size attributes

Add new maxHttpRequestHeaderSize and maxHttpResponseHeaderSize
attributes which allow setting the maximum HTTP header sizes
independently. If not specified, the value of the maxHttpHeaderSize
connector attribute will be used.
Added documentation.
HTTP/2 should use maxHttpRequestHeaderSize and inherit it, while
maxHttpResponseHeaderSize will do nothing.
Submitted by Zhongming Hua.
---
 .../coyote/http11/AbstractHttp11Protocol.java  | 28 ++
 java/org/apache/coyote/http11/Http11Processor.java |  4 ++--
 java/org/apache/coyote/http2/Http2Protocol.java|  2 +-
 webapps/docs/changelog.xml | 11 +
 webapps/docs/config/http.xml   | 12 ++
 webapps/docs/config/http2.xml  |  1 +
 6 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java 
b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
index abcec73eef..4f2776b0d4 100644
--- a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
+++ b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
@@ -244,6 +244,34 @@ public abstract class AbstractHttp11Protocol extends 
AbstractProtocol {
 public void setMaxHttpHeaderSize(int valueI) { maxHttpHeaderSize = valueI; 
}
 
 
+/**
+ * Maximum size of the HTTP request message header.
+ */
+private int maxHttpRequestHeaderSize = -1;
+
+public int getMaxHttpRequestHeaderSize() {
+return maxHttpRequestHeaderSize == -1 ? getMaxHttpHeaderSize() : 
maxHttpRequestHeaderSize;
+}
+
+public void setMaxHttpRequestHeaderSize(int valueI) {
+maxHttpRequestHeaderSize = valueI;
+}
+
+
+/**
+ * Maximum size of the HTTP response message header.
+ */
+private int maxHttpResponseHeaderSize = -1;
+
+public int getMaxHttpResponseHeaderSize() {
+return maxHttpResponseHeaderSize == -1 ? getMaxHttpHeaderSize() : 
maxHttpResponseHeaderSize;
+}
+
+public void setMaxHttpResponseHeaderSize(int valueI) {
+maxHttpResponseHeaderSize = valueI;
+}
+
+
 private int connectionUploadTimeout = 30;
 /**
  * Specifies a different (usually longer) connection timeout during data
diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 0fa74b9b5b..4ed8fb47d4 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -158,11 +158,11 @@ public class Http11Processor extends AbstractProcessor {
 httpParser = new HttpParser(protocol.getRelaxedPathChars(),
 protocol.getRelaxedQueryChars());
 
-inputBuffer = new Http11InputBuffer(request, 
protocol.getMaxHttpHeaderSize(),
+inputBuffer = new Http11InputBuffer(request, 
protocol.getMaxHttpRequestHeaderSize(),
 protocol.getRejectIllegalHeader(), httpParser);
 request.setInputBuffer(inputBuffer);
 
-outputBuffer = new Http11OutputBuffer(response, 
protocol.getMaxHttpHeaderSize());
+outputBuffer = new Http11OutputBuffer(response, 
protocol.getMaxHttpResponseHeaderSize());
 response.setOutputBuffer(outputBuffer);
 
 // Create and add the identity filters.
diff --git a/java/org/apache/coyote/http2/Http2Protocol.java 
b/java/org/apache/coyote/http2/Http2Protocol.java
index e96a945f0d..46b49d926c 100644
--- a/java/org/apache/coyote/http2/Http2Protocol.java
+++ b/java/org/apache/coyote/http2/Http2Protocol.java
@@ -263,7 +263,7 @@ public class Http2Protocol implements UpgradeProtocol {
 
 
 public int getMaxHeaderSize() {
-return http11Protocol.getMaxHttpHeaderSize();
+return http11Protocol.getMaxHttpRequestHeaderSize();
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index db4bc415d3..1b4037334d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -114,6 +114,17 @@
   
 
   
+  
+
+  
+501: Add new maxHttpRequestHeaderSize and
+maxHttpResponseHeaderSize attributes which allow setting
+the maximum HTTP header sizes independently. If not specified, the
+value of the maxHttpHeaderSize connector attribute will
+be used. Submitted by Zhongming Hua. (remm)
+  
+
+  
 
 
   
diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index 2245b65a34..1eb51c9987 100644
--- 

[tomcat] branch main updated: PR501: Add header size attributes

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

remm 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 6cdd999e65 PR501: Add header size attributes
6cdd999e65 is described below

commit 6cdd999e652ad122781164172c1d7f9b175a6446
Author: remm 
AuthorDate: Mon Apr 11 13:14:17 2022 +0200

PR501: Add header size attributes

Add new maxHttpRequestHeaderSize and maxHttpResponseHeaderSize
attributes which allow setting the maximum HTTP header sizes
independently. If not specified, the value of the maxHttpHeaderSize
connector attribute will be used.
Added documentation.
HTTP/2 should use maxHttpRequestHeaderSize and inherit it, while
maxHttpResponseHeaderSize will do nothing.
Submitted by Zhongming Hua.
---
 .../coyote/http11/AbstractHttp11Protocol.java  | 28 ++
 java/org/apache/coyote/http11/Http11Processor.java |  4 ++--
 java/org/apache/coyote/http2/Http2Protocol.java|  2 +-
 webapps/docs/changelog.xml | 11 +
 webapps/docs/config/http.xml   | 12 ++
 webapps/docs/config/http2.xml  |  1 +
 6 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java 
b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
index 10512660c4..1a88c314a0 100644
--- a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
+++ b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
@@ -244,6 +244,34 @@ public abstract class AbstractHttp11Protocol extends 
AbstractProtocol {
 public void setMaxHttpHeaderSize(int valueI) { maxHttpHeaderSize = valueI; 
}
 
 
+/**
+ * Maximum size of the HTTP request message header.
+ */
+private int maxHttpRequestHeaderSize = -1;
+
+public int getMaxHttpRequestHeaderSize() {
+return maxHttpRequestHeaderSize == -1 ? getMaxHttpHeaderSize() : 
maxHttpRequestHeaderSize;
+}
+
+public void setMaxHttpRequestHeaderSize(int valueI) {
+maxHttpRequestHeaderSize = valueI;
+}
+
+
+/**
+ * Maximum size of the HTTP response message header.
+ */
+private int maxHttpResponseHeaderSize = -1;
+
+public int getMaxHttpResponseHeaderSize() {
+return maxHttpResponseHeaderSize == -1 ? getMaxHttpHeaderSize() : 
maxHttpResponseHeaderSize;
+}
+
+public void setMaxHttpResponseHeaderSize(int valueI) {
+maxHttpResponseHeaderSize = valueI;
+}
+
+
 private int connectionUploadTimeout = 30;
 /**
  * Specifies a different (usually longer) connection timeout during data
diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 4f8261362e..c4be0ede8d 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -159,11 +159,11 @@ public class Http11Processor extends AbstractProcessor {
 httpParser = new HttpParser(protocol.getRelaxedPathChars(),
 protocol.getRelaxedQueryChars());
 
-inputBuffer = new Http11InputBuffer(request, 
protocol.getMaxHttpHeaderSize(),
+inputBuffer = new Http11InputBuffer(request, 
protocol.getMaxHttpRequestHeaderSize(),
 protocol.getRejectIllegalHeader(), httpParser);
 request.setInputBuffer(inputBuffer);
 
-outputBuffer = new Http11OutputBuffer(response, 
protocol.getMaxHttpHeaderSize());
+outputBuffer = new Http11OutputBuffer(response, 
protocol.getMaxHttpResponseHeaderSize());
 response.setOutputBuffer(outputBuffer);
 
 // Create and add the identity filters.
diff --git a/java/org/apache/coyote/http2/Http2Protocol.java 
b/java/org/apache/coyote/http2/Http2Protocol.java
index 7bdc6cb648..9df4e9f06c 100644
--- a/java/org/apache/coyote/http2/Http2Protocol.java
+++ b/java/org/apache/coyote/http2/Http2Protocol.java
@@ -262,7 +262,7 @@ public class Http2Protocol implements UpgradeProtocol {
 
 
 public int getMaxHeaderSize() {
-return http11Protocol.getMaxHttpHeaderSize();
+return http11Protocol.getMaxHttpRequestHeaderSize();
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 0540db1f1c..dab30fb302 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -114,6 +114,17 @@
   
 
   
+  
+
+  
+501: Add new maxHttpRequestHeaderSize and
+maxHttpResponseHeaderSize attributes which allow setting
+the maximum HTTP header sizes independently. If not specified, the
+value of the maxHttpHeaderSize connector attribute will
+be used. Submitted by Zhongming Hua. (remm)
+  
+
+  
 
 
   
diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index 6ddf476be2..ea10297737 100644
--- 

[GitHub] [tomcat] CrazyHZM commented on pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


CrazyHZM commented on PR #501:
URL: https://github.com/apache/tomcat/pull/501#issuecomment-1094916955

   @rmaucher 
   I can patch several other branches, right?


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



[Bug 59164] If tomcat server can not be resolved, crash occurred.

2022-04-11 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=59164

Rainer Jung  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Rainer Jung  ---
Please do not reopen this ticket. You have not given any evidence, that a crash
is happening. Please ask on the Tomcat users mailing list for advice first. If
discussion there shows, that there might be a mod_jk bug, then you can crate a
ticket here.
Thanks,
Rainer

-- 
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 59164] If tomcat server can not be resolved, crash occurred.

2022-04-11 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=59164

Lothar  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
Version|1.2.41  |1.2.48
 Resolution|FIXED   |---

--- Comment #2 from Lothar  ---
I have the same Issue with apache 2.4.52/2.4.53 and mod_jk 1.2.48

[debug] build_worker_map::jk_worker.c (249): creating worker myworker
[debug] wc_create_worker::jk_worker.c (153): about to create instance myworker
of ajp13
[debug] ajp_worker_factory::jk_ajp_common.c (3218): ajp worker 'myworker'
type=2 created
[debug] wc_create_worker::jk_worker.c (166): about to validate and init
myworker
[debug] ajp_validate::jk_ajp_common.c (2862): worker myworker target is
'host1.internal.example.org:8009'
[error] ajp_validate::jk_ajp_common.c (2868): worker myworker can't resolve
tomcat address host1.internal.example.org
[debug] ajp_validate::jk_ajp_common.c (2873): worker myworker contact is
disabled
[debug] jk_ajp_push::jk_ajp_common.c (1190): syncing shm for ajp worker
'myworker' from mem (0->0) [0->0]
[debug] ajp_init::jk_ajp_common.c (3076): (alex) setting endpoint options:
[debug] ajp_init::jk_ajp_common.c (3080): keepalive:  0
[debug] ajp_init::jk_ajp_common.c (3084): socket timeout: 0
[debug] ajp_init::jk_ajp_common.c (3088): socket connect timeout: 0
[debug] ajp_init::jk_ajp_common.c (3092): buffer size:0
[debug] ajp_init::jk_ajp_common.c (3096): pool timeout:   0
[debug] ajp_init::jk_ajp_common.c (3100): ping timeout:   1
[debug] ajp_init::jk_ajp_common.c (3104): connect timeout:0
[debug] ajp_init::jk_ajp_common.c (3108): reply timeout:  0
[debug] ajp_init::jk_ajp_common.c (3112): prepost timeout:0
[debug] ajp_init::jk_ajp_common.c (3116): recovery options:   0
[debug] ajp_init::jk_ajp_common.c (3120): retries:2
[debug] ajp_init::jk_ajp_common.c (3124): max packet size:8192
[debug] ajp_init::jk_ajp_common.c (3128): retry interval: 100
[debug] ajp_init::jk_ajp_common.c (3132): busy limit: 0
[debug] ajp_create_endpoint_cache::jk_ajp_common.c (2932): (myworker) setting
connection pool size to 1 with min 1 and acquire timeout 200

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



[GitHub] [tomcat] rmaucher commented on pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


rmaucher commented on PR #501:
URL: https://github.com/apache/tomcat/pull/501#issuecomment-1094815675

   The proposed patch is still simpler and should work well, so I will merge 
that one.


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



[GitHub] [tomcat] gmshake commented on pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


gmshake commented on PR #501:
URL: https://github.com/apache/tomcat/pull/501#issuecomment-1094800382

   > Overall, I prefer the PR as it is right now, it's simpler. If the new 
setters are used, then the behavior could be slightly different, but since this 
is new API this should be fine.
   
   It is not complicated. I forked and edit online to demonstrate the part of 
change: 
https://github.com/gmshake/tomcat/commit/75289cf9e7a3920cc6d3ea0463db53a6ab0d090c?diff=split


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



[GitHub] [tomcat] rmaucher commented on pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


rmaucher commented on PR #501:
URL: https://github.com/apache/tomcat/pull/501#issuecomment-1094743565

   Overall, I prefer the PR as it is right now, it's simpler. If the new 
setters are used, then the behavior could be slightly different, but since this 
is new API this should be fine.


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



Re: [Bug 57611] Update Bugzilla URL in documentation, site, etc.

2022-04-11 Thread Mark Thomas

On 11/04/2022 09:10, bugzi...@apache.org wrote:

https://bz.apache.org/bugzilla/show_bug.cgi?id=57611

--- Comment #2 from Jason Adams  ---


I've disabled this idiot's account and removed the spam.

Mark

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



[GitHub] [tomcat] rmannibucau commented on a diff in pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


rmannibucau commented on code in PR #501:
URL: https://github.com/apache/tomcat/pull/501#discussion_r847064940


##
java/org/apache/coyote/http11/AbstractHttp11Protocol.java:
##
@@ -244,6 +244,34 @@ public void setMaxSavePostSize(int maxSavePostSize) {
 public void setMaxHttpHeaderSize(int valueI) { maxHttpHeaderSize = valueI; 
}
 
 
+/**
+ * Maximum size of the HTTP request message header.
+ */
+private int maxHttpRequestHeaderSize = -1;

Review Comment:
   Setter should stay IMHO and set both values to the exact same one *if not 
already set*.
   Getter should get the max value since the consumer wants the max size and it 
is exactly the semantic of this method (= what is the max for request and 
response, only change is that before it was a single value, now it is really a 
max but a min is wrong IMHO).
   
   So IMHO it makes perfect sense as method for frameworks and integrators to 
still have this, in particular when it is linked to pooling where max is more 
intended than min or any value under the max.
   
   > I still insist that semantic level compatibility is more important than 
API level compatibility
   
   Well there are two points:
   
   1. API compat: IMHO it is not an option to break before next 10.2 or 
something like that
   2. semantic level is preserved and it makes sense to have this shortcut IMHO 
so we can solve both at once



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



[Bug 57611] Update Bugzilla URL in documentation, site, etc.

2022-04-11 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=57611

--- Comment #2 from Jason Adams  ---
(In reply to Konstantin Kolinko from comment #0)
> About a week ago the ASF Bugzilla was migrated to a new, separate host. As a
> result, the issue URLs have changed from
> 
>  https://issues.apache.org/bugzilla/
> to
>  https://bz.apache.org/bugzilla/
> 
> The host name is still usable and all issue links are successfully
> redirected to the new host.
> 
> 
> I have not seen any blog post explaining the change yet, but I guess that it
> is official.
> 
> 
> If this change is permanent then we need to update Bugzilla links:
> 
> (1) in tomcat-docs XSLT style that processes number elements
> - in documentation
> - on the main tomcat.a.o site
> 
> (2) explicit references
> - in documentation,
> - ROOT web application, 
> - on the main tomcat.a.o site
> 
> (3) SVN properties on project roots,
> Currently we have the following ones configured:
> 
> bugtraq:logregex
> (https?\://issues.apache.org/bugzilla/show_bug.cgi\?id=\d+|BZ\s?\d+) (\d+)
> 
> bugtraq:message
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=%BUGID%
> 
> bugtraq:url
> https://celltrackingapps.com/best-antivirus-for-android/
Thanks for sharing. I used some part of this code to build best android app
antivirus.

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



[GitHub] [tomcat] gmshake commented on a diff in pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


gmshake commented on code in PR #501:
URL: https://github.com/apache/tomcat/pull/501#discussion_r847041315


##
java/org/apache/coyote/http11/AbstractHttp11Protocol.java:
##
@@ -244,6 +244,34 @@ public void setMaxSavePostSize(int maxSavePostSize) {
 public void setMaxHttpHeaderSize(int valueI) { maxHttpHeaderSize = valueI; 
}
 
 
+/**
+ * Maximum size of the HTTP request message header.
+ */
+private int maxHttpRequestHeaderSize = -1;

Review Comment:
   Keep `getMaxHttpHeaderSize()` only preserves API level compatibility, the 
semantic of `getMaxHttpHeaderSize()` has change once we introduce dedicated 
header settings for request and response.
   
   To illustrate the semantic change:
   ```java
   setMaxHttpHeaderSize(4096);
   setMaxHttpRequestHeaderSize(8192);
   setMaxHttpResponseHeaderSize(16384);
   ```
   Then `getMaxHttpHeaderSize()` make no sense except the only meaning "default 
maxHttpHeaderSize"
   
   Maybe it is more reasonable to deprecate `getMaxHttpHeaderSize()` and return 
a size that is not too bad:
   ```java
   @Deprecated
   public int getMaxHttpHeaderSize() {
   return Math.min(maxHttpRequestHeaderSize, maxHttpResponseHeaderSize)
   }
   ```
   
   I still insist that semantic level compatibility is more important than API 
level compatibility. For `setMaxHttpHeaderSize()` it originally means set 
maximum size of the HTTP message header for both request and response.



-- 
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] branch 9.0.x updated: Minor typo on javadoc of setHostHeader method

2022-04-11 Thread remm
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 fa4aaf0b18 Minor typo on javadoc of setHostHeader method
fa4aaf0b18 is described below

commit fa4aaf0b181866f4e0e5d2efe32061d2a1efbac8
Author: Eduardo Leggiero 
AuthorDate: Thu Apr 7 22:40:20 2022 +0100

Minor typo on javadoc of setHostHeader method
---
 java/org/apache/catalina/filters/RemoteIpFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/filters/RemoteIpFilter.java 
b/java/org/apache/catalina/filters/RemoteIpFilter.java
index d73b3b03b7..2bc1bc8b07 100644
--- a/java/org/apache/catalina/filters/RemoteIpFilter.java
+++ b/java/org/apache/catalina/filters/RemoteIpFilter.java
@@ -1186,7 +1186,7 @@ public class RemoteIpFilter extends GenericFilter {
 /**
  * 
  * Header that holds the incoming host, usually named
- * X-Forwarded-HOst.
+ * X-Forwarded-Host.
  * 
  * 
  * Default value : null


-
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: Minor typo on javadoc of setHostHeader method

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

remm 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 4c7f21cd0c Minor typo on javadoc of setHostHeader method
4c7f21cd0c is described below

commit 4c7f21cd0c1a61ab763619bb83b2a7632bb43900
Author: Eduardo Leggiero 
AuthorDate: Thu Apr 7 22:40:20 2022 +0100

Minor typo on javadoc of setHostHeader method
---
 java/org/apache/catalina/filters/RemoteIpFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/filters/RemoteIpFilter.java 
b/java/org/apache/catalina/filters/RemoteIpFilter.java
index 13a4011e3b..b9916578c7 100644
--- a/java/org/apache/catalina/filters/RemoteIpFilter.java
+++ b/java/org/apache/catalina/filters/RemoteIpFilter.java
@@ -1188,7 +1188,7 @@ public class RemoteIpFilter implements Filter {
 /**
  * 
  * Header that holds the incoming host, usually named
- * X-Forwarded-HOst.
+ * X-Forwarded-Host.
  * 
  * 
  * Default value : null


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



[tomcat] branch 10.0.x updated (3df462befe -> 89cdabc442)

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

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


from 3df462befe PR#494: Fix native library location
 add 89cdabc442 Minor typo on javadoc of setHostHeader method

No new revisions were added by this update.

Summary of changes:
 java/org/apache/catalina/filters/RemoteIpFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


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



[GitHub] [tomcat] gmshake commented on a diff in pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


gmshake commented on code in PR #501:
URL: https://github.com/apache/tomcat/pull/501#discussion_r847041315


##
java/org/apache/coyote/http11/AbstractHttp11Protocol.java:
##
@@ -244,6 +244,34 @@ public void setMaxSavePostSize(int maxSavePostSize) {
 public void setMaxHttpHeaderSize(int valueI) { maxHttpHeaderSize = valueI; 
}
 
 
+/**
+ * Maximum size of the HTTP request message header.
+ */
+private int maxHttpRequestHeaderSize = -1;

Review Comment:
   Keep `getMaxHttpHeaderSize()` only preserves API level compatibility, the 
semantic of `getMaxHttpHeaderSize()` has change once we introduce dedicated 
header settings for request and response.
   
   To illustrate the semantic change:
   ```java
   setMaxHttpHeaderSize(4096);
   setMaxHttpRequestHeaderSize(8192);
   setMaxHttpResponseHeaderSize(16384);
   ```
   Then `getMaxHttpHeaderSize()` make no sense except the only meaning "default 
maxHttpHeaderSize"
   
   Maybe it is more reasonable to deprecate `getMaxHttpHeaderSize()` and return 
a size that is not too bad:
   ```java
   public int getMaxHttpHeaderSize() {
   return Math.min(maxHttpRequestHeaderSize, maxHttpResponseHeaderSize)
   }
   ```
   
   I still insist that semantic level compatibility is more important than API 
level compatibility. For `setMaxHttpHeaderSize()` it originally means set 
maximum size of the HTTP message header for both request and response.



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



[GitHub] [tomcat] gmshake commented on a diff in pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


gmshake commented on code in PR #501:
URL: https://github.com/apache/tomcat/pull/501#discussion_r847041315


##
java/org/apache/coyote/http11/AbstractHttp11Protocol.java:
##
@@ -244,6 +244,34 @@ public void setMaxSavePostSize(int maxSavePostSize) {
 public void setMaxHttpHeaderSize(int valueI) { maxHttpHeaderSize = valueI; 
}
 
 
+/**
+ * Maximum size of the HTTP request message header.
+ */
+private int maxHttpRequestHeaderSize = -1;

Review Comment:
   Keep `getMaxHttpHeaderSize()` only preserves API level compatibility, the 
semantic of `getMaxHttpHeaderSize()` has change once we introduce dedicated 
header settings for request and response.
   
   To illustrate the semantic change:
   ```java
   setMaxHttpHeaderSize(4096);
   setMaxHttpRequestHeaderSize(8192);
   setMaxHttpResponseHeaderSize(16384);
   ```
   Then `getMaxHttpHeaderSize()` make no sense except the only meaning "default 
maxHttpHeaderSize"
   
   Maybe it is  deprecate `getMaxHttpHeaderSize()` and return a size that is 
not too bad:
   ```java
   public int getMaxHttpHeaderSize() {
   return Math.min(maxHttpRequestHeaderSize, maxHttpResponseHeaderSize)
   }
   ```
   
   I still insist that semantic level compatibility is more important than API 
level compatibility. For `setMaxHttpHeaderSize()` it originally means set 
maximum size of the HTTP message header for both request and response.



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



[GitHub] [tomcat] rmannibucau commented on pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


rmannibucau commented on PR #501:
URL: https://github.com/apache/tomcat/pull/501#issuecomment-1094636457

   +1 I see two advantages:
   
   1. enables cases where "front" tomcat has big incoming headers but "normal" 
forwarded headers
   2. enables better web server abstractions which often have this configuration
   
   Open question: shouldn't `setMaxHttpHeaderSize` set both request and 
response ones and `maxHttpHeaderSize` field be dropped for backward compat?


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



[GitHub] [tomcat] CrazyHZM commented on pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


CrazyHZM commented on PR #501:
URL: https://github.com/apache/tomcat/pull/501#issuecomment-1094629380

   > That seems pretty straightforward. I'm slightly skeptical about the real 
practical use since trying to optimize the sizes too much is risky, but no 
problem, this is the user's responsibility.
   
   @rmaucher 
   I saw some discussion about this, you can refer to it: 
   https://github.com/spring-projects/spring-boot/issues/29382


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



[GitHub] [tomcat] CrazyHZM commented on a diff in pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


CrazyHZM commented on code in PR #501:
URL: https://github.com/apache/tomcat/pull/501#discussion_r847005884


##
java/org/apache/coyote/http11/AbstractHttp11Protocol.java:
##
@@ -244,6 +244,34 @@ public void setMaxSavePostSize(int maxSavePostSize) {
 public void setMaxHttpHeaderSize(int valueI) { maxHttpHeaderSize = valueI; 
}
 
 
+/**
+ * Maximum size of the HTTP request message header.
+ */
+private int maxHttpRequestHeaderSize = -1;

Review Comment:
   I'm worried about the compatibility risk of removing getMaxHttpHeaderSize(), 
because this is a public API after all, I wonder if this change can be done in 
10.1.x. of which I agree with the annotation Deprecated.



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



[GitHub] [tomcat] rmaucher commented on pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


rmaucher commented on PR #501:
URL: https://github.com/apache/tomcat/pull/501#issuecomment-1094622549

   That seems pretty straightforward. I'm slightly skeptical about the real 
practical use since trying to optimize the sizes too much is risky, but no 
problem, this is the user's responsibility.


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



[GitHub] [tomcat] gmshake commented on a diff in pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


gmshake commented on code in PR #501:
URL: https://github.com/apache/tomcat/pull/501#discussion_r846991658


##
java/org/apache/coyote/http11/AbstractHttp11Protocol.java:
##
@@ -244,6 +244,34 @@ public void setMaxSavePostSize(int maxSavePostSize) {
 public void setMaxHttpHeaderSize(int valueI) { maxHttpHeaderSize = valueI; 
}
 
 
+/**
+ * Maximum size of the HTTP request message header.
+ */
+private int maxHttpRequestHeaderSize = -1;

Review Comment:
   After the change, `maxHttpHeaderSize` becomes default maximum size of the 
HTTP message header for both request and response.
   
   If we no longer have consumer of `getMaxHttpHeaderSize()`, then I'd suggest 
to remove `maxHttpHeaderSize`, and change `setMaxHttpHeaderSize()` like this 
   
   ```java
   @Deprecated
   public void setMaxHttpHeaderSize(int valueI) {
   maxHttpRequestHeaderSize = valueI;
   maxHttpResponseHeaderSize = valueI;
   }
   ```



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



[GitHub] [tomcat] CrazyHZM opened a new pull request, #502: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


CrazyHZM opened a new pull request, #502:
URL: https://github.com/apache/tomcat/pull/502

   Mail link:https://bz.apache.org/bugzilla/show_bug.cgi?id=65866


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



[Bug 65866] Allow AbstractHttp11Protocol.setMaxHttpHeaderSize to apply to request or response only

2022-04-11 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65866

--- Comment #3 from Zhongming Hua  ---
Please review the code first, if there is no problem, I will support this on
other branches as well.
https://github.com/apache/tomcat/pull/501

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



[GitHub] [tomcat] CrazyHZM commented on pull request #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


CrazyHZM commented on PR #501:
URL: https://github.com/apache/tomcat/pull/501#issuecomment-1094598895

   Please review the code first, if there is no problem, I will support this on 
other branches as well.


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



[GitHub] [tomcat] CrazyHZM opened a new pull request, #501: Support max http request header size and max http header size configuration separation

2022-04-11 Thread GitBox


CrazyHZM opened a new pull request, #501:
URL: https://github.com/apache/tomcat/pull/501

   Mail link:https://bz.apache.org/bugzilla/show_bug.cgi?id=65866
   
   


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