Re: [PR] webdav lock and unlock: ensure response must not be cached [tomcat]

2024-10-24 Thread via GitHub


Chenjp commented on PR #771:
URL: https://github.com/apache/tomcat/pull/771#issuecomment-2436588929

   > If the `ExpiresFilter` is setting cache control headers when it shouldn't 
then that Filter should be fixed. The same goes for any other component setting 
cache headers incorrectly.
   
   
   
   > OTOH, +1 if you want to rewrite (they are too verbose right now) and 
expand the WebDAV tests.
   
   I started reading rfc4918 three weeks ago, and yesterday when i submitted 
the code i found that @rmaucher you had almost finished WebDAV rfc support.


-- 
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: (tomcat) branch main updated: Create a HttpParser if none is found

2024-10-24 Thread Mark Thomas

On 24/10/2024 15:56, r...@apache.org wrote:

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 7767b84d42 Create a HttpParser if none is found
7767b84d42 is described below

commit 7767b84d422cda47b55125eac892f08ad78883ac
Author: remm 
AuthorDate: Thu Oct 24 16:55:57 2024 +0200

 Create a HttpParser if none is found
 
 Lifecycle is not enforced in these components, and init actually does

 little (JMX, protocol handlers, upgrade protocols; all likely not used
 and maybe not desired).
 Normally HTTP/2 is always fine since it has to use init to work.
 Reported NPE in Http11InputBuffer from a user with a "working" embedded
 Tomcat before 9.0.93.
