(tomcat) branch main updated: Remove WebDAV lock null support for compliance with RFC 4918

2024-10-17 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 82a1f68561 Remove WebDAV lock null support for compliance with RFC 4918
82a1f68561 is described below

commit 82a1f6856183f5d2267af1235f066cf0541dc3c0
Author: remm 
AuthorDate: Thu Oct 17 10:40:52 2024 +0200

Remove WebDAV lock null support for compliance with RFC 4918

Section 7.3 and annex D deprecate lock nulls and define a new behavior.
http://www.webdav.org/specs/rfc4918.html#lock-null
Instead a lock on a non existing resource will create an empty file
locked with a regular lock, which is of course far simpler. When
removing the lock, the corresponding file will not go away.
Since this is a behavior change, I do not intend to backport.
---
 .../apache/catalina/servlets/WebdavServlet.java| 146 ++---
 .../catalina/servlets/TestWebdavServlet.java   |   2 +-
 webapps/docs/changelog.xml |   5 +
 3 files changed, 16 insertions(+), 137 deletions(-)

diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java 
b/java/org/apache/catalina/servlets/WebdavServlet.java
index 57c1b56021..9fec057e5a 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -16,6 +16,7 @@
  */
 package org.apache.catalina.servlets;
 
+import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Serializable;
@@ -222,16 +223,6 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 private final ConcurrentHashMap resourceLocks = new 
ConcurrentHashMap<>();
 
 
-/**
- * Repository of the lock-null resources.
- * 
- * Key : path of the collection containing the lock-null resource
- * Value : List of lock-null resource which are members of the collection. 
Each element of the List is the path
- * associated with the lock-null resource.
- */
-private final ConcurrentHashMap> 
lockNullResources = new ConcurrentHashMap<>();
-
-
 /**
  * List of the inheritable collection locks.
  */
@@ -295,7 +286,6 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 for (LockInfo currentLock : resourceLocks.values()) {
 if (currentLock.hasExpired()) {
 resourceLocks.remove(currentLock.path);
-removeLockNull(currentLock.path);
 }
 }
 Iterator collectionLocksIterator = 
collectionLocks.iterator();
@@ -303,7 +293,6 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 LockInfo currentLock = collectionLocksIterator.next();
 if (currentLock.hasExpired()) {
 collectionLocksIterator.remove();
-removeLockNull(currentLock.path);
 }
 }
 }
@@ -568,30 +557,6 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 return;
 }
 
-if (!resource.exists()) {
-int slash = path.lastIndexOf('/');
-if (slash != -1) {
-String parentPath = path.substring(0, slash);
-List currentLockNullResources = 
lockNullResources.get(parentPath);
-if (currentLockNullResources != null) {
-for (String lockNullPath : currentLockNullResources) {
-if (lockNullPath.equals(path)) {
-resp.setStatus(WebdavStatus.SC_MULTI_STATUS);
-resp.setContentType("text/xml; charset=UTF-8");
-// Create multistatus object
-XMLWriter generatedXML = new 
XMLWriter(resp.getWriter());
-generatedXML.writeXMLHeader();
-generatedXML.writeElement("D", DEFAULT_NAMESPACE, 
"multistatus", XMLWriter.OPENING);
-parseLockNullProperties(req, generatedXML, 
lockNullPath, type, properties);
-generatedXML.writeElement("D", "multistatus", 
XMLWriter.CLOSING);
-generatedXML.sendData();
-return;
-}
-}
-}
-}
-}
-
 if (!resource.exists()) {
 resp.sendError(HttpServletResponse.SC_NOT_FOUND);
 return;
@@ -636,18 +601,6 @@ public class WebdavServlet extends DefaultServlet 
implements PeriodicEventListen
 stackBelow.addFirst(newPath);
 }
 
-// Displaying the lock-null resources present in that
-// collection
-String lockPath = currentPath;
- 

Re: [PR] BZ69355: ExactRateLimiter [tomcat]

2024-10-17 Thread via GitHub


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

   @markt-asf any news?


-- 
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] Initial suport for Tomact9 - Tc9.x [tomcat-maven-plugin]

2024-10-17 Thread via GitHub


gilbertoca commented on PR #43:
URL: 
https://github.com/apache/tomcat-maven-plugin/pull/43#issuecomment-2419333052

   @rmaucher what about incorporate those changes, tag then for use only up to 
jdk11 and Java EE 8, release as is?
   So, after this, I will try to create a PR taking into account your third 
advise and change the repo to jdk11/17 and Jakarta 10?


-- 
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] BZ69355: ExactRateLimiter [tomcat]

2024-10-17 Thread via GitHub


Chenjp closed pull request #760: BZ69355:  ExactRateLimiter
URL: https://github.com/apache/tomcat/pull/760


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



[PR] BZ69355: ExactRateLimiter [tomcat]

2024-10-17 Thread via GitHub


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

   replace #760: redo pr , change src branche from "main" to  a dedicated 
branch "main_BZ69355".
   for headers section, compliance with draft spec of 
"https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers ".
   comparing with no-ratelimit / or fast-ratelimiter, ab test of 
exact-ratelimiter performance shows that no significant throughout decrease 
(about -2% / -1%).


-- 
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 69399] Tag.release() called between reuses

2024-10-17 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69399

--- Comment #5 from Luis Irwin  ---
Before fix (?) for bug 69333
(https://github.com/apache/tomcat/commit/4e16d8e30d2215ca9680edfa29feeaef5e26e91f#diff-bfcdd8b656071a9d6eb18bf8414b7daae9d5ab6243adaba16dbcefb808f0487f
https://geometry-dashworld.co/), JspRuntimeLibrary.releaseTag was called IFF
pooling was disabled (and also when pooling was enabled but TagHandlerPool
saturated to be precise). It was _not_ called when ${tagHandlerVar}._reused was
set to true but _was_ called when polling was disabled. Now it is the exact
opposite: it is called when polling is enabled and not called when it is
disabled. Something seems to be wrong.

According to
https://docs.oracle.com/javaee/7/api/javax/servlet/jsp/tagext/Tag.html:
"The page compiler guarantees that release() will be invoked on the Tag handler
before the handler is released to the GC."

Maybe this fix was supposed to produce something like

if (usePooling(n)) {
// Print tag reuse
out.printin(n.getTagHandlerPoolName());
out.print(".reuse(");
out.print(tagHandlerVar);
out.println(");");
} else {
// Clean-up
out.printin("org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(");
out.print(tagHandlerVar);
out.println(", _jsp_getInstanceManager());");
}

instead of

if (usePooling(n)) {
// Print tag reuse
out.printin(n.getTagHandlerPoolName());
out.print(".reuse(");
out.print(tagHandlerVar);
out.println(");");

// Clean-up
out.printin("org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(");
out.print(tagHandlerVar);
out.println(", _jsp_getInstanceManager());");
}

?

We've encountered this because some of the tags we use do setup some state in
constructor and clean that up in release(). Tag reuse is then obviously
impossible, as it's state is irreversibly broken.

Please let me know if I can help (including PR).

RESOLVED?

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