---
  java/org/apache/coyote/http11/Http11Processor.java | 16 ++--
  webapps/docs/changelog.xml |  7 +++
  2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 7daa79549a..d34e1772c3 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -146,11 +146,23 @@ public class Http11Processor extends AbstractProcessor {
  private SendfileDataBase sendfileData = null;
  
  
+/**

+ * Http parser.
+ */
+private final HttpParser httpParser;
+
+
  public Http11Processor(AbstractHttp11Protocol protocol, Adapter 
adapter) {
  super(adapter);
  this.protocol = protocol;
  
-inputBuffer = new Http11InputBuffer(request, protocol.getMaxHttpRequestHeaderSize(), protocol.getHttpParser());

+HttpParser httpParser = protocol.getHttpParser();
+if (httpParser == null) {
+httpParser = new HttpParser(protocol.getRelaxedPathChars(), 
protocol.getRelaxedQueryChars());
+}
+this.httpParser = httpParser;


Maybe move this to protocol.getHttpParser() ?

That way we get one HttpParser per protocol instance. One per 
HttpProcessor requires a noticeable amount of memory.


Mark



+
+inputBuffer = new Http11InputBuffer(request, 
protocol.getMaxHttpRequestHeaderSize(), httpParser);
  request.setInputBuffer(inputBuffer);
  
  outputBuffer = new Http11OutputBuffer(response, protocol.getMaxHttpResponseHeaderSize());

@@ -752,7 +764,7 @@ public class Http11Processor extends AbstractProcessor {
  // Validate the characters in the URI. %nn decoding will be checked at
  // the point of decoding.
  for (int i = uriBC.getStart(); i < uriBC.getEnd(); i++) {
-if (!protocol.getHttpParser().isAbsolutePathRelaxed(uriB[i])) {
+if (!httpParser.isAbsolutePathRelaxed(uriB[i])) {
  badRequest("http11processor.request.invalidUri");
  break;
  }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4a38201139..2353c25812 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -225,6 +225,13 @@
  Align buffer reuse of the OpenSSLEngine for tomcat-native with the FFM
  code. (remm)

+  
+Create the HttpParser in Http11Processor
+if it is not present on the AbstractHttp11Protocol
+to provide better lifecycle robustness for regular HTTP/1.1. The new
+behavior was introduced on a previous refactoring to improve HTTP/2
+performance. (remm)
+  
  




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




-
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: Create a HttpParser if none is found

2024-10-24 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm 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 5262c4570b Create a HttpParser if none is found
5262c4570b is described below

commit 5262c4570b189e98443a5e8eb73c86844d4b828f
Author: remm 
AuthorDate: Thu Oct 24 17:05:06 2024 +0200

Create a HttpParser if none is found

Lifecycle is not enforced in these components, and init actually does
little (JMX, protocol handlers, upgrade protocols; all likely not used
and maybe not desired).
Normally HTTP/2 is always fine since it has to use init to work.
Reported NPE in Http11InputBuffer from a user with a "working" embedded
Tomcat before 9.0.93.
---
 java/org/apache/coyote/http11/Http11Processor.java | 16 ++--
 webapps/docs/changelog.xml |  7 +++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 50fc2b5dff..85d6065a36 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -146,13 +146,25 @@ public class Http11Processor extends AbstractProcessor {
 private SendfileDataBase sendfileData = null;
 
 
+/**
+ * Http parser.
+ */
+private final HttpParser httpParser;
+
+
 @SuppressWarnings("deprecation")
 public Http11Processor(AbstractHttp11Protocol protocol, Adapter 
adapter) {
 super(adapter);
 this.protocol = protocol;
 
+HttpParser httpParser = protocol.getHttpParser();
+if (httpParser == null) {
+httpParser = new HttpParser(protocol.getRelaxedPathChars(), 
protocol.getRelaxedQueryChars());
+}
+this.httpParser = httpParser;
+
 inputBuffer = new Http11InputBuffer(request, 
protocol.getMaxHttpRequestHeaderSize(),
-protocol.getRejectIllegalHeader(), protocol.getHttpParser());
+protocol.getRejectIllegalHeader(), httpParser);
 request.setInputBuffer(inputBuffer);
 
 outputBuffer = new Http11OutputBuffer(response, 
protocol.getMaxHttpResponseHeaderSize());
@@ -764,7 +776,7 @@ public class Http11Processor extends AbstractProcessor {
 // Validate the characters in the URI. %nn decoding will be checked at
 // the point of decoding.
 for (int i = uriBC.getStart(); i < uriBC.getEnd(); i++) {
-if (!protocol.getHttpParser().isAbsolutePathRelaxed(uriB[i])) {
+if (!httpParser.isAbsolutePathRelaxed(uriB[i])) {
 badRequest("http11processor.request.invalidUri");
 break;
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index eb038ae9fe..b11b714cbd 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -199,6 +199,13 @@
   
 Skip OpenSSLConf with BoringSSL since it is unsupported. (remm)
   
+  
+Create the HttpParser in Http11Processor
+if it is not present on the AbstractHttp11Protocol
+to provide better lifecycle robustness for regular HTTP/1.1. The new
+behavior was introduced on a previous refactoring to improve HTTP/2
+performance. (remm)
+  
 
   
   


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



(tomcat) branch 9.0.x updated: Create a HttpParser if none is found

2024-10-24 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 0362def0d5 Create a HttpParser if none is found
0362def0d5 is described below

commit 0362def0d5eacf1bcabede9ababa14842653c55f
Author: remm 
AuthorDate: Thu Oct 24 17:05:06 2024 +0200

Create a HttpParser if none is found

Lifecycle is not enforced in these components, and init actually does
little (JMX, protocol handlers, upgrade protocols; all likely not used
and maybe not desired).
Normally HTTP/2 is always fine since it has to use init to work.
Reported NPE in Http11InputBuffer from a user with a "working" embedded
Tomcat before 9.0.93.
---
 java/org/apache/coyote/http11/Http11Processor.java | 16 ++--
 webapps/docs/changelog.xml |  7 +++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 3166903227..aee4a92c04 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -145,13 +145,25 @@ public class Http11Processor extends AbstractProcessor {
 private SendfileDataBase sendfileData = null;
 
 
+/**
+ * Http parser.
+ */
+private final HttpParser httpParser;
+
+
 @SuppressWarnings("deprecation")
 public Http11Processor(AbstractHttp11Protocol protocol, Adapter 
adapter) {
 super(adapter);
 this.protocol = protocol;
 
+HttpParser httpParser = protocol.getHttpParser();
+if (httpParser == null) {
+httpParser = new HttpParser(protocol.getRelaxedPathChars(), 
protocol.getRelaxedQueryChars());
+}
+this.httpParser = httpParser;
+
 inputBuffer = new Http11InputBuffer(request, 
protocol.getMaxHttpRequestHeaderSize(),
-protocol.getRejectIllegalHeader(), protocol.getHttpParser());
+protocol.getRejectIllegalHeader(), httpParser);
 request.setInputBuffer(inputBuffer);
 
 outputBuffer = new Http11OutputBuffer(response, 
protocol.getMaxHttpResponseHeaderSize());
@@ -763,7 +775,7 @@ public class Http11Processor extends AbstractProcessor {
 // Validate the characters in the URI. %nn decoding will be checked at
 // the point of decoding.
 for (int i = uriBC.getStart(); i < uriBC.getEnd(); i++) {
-if (!protocol.getHttpParser().isAbsolutePathRelaxed(uriB[i])) {
+if (!httpParser.isAbsolutePathRelaxed(uriB[i])) {
 badRequest("http11processor.request.invalidUri");
 break;
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2126ed8b0b..94ac99b9c4 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -199,6 +199,13 @@
   
 Skip OpenSSLConf with BoringSSL since it is unsupported. (remm)
   
+  
+Create the HttpParser in Http11Processor
+if it is not present on the AbstractHttp11Protocol
+to provide better lifecycle robustness for regular HTTP/1.1. The new
+behavior was introduced on a previous refactoring to improve HTTP/2
+performance. (remm)
+  
 
   
   


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



Buildbot failure in on tomcat-12.0.x

2024-10-24 Thread buildbot
Build status: BUILD FAILED: failed compile (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/120/builds/161
Blamelist: remm 
Build Text: failed compile (failure)
Status Detected: new failure
Build Source Stamp: [branch main] 7767b84d422cda47b55125eac892f08ad78883ac


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  shell_6: 0

  compile: 1

  shell_7: 0

  shell_8: 0

  shell_9: 0

  shell_10: 0

  Rsync docs to nightlies.apache.org: 0

  shell_11: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 2

  shell_12: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


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



(tomcat) branch 11.0.x updated: Create a HttpParser if none is found

2024-10-24 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/11.0.x by this push:
 new d6bc8f6bdd Create a HttpParser if none is found
d6bc8f6bdd is described below

commit d6bc8f6bdd84215394fcb1ed47687a1958130539
Author: remm 
AuthorDate: Thu Oct 24 16:55:57 2024 +0200

Create a HttpParser if none is found

Lifecycle is not enforced in these components, and init actually does
little (JMX, protocol handlers, upgrade protocols; all likely not used
and maybe not desired).
Normally HTTP/2 is always fine since it has to use init to work.
Reported NPE in Http11InputBuffer from a user with a "working" embedded
Tomcat before 9.0.93.
---
 java/org/apache/coyote/http11/Http11Processor.java | 16 ++--
 webapps/docs/changelog.xml |  7 +++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 7daa79549a..d34e1772c3 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -146,11 +146,23 @@ public class Http11Processor extends AbstractProcessor {
 private SendfileDataBase sendfileData = null;
 
 
+/**
+ * Http parser.
+ */
+private final HttpParser httpParser;
+
+
 public Http11Processor(AbstractHttp11Protocol protocol, Adapter 
adapter) {
 super(adapter);
 this.protocol = protocol;
 
-inputBuffer = new Http11InputBuffer(request, 
protocol.getMaxHttpRequestHeaderSize(), protocol.getHttpParser());
+HttpParser httpParser = protocol.getHttpParser();
+if (httpParser == null) {
+httpParser = new HttpParser(protocol.getRelaxedPathChars(), 
protocol.getRelaxedQueryChars());
+}
+this.httpParser = httpParser;
+
+inputBuffer = new Http11InputBuffer(request, 
protocol.getMaxHttpRequestHeaderSize(), httpParser);
 request.setInputBuffer(inputBuffer);
 
 outputBuffer = new Http11OutputBuffer(response, 
protocol.getMaxHttpResponseHeaderSize());
@@ -752,7 +764,7 @@ public class Http11Processor extends AbstractProcessor {
 // Validate the characters in the URI. %nn decoding will be checked at
 // the point of decoding.
 for (int i = uriBC.getStart(); i < uriBC.getEnd(); i++) {
-if (!protocol.getHttpParser().isAbsolutePathRelaxed(uriB[i])) {
+if (!httpParser.isAbsolutePathRelaxed(uriB[i])) {
 badRequest("http11processor.request.invalidUri");
 break;
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 5d1810ee06..e897240e96 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -203,6 +203,13 @@
 Align buffer reuse of the OpenSSLEngine for tomcat-native with the FFM
 code. (remm)
   
+  
+Create the HttpParser in Http11Processor
+if it is not present on the AbstractHttp11Protocol
+to provide better lifecycle robustness for regular HTTP/1.1. The new
+behavior was introduced on a previous refactoring to improve HTTP/2
+performance. (remm)
+  
 
   
   


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



Re: [PR] Improve mod_jk makefiles [tomcat-connectors]

2024-10-24 Thread via GitHub


mturk commented on code in PR #10:
URL: https://github.com/apache/tomcat-connectors/pull/10#discussion_r1815580677


##
native/apache-2.0/Makefile.vc:
##
@@ -16,38 +16,25 @@
 PROJECT = mod_jk
 # Tools
 CC = cl.exe
-LINK = link.exe
+LN = link.exe
 RC = rc.exe
-MT = mt.exe
 
 !IF !DEFINED(APACHE2_HOME) || "$(APACHE2_HOME)" == ""
 !ERROR Cannot find APACHE2_HOME. Use nmake -f Makefile.vc APACHE2_HOME=dir
 !ENDIF
 !IF !DEFINED(APACHE2_LDIR) || "$(APACHE2_LDIR)" == ""
-APACHE2_LDIR=$(APACHE2_HOME)\lib
+APACHE2_LDIR = lib

Review Comment:
   My intention was to simplify the things by not requiring the full path for 
lib and include dirs,
   since APACHE2_HOME should point to the directory containing both lib and 
include/httpd and include/apr-1.
   The APACHE2_IDIR makes no sence, since it should always be 
$(APACHE2_HOME)\include.
   Same for APACHE2_LDIR that is by default $(APACHE2_HOME)\lib.
   However one can set APACHE2_LDIR=lib64, which would evaluate to 
$(APACHE2_HOME)\lib64
   
   



-- 
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: [PR] Improve mod_jk makefiles [tomcat-connectors]

2024-10-24 Thread via GitHub


ChristopherSchultz commented on code in PR #10:
URL: https://github.com/apache/tomcat-connectors/pull/10#discussion_r1815478755


##
native/apache-2.0/Makefile.vc:
##
@@ -16,38 +16,25 @@
 PROJECT = mod_jk
 # Tools
 CC = cl.exe
-LINK = link.exe
+LN = link.exe
 RC = rc.exe
-MT = mt.exe
 
 !IF !DEFINED(APACHE2_HOME) || "$(APACHE2_HOME)" == ""
 !ERROR Cannot find APACHE2_HOME. Use nmake -f Makefile.vc APACHE2_HOME=dir
 !ENDIF
 !IF !DEFINED(APACHE2_LDIR) || "$(APACHE2_LDIR)" == ""
-APACHE2_LDIR=$(APACHE2_HOME)\lib
+APACHE2_LDIR = lib

Review Comment:
   This looks like it should probably continue to have the `$(APACHE2_HOME)/` 
prefix. Why is this being removed?



-- 
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: [PR] Improve mod_jk makefiles [tomcat-connectors]

2024-10-24 Thread via GitHub


ChristopherSchultz commented on code in PR #10:
URL: https://github.com/apache/tomcat-connectors/pull/10#discussion_r1815482357


##
native/apache-2.0/Makefile.vc:
##
@@ -16,38 +16,25 @@
 PROJECT = mod_jk
 # Tools
 CC = cl.exe
-LINK = link.exe
+LN = link.exe
 RC = rc.exe
-MT = mt.exe
 
 !IF !DEFINED(APACHE2_HOME) || "$(APACHE2_HOME)" == ""
 !ERROR Cannot find APACHE2_HOME. Use nmake -f Makefile.vc APACHE2_HOME=dir
 !ENDIF
 !IF !DEFINED(APACHE2_LDIR) || "$(APACHE2_LDIR)" == ""
-APACHE2_LDIR=$(APACHE2_HOME)\lib
+APACHE2_LDIR = lib

Review Comment:
   It looks like this should not change. If the admin wants to change the lib 
(or include, etc.) dirs, they cannot now because they will always have to be 
relative to `APACHE2_HOME`. Without this change, a full path can be specified 
for the `APACHE2_LIB` (`_INCLUDE`, etc.) including a drive letter, but this 
change makes that impossible.
   
   I don't know if there are any use-cases for specifying different lib, 
include, etc. directories but this looks like a loss in functionality.



-- 
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: (tomcat) branch main updated: Create a HttpParser if none is found

2024-10-24 Thread Rémy Maucherat
On Thu, Oct 24, 2024 at 7:11 PM Mark Thomas  wrote:
>
> On 24/10/2024 15:56, r...@apache.org wrote:
> > 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 7767b84d42 Create a HttpParser if none is found
> > 7767b84d42 is described below
> >
> > commit 7767b84d422cda47b55125eac892f08ad78883ac
> > Author: remm 
> > AuthorDate: Thu Oct 24 16:55:57 2024 +0200
> >
> >  Create a HttpParser if none is found
> >
> >  Lifecycle is not enforced in these components, and init actually does
> >  little (JMX, protocol handlers, upgrade protocols; all likely not used
> >  and maybe not desired).
> >  Normally HTTP/2 is always fine since it has to use init to work.
> >  Reported NPE in Http11InputBuffer from a user with a "working" embedded
> >  Tomcat before 9.0.93.
> > ---
> >   java/org/apache/coyote/http11/Http11Processor.java | 16 ++--
> >   webapps/docs/changelog.xml |  7 +++
> >   2 files changed, 21 insertions(+), 2 deletions(-)
> >
> > diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
> > b/java/org/apache/coyote/http11/Http11Processor.java
> > index 7daa79549a..d34e1772c3 100644
> > --- a/java/org/apache/coyote/http11/Http11Processor.java
> > +++ b/java/org/apache/coyote/http11/Http11Processor.java
> > @@ -146,11 +146,23 @@ public class Http11Processor extends 
> > AbstractProcessor {
> >   private SendfileDataBase sendfileData = null;
> >
> >
> > +/**
> > + * Http parser.
> > + */
> > +private final HttpParser httpParser;
> > +
> > +
> >   public Http11Processor(AbstractHttp11Protocol protocol, Adapter 
> > adapter) {
> >   super(adapter);
> >   this.protocol = protocol;
> >
> > -inputBuffer = new Http11InputBuffer(request, 
> > protocol.getMaxHttpRequestHeaderSize(), protocol.getHttpParser());
> > +HttpParser httpParser = protocol.getHttpParser();
> > +if (httpParser == null) {
> > +httpParser = new HttpParser(protocol.getRelaxedPathChars(), 
> > protocol.getRelaxedQueryChars());
> > +}
> > +this.httpParser = httpParser;
>
> Maybe move this to protocol.getHttpParser() ?
>
> That way we get one HttpParser per protocol instance. One per
> HttpProcessor requires a noticeable amount of memory.

I'm not sure what the user was doing with the lifecycle, probably not
calling protocol init or something like that. The log looked
incoherent. Basically the code reverts the previous commit if
protocol.getHttpParser() == null, which seems fair.
Moving it to protocol.getHttpParser() is an idea, but it might need to
be volatile and coverity could complain about it. This would make
things worse since this situation should not happen at all (maybe I
can add a log ?).

Rémy


> Mark
>
>
> > +
> > +inputBuffer = new Http11InputBuffer(request, 
> > protocol.getMaxHttpRequestHeaderSize(), httpParser);
> >   request.setInputBuffer(inputBuffer);
> >
> >   outputBuffer = new Http11OutputBuffer(response, 
> > protocol.getMaxHttpResponseHeaderSize());
> > @@ -752,7 +764,7 @@ public class Http11Processor extends AbstractProcessor {
> >   // Validate the characters in the URI. %nn decoding will be 
> > checked at
> >   // the point of decoding.
> >   for (int i = uriBC.getStart(); i < uriBC.getEnd(); i++) {
> > -if (!protocol.getHttpParser().isAbsolutePathRelaxed(uriB[i])) {
> > +if (!httpParser.isAbsolutePathRelaxed(uriB[i])) {
> >   badRequest("http11processor.request.invalidUri");
> >   break;
> >   }
> > diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
> > index 4a38201139..2353c25812 100644
> > --- a/webapps/docs/changelog.xml
> > +++ b/webapps/docs/changelog.xml
> > @@ -225,6 +225,13 @@
> >   Align buffer reuse of the OpenSSLEngine for tomcat-native with 
> > the FFM
> >   code. (remm)
> > 
> > +  
> > +Create the HttpParser in Http11Processor
> > +if it is not present on the AbstractHttp11Protocol
> > +to provide better lifecycle robustness for regular HTTP/1.1. The 
> > new
> > +behavior was introduced on a previous refactoring to improve HTTP/2
> > +performance. (remm)
> > +  
> >   
> > 
> > 
> >
> >
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: dev-h...@tomcat.apache.org
> >
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>


Re: [PR] Improve mod_jk makefiles [tomcat-connectors]

2024-10-24 Thread via GitHub


ChristopherSchultz commented on code in PR #10:
URL: https://github.com/apache/tomcat-connectors/pull/10#discussion_r1815478755


##
native/apache-2.0/Makefile.vc:
##
@@ -16,38 +16,25 @@
 PROJECT = mod_jk
 # Tools
 CC = cl.exe
-LINK = link.exe
+LN = link.exe
 RC = rc.exe
-MT = mt.exe
 
 !IF !DEFINED(APACHE2_HOME) || "$(APACHE2_HOME)" == ""
 !ERROR Cannot find APACHE2_HOME. Use nmake -f Makefile.vc APACHE2_HOME=dir
 !ENDIF
 !IF !DEFINED(APACHE2_LDIR) || "$(APACHE2_LDIR)" == ""
-APACHE2_LDIR=$(APACHE2_HOME)\lib
+APACHE2_LDIR = lib

Review Comment:
   This looks like it should probably continue to have the `$(APACHE2_HOME)/` 
prefix. Why is this being removed?



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



Buildbot success in on tomcat-12.0.x

2024-10-24 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/120/builds/160
Blamelist: remm 
Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch main] 514c17151744907ae98df05b67e7d6443d7b4c20


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  shell_6: 0

  compile: 1

  shell_7: 0

  shell_8: 0

  shell_9: 0

  shell_10: 0

  Rsync docs to nightlies.apache.org: 0

  shell_11: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 1

  shell_12: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


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



Re: [PR] webdav lock and unlock: ensure response must not be cached [tomcat]

2024-10-24 Thread via GitHub


markt-asf commented on PR #771:
URL: https://github.com/apache/tomcat/pull/771#issuecomment-2434998619

   If the `ExpiresFilter` is setting cache control headers when it should then 
that Filter should be fixed. The same goes for any other component setting 
cache headers incorrectly.


-- 
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 main updated: Create a HttpParser if none is found

2024-10-24 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 7767b84d42 Create a HttpParser if none is found
7767b84d42 is described below

commit 7767b84d422cda47b55125eac892f08ad78883ac
Author: remm 
AuthorDate: Thu Oct 24 16:55:57 2024 +0200

Create a HttpParser if none is found

Lifecycle is not enforced in these components, and init actually does
little (JMX, protocol handlers, upgrade protocols; all likely not used
and maybe not desired).
Normally HTTP/2 is always fine since it has to use init to work.
Reported NPE in Http11InputBuffer from a user with a "working" embedded
Tomcat before 9.0.93.
---
 java/org/apache/coyote/http11/Http11Processor.java | 16 ++--
 webapps/docs/changelog.xml |  7 +++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java 
b/java/org/apache/coyote/http11/Http11Processor.java
index 7daa79549a..d34e1772c3 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -146,11 +146,23 @@ public class Http11Processor extends AbstractProcessor {
 private SendfileDataBase sendfileData = null;
 
 
+/**
+ * Http parser.
+ */
+private final HttpParser httpParser;
+
+
 public Http11Processor(AbstractHttp11Protocol protocol, Adapter 
adapter) {
 super(adapter);
 this.protocol = protocol;
 
-inputBuffer = new Http11InputBuffer(request, 
protocol.getMaxHttpRequestHeaderSize(), protocol.getHttpParser());
+HttpParser httpParser = protocol.getHttpParser();
+if (httpParser == null) {
+httpParser = new HttpParser(protocol.getRelaxedPathChars(), 
protocol.getRelaxedQueryChars());
+}
+this.httpParser = httpParser;
+
+inputBuffer = new Http11InputBuffer(request, 
protocol.getMaxHttpRequestHeaderSize(), httpParser);
 request.setInputBuffer(inputBuffer);
 
 outputBuffer = new Http11OutputBuffer(response, 
protocol.getMaxHttpResponseHeaderSize());
@@ -752,7 +764,7 @@ public class Http11Processor extends AbstractProcessor {
 // Validate the characters in the URI. %nn decoding will be checked at
 // the point of decoding.
 for (int i = uriBC.getStart(); i < uriBC.getEnd(); i++) {
-if (!protocol.getHttpParser().isAbsolutePathRelaxed(uriB[i])) {
+if (!httpParser.isAbsolutePathRelaxed(uriB[i])) {
 badRequest("http11processor.request.invalidUri");
 break;
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4a38201139..2353c25812 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -225,6 +225,13 @@
 Align buffer reuse of the OpenSSLEngine for tomcat-native with the FFM
 code. (remm)
   
+  
+Create the HttpParser in Http11Processor
+if it is not present on the AbstractHttp11Protocol
+to provide better lifecycle robustness for regular HTTP/1.1. The new
+behavior was introduced on a previous refactoring to improve HTTP/2
+performance. (remm)
+  
 
   
   


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



(tomcat) branch main updated: Minor fixes

2024-10-24 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 62473af6a0 Minor fixes
62473af6a0 is described below

commit 62473af6a02e6d36d8ba6a3bc4e205e22eb0ea86
Author: remm 
AuthorDate: Thu Oct 24 09:34:05 2024 +0200

Minor fixes

Stop using the Lock-Token header for isLocked (clearly not used for
that).
More accurate matching of the token (append : and >).
Cleanup the unlock for shared locks, although no real change (unless
there's a token with no shared lock anymore, which should not really
happen).
Drop old unlockResource method (the shared lock unlock probably had some
issue since it seemed to only remove the first one), and replace it with
a much simpler deletedResource.
---
 .../apache/catalina/servlets/WebdavServlet.java| 83 +-
 1 file changed, 32 insertions(+), 51 deletions(-)

diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index 0d8474892e..c6573aed43 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1634,14 +1634,14 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 } else {
 if ((parentPath != path && parentLock.depth > 0) || 
parentPath == path) {
 if (parentLock.isExclusive()) {
-if (ifHeader.contains(parentLock.token) && 
(parentLock.principal == null ||
+if (ifHeader.contains(":" + parentLock.token + 
">") && (parentLock.principal == null ||
 
parentLock.principal.equals(req.getRemoteUser( {
 toRenew = parentLock;
 break;
 }
 } else {
 for (String token : parentLock.sharedTokens) {
-if (ifHeader.contains(token)) {
+if (ifHeader.contains(":" + token + ">")) {
 LockInfo sharedLock = 
sharedLocks.get(token);
 if (sharedLock != null && 
(sharedLock.principal == null ||
 
sharedLock.principal.equals(req.getRemoteUser( {
@@ -1734,7 +1734,7 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 } else {
 if ((parentPath != path && parentLock.depth > 0) || 
parentPath == path) {
 if (parentLock.isExclusive()) {
-if (lockTokenHeader.contains(parentLock.token) && 
(parentLock.principal == null ||
+if (lockTokenHeader.contains(":" + 
parentLock.token + ">") && (parentLock.principal == null ||
 
parentLock.principal.equals(req.getRemoteUser( {
 resourceLocks.remove(parentPath);
 unlocked = true;
@@ -1746,23 +1746,25 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 }
 } else {
 for (String token : parentLock.sharedTokens) {
-if (lockTokenHeader.contains(token)) {
+if (lockTokenHeader.contains(":" + token + 
">")) {
 LockInfo lock = sharedLocks.get(token);
-if (lock == null || lock.principal == null 
||
-
lock.principal.equals(req.getRemoteUser())) {
-if ((parentPath != path && lock != 
null && lock.depth > 0) ||
-parentPath == path) {
+if (lock == null) {
+parentLock.sharedTokens.remove(token);
+} else if (lock.principal == null || 
lock.principal.equals(req.getRemoteUser())) {
+// The shared lock might not have the 
same depth
+if ((parentPath != path && lock.depth 
> 0) || parentPath == path) {
 
parentLock.sharedTokens.remove(token);
-if 
(parentLock.sharedTokens.isEmpty()) {
-
resourceLocks.remove(parentPath);
-}
  

(tomcat) branch 10.1.x updated: Minor fixes

2024-10-24 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm 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 1e9cba6c73 Minor fixes
1e9cba6c73 is described below

commit 1e9cba6c7391689445ec7dce7b3894cad27be13e
Author: remm 
AuthorDate: Thu Oct 24 09:34:05 2024 +0200

Minor fixes

Stop using the Lock-Token header for isLocked (clearly not used for
that).
More accurate matching of the token (append : and >).
Cleanup the unlock for shared locks, although no real change (unless
there's a token with no shared lock anymore, which should not really
happen).
Drop old unlockResource method (the shared lock unlock probably had some
issue since it seemed to only remove the first one), and replace it with
a much simpler deletedResource.
---
 .../apache/catalina/servlets/WebdavServlet.java| 83 +-
 1 file changed, 32 insertions(+), 51 deletions(-)

diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index ffa841824d..ce144c1ed4 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1632,14 +1632,14 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 } else {
 if ((parentPath != path && parentLock.depth > 0) || 
parentPath == path) {
 if (parentLock.isExclusive()) {
-if (ifHeader.contains(parentLock.token) && 
(parentLock.principal == null ||
+if (ifHeader.contains(":" + parentLock.token + 
">") && (parentLock.principal == null ||
 
parentLock.principal.equals(req.getRemoteUser( {
 toRenew = parentLock;
 break;
 }
 } else {
 for (String token : parentLock.sharedTokens) {
-if (ifHeader.contains(token)) {
+if (ifHeader.contains(":" + token + ">")) {
 LockInfo sharedLock = 
sharedLocks.get(token);
 if (sharedLock != null && 
(sharedLock.principal == null ||
 
sharedLock.principal.equals(req.getRemoteUser( {
@@ -1732,7 +1732,7 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 } else {
 if ((parentPath != path && parentLock.depth > 0) || 
parentPath == path) {
 if (parentLock.isExclusive()) {
-if (lockTokenHeader.contains(parentLock.token) && 
(parentLock.principal == null ||
+if (lockTokenHeader.contains(":" + 
parentLock.token + ">") && (parentLock.principal == null ||
 
parentLock.principal.equals(req.getRemoteUser( {
 resourceLocks.remove(parentPath);
 unlocked = true;
@@ -1744,23 +1744,25 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 }
 } else {
 for (String token : parentLock.sharedTokens) {
-if (lockTokenHeader.contains(token)) {
+if (lockTokenHeader.contains(":" + token + 
">")) {
 LockInfo lock = sharedLocks.get(token);
-if (lock == null || lock.principal == null 
||
-
lock.principal.equals(req.getRemoteUser())) {
-if ((parentPath != path && lock != 
null && lock.depth > 0) ||
-parentPath == path) {
+if (lock == null) {
+parentLock.sharedTokens.remove(token);
+} else if (lock.principal == null || 
lock.principal.equals(req.getRemoteUser())) {
+// The shared lock might not have the 
same depth
+if ((parentPath != path && lock.depth 
> 0) || parentPath == path) {
 
parentLock.sharedTokens.remove(token);
-if 
(parentLock.sharedTokens.isEmpty()) {
-
resourceLocks.remove(parentPath);
-}
  

(tomcat) branch 11.0.x updated: Minor fixes

2024-10-24 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/11.0.x by this push:
 new 259b06f7bd Minor fixes
259b06f7bd is described below

commit 259b06f7bd4039ae3fdca976bb4224586e01a282
Author: remm 
AuthorDate: Thu Oct 24 09:34:05 2024 +0200

Minor fixes

Stop using the Lock-Token header for isLocked (clearly not used for
that).
More accurate matching of the token (append : and >).
Cleanup the unlock for shared locks, although no real change (unless
there's a token with no shared lock anymore, which should not really
happen).
Drop old unlockResource method (the shared lock unlock probably had some
issue since it seemed to only remove the first one), and replace it with
a much simpler deletedResource.
---
 .../apache/catalina/servlets/WebdavServlet.java| 83 +-
 1 file changed, 32 insertions(+), 51 deletions(-)

diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index ffa841824d..ce144c1ed4 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1632,14 +1632,14 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 } else {
 if ((parentPath != path && parentLock.depth > 0) || 
parentPath == path) {
 if (parentLock.isExclusive()) {
-if (ifHeader.contains(parentLock.token) && 
(parentLock.principal == null ||
+if (ifHeader.contains(":" + parentLock.token + 
">") && (parentLock.principal == null ||
 
parentLock.principal.equals(req.getRemoteUser( {
 toRenew = parentLock;
 break;
 }
 } else {
 for (String token : parentLock.sharedTokens) {
-if (ifHeader.contains(token)) {
+if (ifHeader.contains(":" + token + ">")) {
 LockInfo sharedLock = 
sharedLocks.get(token);
 if (sharedLock != null && 
(sharedLock.principal == null ||
 
sharedLock.principal.equals(req.getRemoteUser( {
@@ -1732,7 +1732,7 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 } else {
 if ((parentPath != path && parentLock.depth > 0) || 
parentPath == path) {
 if (parentLock.isExclusive()) {
-if (lockTokenHeader.contains(parentLock.token) && 
(parentLock.principal == null ||
+if (lockTokenHeader.contains(":" + 
parentLock.token + ">") && (parentLock.principal == null ||
 
parentLock.principal.equals(req.getRemoteUser( {
 resourceLocks.remove(parentPath);
 unlocked = true;
@@ -1744,23 +1744,25 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 }
 } else {
 for (String token : parentLock.sharedTokens) {
-if (lockTokenHeader.contains(token)) {
+if (lockTokenHeader.contains(":" + token + 
">")) {
 LockInfo lock = sharedLocks.get(token);
-if (lock == null || lock.principal == null 
||
-
lock.principal.equals(req.getRemoteUser())) {
-if ((parentPath != path && lock != 
null && lock.depth > 0) ||
-parentPath == path) {
+if (lock == null) {
+parentLock.sharedTokens.remove(token);
+} else if (lock.principal == null || 
lock.principal.equals(req.getRemoteUser())) {
+// The shared lock might not have the 
same depth
+if ((parentPath != path && lock.depth 
> 0) || parentPath == path) {
 
parentLock.sharedTokens.remove(token);
-if 
(parentLock.sharedTokens.isEmpty()) {
-
resourceLocks.remove(parentPath);
-}
  

(tomcat) branch 9.0.x updated: Minor fixes

2024-10-24 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 e1bca79d3d Minor fixes
e1bca79d3d is described below

commit e1bca79d3d1579a1a73edc14216eb7c254f03a94
Author: remm 
AuthorDate: Thu Oct 24 09:34:05 2024 +0200

Minor fixes

Stop using the Lock-Token header for isLocked (clearly not used for
that).
More accurate matching of the token (append : and >).
Cleanup the unlock for shared locks, although no real change (unless
there's a token with no shared lock anymore, which should not really
happen).
Drop old unlockResource method (the shared lock unlock probably had some
issue since it seemed to only remove the first one), and replace it with
a much simpler deletedResource.
---
 .../apache/catalina/servlets/WebdavServlet.java| 83 +-
 1 file changed, 32 insertions(+), 51 deletions(-)

diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index f36dfc0892..823efb6c7a 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1631,14 +1631,14 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 } else {
 if ((parentPath != path && parentLock.depth > 0) || 
parentPath == path) {
 if (parentLock.isExclusive()) {
-if (ifHeader.contains(parentLock.token) && 
(parentLock.principal == null ||
+if (ifHeader.contains(":" + parentLock.token + 
">") && (parentLock.principal == null ||
 
parentLock.principal.equals(req.getRemoteUser( {
 toRenew = parentLock;
 break;
 }
 } else {
 for (String token : parentLock.sharedTokens) {
-if (ifHeader.contains(token)) {
+if (ifHeader.contains(":" + token + ">")) {
 LockInfo sharedLock = 
sharedLocks.get(token);
 if (sharedLock != null && 
(sharedLock.principal == null ||
 
sharedLock.principal.equals(req.getRemoteUser( {
@@ -1731,7 +1731,7 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 } else {
 if ((parentPath != path && parentLock.depth > 0) || 
parentPath == path) {
 if (parentLock.isExclusive()) {
-if (lockTokenHeader.contains(parentLock.token) && 
(parentLock.principal == null ||
+if (lockTokenHeader.contains(":" + 
parentLock.token + ">") && (parentLock.principal == null ||
 
parentLock.principal.equals(req.getRemoteUser( {
 resourceLocks.remove(parentPath);
 unlocked = true;
@@ -1743,23 +1743,25 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 }
 } else {
 for (String token : parentLock.sharedTokens) {
-if (lockTokenHeader.contains(token)) {
+if (lockTokenHeader.contains(":" + token + 
">")) {
 LockInfo lock = sharedLocks.get(token);
-if (lock == null || lock.principal == null 
||
-
lock.principal.equals(req.getRemoteUser())) {
-if ((parentPath != path && lock != 
null && lock.depth > 0) ||
-parentPath == path) {
+if (lock == null) {
+parentLock.sharedTokens.remove(token);
+} else if (lock.principal == null || 
lock.principal.equals(req.getRemoteUser())) {
+// The shared lock might not have the 
same depth
+if ((parentPath != path && lock.depth 
> 0) || parentPath == path) {
 
parentLock.sharedTokens.remove(token);
-if 
(parentLock.sharedTokens.isEmpty()) {
-
resourceLocks.remove(parentPath);
-}

(tomcat) branch main updated: Remove Java 17 from the workflow

2024-10-24 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 c986117e95 Remove Java 17 from the workflow
c986117e95 is described below

commit c986117e9523e49a641aeb8093a435442893b2c9
Author: remm 
AuthorDate: Thu Oct 24 10:20:41 2024 +0200

Remove Java 17 from the workflow
---
 .github/workflows/ci.yml | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0849a31230..6954948d48 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -33,11 +33,9 @@ jobs:
   matrix:
 isMain:
   - ${{ contains(github.ref, 'main') }}
-java: [ 17, 21, 23, 24-ea ]
+java: [ 21, 23, 24-ea ]
 os: [ ubuntu-latest, windows-latest, macos-latest ]
 exclude:
-  - isMain: true
-java: 17
   - os: windows-latest
 java: 21
   - os: macos-latest


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



Re: [PR] webdav lock and unlock: ensure response must not be cached [tomcat]

2024-10-24 Thread via GitHub


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

   All of the WebDAV methods are "must not cache" actually (except PROPFIND, 
but IMO it's a bad idea to cache it), and it is 100% obvious why. If the proxy 
feels like it doesn't have to send the MKCOL to Tomcat, things are not going to 
work. I don't know if the WebDAV Servlet should have built in headers for that 
or the users should use a valve, filter or something instead (like the obvious: 
DO NOT use a caching proxy on the WebDAV location !).
   
   Personally I am "done" with the WebDAV Servlet. The area had no tests 
(Litmus was sometimes run manually by Mark it seems) so according to our 
previous meetings there was a need to improve that. Along the way I found 
design problems and bugs I had to fix, and it now seems good enough (Litmus 
passes and the testcase scenarios are rather complex). I don't believe there 
are lots of users for this, so as far as I am concerned it is more than enough.
   
   When adding tests, you might want to look at that: 
https://nightlies.apache.org/tomcat/tomcat-12.0.x/coverage/org.apache.catalina.servlets/index.html#dn-a
   You can set test.coverage=true (and also add execute.validate=true) in your 
build.properties to see if new tests improve that or if things were already 
covered.


-- 
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 main updated: Needs the property as well

2024-10-24 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 514c171517 Needs the property as well
514c171517 is described below

commit 514c17151744907ae98df05b67e7d6443d7b4c20
Author: remm 
AuthorDate: Thu Oct 24 10:34:41 2024 +0200

Needs the property as well
---
 .github/workflows/validate.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml
index 590d572ebb..ace4c0d7a2 100644
--- a/.github/workflows/validate.yml
+++ b/.github/workflows/validate.yml
@@ -43,6 +43,8 @@ jobs:
 - name: Build
   run: |
 ant -noinput validate
+  env:
+ANT_OPTS: -Dexecute.validate=true
 
   continue-on-error:
 false


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



Re: [PR] webdav lock and unlock: ensure response must not be cached [tomcat]

2024-10-24 Thread via GitHub


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

   OTOH, +1 if you want to rewrite (they are too verbose right now) and expand 
the WebDAV tests.


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



Buildbot success in on tomcat-10.1.x

2024-10-24 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/44/builds/1463
Blamelist: remm 
Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch 10.1.x] 1e9cba6c7391689445ec7dce7b3894cad27be13e


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 0

  shell_9: 0

  Rsync docs to nightlies.apache.org: 0

  shell_10: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 1

  shell_11: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


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



Re: [PR] webdav lock and unlock: ensure response must not be cached [tomcat]

2024-10-24 Thread via GitHub


Chenjp commented on PR #771:
URL: https://github.com/apache/tomcat/pull/771#issuecomment-2434716856

   > This change is unnecessary. As per RFC 9111, methods other than GET are 
only cached if the method definition allows it. RFC 4918 is explicit that these 
methods are not cacheable.
   
   Currently, expiresFilter with default conf will enable cache for those 
LOCK/UNLOCK etc. If source server do not explicitly disable it, then other 
component like ExpiresFilter, Nginx/Apache Httpd, F5, Proxy Server will have to 
be responsible for that. 
   If the proxy server of our user, how to resolve it - Ask their IT team to 
modify proxy setting? 


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



Buildbot failure in on tomcat-12.0.x

2024-10-24 Thread buildbot
Build status: BUILD FAILED: failed Snapshot deployed to ASF Maven snapshot 
repository (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/120/builds/159
Blamelist: remm 
Build Text: failed Snapshot deployed to ASF Maven snapshot repository (failure)
Status Detected: new failure
Build Source Stamp: [branch main] 62473af6a02e6d36d8ba6a3bc4e205e22eb0ea86


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  shell_6: 0

  compile: 1

  shell_7: 0

  shell_8: 0

  shell_9: 2


-- ASF Buildbot


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



Re: [PR] webdav lock and unlock: ensure response must not be cached [tomcat]

2024-10-24 Thread via GitHub


markt-asf commented on PR #771:
URL: https://github.com/apache/tomcat/pull/771#issuecomment-2434618560

   This change is unnecessary. As per RFC 9111, methods other than GET are only 
cached if the method definition allows it. RFC 4918 is explicit that these 
methods are not cacheable.


-- 
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: [PR] webdav lock and unlock: ensure response must not be cached [tomcat]

2024-10-24 Thread via GitHub


markt-asf closed pull request #771: webdav lock and unlock: ensure response 
must not be cached
URL: https://github.com/apache/tomcat/pull/771


-- 
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 main updated: Add validate GH workflow

2024-10-24 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 21a8e3d48f Add validate GH workflow
21a8e3d48f is described below

commit 21a8e3d48fd1da50cff9343aa9c8af1bc4f8dc04
Author: remm 
AuthorDate: Thu Oct 24 10:27:31 2024 +0200

Add validate GH workflow
---
 .github/workflows/validate.yml | 49 ++
 1 file changed, 49 insertions(+)

diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml
new file mode 100644
index 00..590d572ebb
--- /dev/null
+++ b/.github/workflows/validate.yml
@@ -0,0 +1,49 @@
+#Licensed 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.
+
+name: Validate code
+
+on:
+  push:
+branches:
+  - main
+  pull_request:
+branches:
+  - main
+
+env:
+  LC_ALL: en_US.UTF-8
+
+jobs:
+  JDKxx_Matrix:
+strategy:
+  fail-fast: true
+  matrix:
+java: [ 21 ]
+os: [ ubuntu-latest ]
+name: JDK${{ matrix.java }} ${{ matrix.os }}
+runs-on: ${{ matrix.os }}
+steps:
+- name: Git Checkout
+  uses: actions/checkout@v4
+- name: Set up Java
+  uses: actions/setup-java@v4
+  with:
+java-version: ${{ matrix.java }}
+distribution: zulu
+- name: Build
+  run: |
+ant -noinput validate
+
+  continue-on-error:
+false
+


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