[tomcat] 03/04: Add changelog

2020-04-27 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

commit 82598ebce058be73432bf8d118023a55f682669b
Author: remm 
AuthorDate: Tue Apr 28 00:36:10 2020 +0200

Add changelog
---
 webapps/docs/changelog.xml | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 474a727..a8a5930 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -81,10 +81,14 @@
 Sakhare. (markt)
   
   
-64309; Improve the regular expression used to search for
+64309: Improve the regular expression used to search for
 class loader repositories when bootstrapping Tomcat. Pull request
 provided by Paul Muriel Biya-Bi. (markt)
   
+  
+64384: Fix multipart configuration ignoring some parameters
+in some cases. (schultz)
+  
 
   
   


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



[tomcat] 02/04: Fix validate

2020-04-27 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

commit f98c1049e3803d355fbb78355a61bc27451933db
Author: remm 
AuthorDate: Tue Apr 28 00:33:00 2020 +0200

Fix validate
---
 .../catalina/startup/TestMultipartConfig.java   | 21 +++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/catalina/startup/TestMultipartConfig.java 
b/test/org/apache/catalina/startup/TestMultipartConfig.java
index d0ca905..986edb4 100644
--- a/test/org/apache/catalina/startup/TestMultipartConfig.java
+++ b/test/org/apache/catalina/startup/TestMultipartConfig.java
@@ -1,9 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.catalina.startup;
 
 import java.lang.reflect.Method;
 
 import jakarta.servlet.MultipartConfigElement;
 
+import org.junit.Assert;
+import org.junit.Test;
+
 import org.apache.catalina.Container;
 import org.apache.catalina.Context;
 import org.apache.catalina.LifecycleState;
@@ -16,8 +35,6 @@ import org.apache.catalina.core.StandardWrapper;
 import org.apache.tomcat.util.descriptor.web.MultipartDef;
 import org.apache.tomcat.util.descriptor.web.ServletDef;
 import org.apache.tomcat.util.descriptor.web.WebXml;
-import org.junit.Assert;
-import org.junit.Test;
 
 public class TestMultipartConfig {
 @Test


-
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 (59bd13c -> 1871935)

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

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


from 59bd13c  Fix bz 64373. Ensure tag file unpacked from WAR can be found.
 new 13de9aa  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=64384
 new f98c104  Fix validate
 new 82598eb  Add changelog
 new 1871935  Use javax for 9

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/catalina/startup/ContextConfig.java |  30 ++--
 .../catalina/startup/TestMultipartConfig.java  | 188 +
 webapps/docs/changelog.xml |   6 +-
 3 files changed, 211 insertions(+), 13 deletions(-)
 create mode 100644 test/org/apache/catalina/startup/TestMultipartConfig.java


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



[tomcat] 04/04: Use javax for 9

2020-04-27 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

commit 187193585dceaaae06839c024e5c760e2b6f12ee
Author: remm 
AuthorDate: Tue Apr 28 00:39:43 2020 +0200

Use javax for 9
---
 test/org/apache/catalina/startup/TestMultipartConfig.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/startup/TestMultipartConfig.java 
b/test/org/apache/catalina/startup/TestMultipartConfig.java
index 986edb4..c152255 100644
--- a/test/org/apache/catalina/startup/TestMultipartConfig.java
+++ b/test/org/apache/catalina/startup/TestMultipartConfig.java
@@ -18,7 +18,7 @@ package org.apache.catalina.startup;
 
 import java.lang.reflect.Method;
 
-import jakarta.servlet.MultipartConfigElement;
+import javax.servlet.MultipartConfigElement;
 
 import org.junit.Assert;
 import org.junit.Test;


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



[tomcat] 01/04: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=64384

2020-04-27 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

commit 13de9aa412237a42512cc6e0ae57254665ae539f
Author: Christopher Schultz 
AuthorDate: Mon Apr 27 18:01:00 2020 -0400

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

Respect partial multipart-config elements.
---
 .../org/apache/catalina/startup/ContextConfig.java |  30 ++--
 .../catalina/startup/TestMultipartConfig.java  | 171 +
 2 files changed, 189 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/catalina/startup/ContextConfig.java 
b/java/org/apache/catalina/startup/ContextConfig.java
index fe8c87d..0f29773 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -1354,19 +1354,25 @@ public class ContextConfig implements LifecycleListener 
{
 wrapper.setServletClass(servlet.getServletClass());
 MultipartDef multipartdef = servlet.getMultipartDef();
 if (multipartdef != null) {
-if (multipartdef.getMaxFileSize() != null &&
-multipartdef.getMaxRequestSize()!= null &&
-multipartdef.getFileSizeThreshold() != null) {
-wrapper.setMultipartConfigElement(new 
MultipartConfigElement(
-multipartdef.getLocation(),
-Long.parseLong(multipartdef.getMaxFileSize()),
-Long.parseLong(multipartdef.getMaxRequestSize()),
-Integer.parseInt(
-multipartdef.getFileSizeThreshold(;
-} else {
-wrapper.setMultipartConfigElement(new 
MultipartConfigElement(
-multipartdef.getLocation()));
+long maxFileSize = -1;
+long maxRequestSize = -1;
+int fileSizeThreshold = 0;
+
+if(null != multipartdef.getMaxFileSize()) {
+maxFileSize = 
Long.parseLong(multipartdef.getMaxFileSize());
+}
+if(null != multipartdef.getMaxRequestSize()) {
+maxRequestSize = 
Long.parseLong(multipartdef.getMaxRequestSize());
 }
+if(null != multipartdef.getFileSizeThreshold()) {
+fileSizeThreshold = 
Integer.parseInt(multipartdef.getFileSizeThreshold());
+}
+
+wrapper.setMultipartConfigElement(new MultipartConfigElement(
+multipartdef.getLocation(),
+maxFileSize,
+maxRequestSize,
+fileSizeThreshold));
 }
 if (servlet.getAsyncSupported() != null) {
 wrapper.setAsyncSupported(
diff --git a/test/org/apache/catalina/startup/TestMultipartConfig.java 
b/test/org/apache/catalina/startup/TestMultipartConfig.java
new file mode 100644
index 000..d0ca905
--- /dev/null
+++ b/test/org/apache/catalina/startup/TestMultipartConfig.java
@@ -0,0 +1,171 @@
+package org.apache.catalina.startup;
+
+import java.lang.reflect.Method;
+
+import jakarta.servlet.MultipartConfigElement;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.Context;
+import org.apache.catalina.LifecycleState;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.core.StandardEngine;
+import org.apache.catalina.core.StandardHost;
+import org.apache.catalina.core.StandardService;
+import org.apache.catalina.core.StandardWrapper;
+import org.apache.tomcat.util.descriptor.web.MultipartDef;
+import org.apache.tomcat.util.descriptor.web.ServletDef;
+import org.apache.tomcat.util.descriptor.web.WebXml;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestMultipartConfig {
+@Test
+public void testNoMultipartConfig() throws Exception {
+StandardWrapper servlet =  config(null);
+
+MultipartConfigElement mce = servlet.getMultipartConfigElement();
+
+Assert.assertNull(mce);
+}
+
+@Test
+public void testDefaultMultipartConfig() throws Exception {
+MultipartDef multipartDef = new MultipartDef();
+// Do not set any attributes on multipartDef: expect defaults
+
+StandardWrapper servlet =  config(multipartDef);
+MultipartConfigElement mce = servlet.getMultipartConfigElement();
+
+Assert.assertNotNull(mce);
+Assert.assertEquals("", mce.getLocation());
+Assert.assertEquals(-1, mce.getMaxFileSize());
+Assert.assertEquals(-1, mce.getMaxRequestSize());
+Assert.assertEquals(0, mce.getFileSizeThreshold());
+}
+
+@Test
+public void testPartialMultipartConfigMaxFileSize() throws Exception {
+MultipartDef multipartDef = new 

Re: git-fu is (still) weak

2020-04-27 Thread Rémy Maucherat
On Tue, Apr 28, 2020 at 12:21 AM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> All,
>
> I tried again to commit to tc10 branch, got commit id
> 8dddc11512fbd3b91ed9d737a42e4b8415458ddf.
>
> Moving to tc9 branch:
>
> $ git cherry-pick -n 8dddc11512fbd3b91ed9d737a42e4b8415458ddf
> fatal: bad object 8dddc11512fbd3b91ed9d737a42e4b8415458ddf
>
> - From tc10:
>
> $ git remote -v
> origin  https://github.com/apache/tomcat (fetch)
> origin  https://github.com/apache/tomcat (push)
>
> - From tc9.0.x:
>
> $ git remote -v
> origin  https://github.com/apache/tomcat (fetch)
> origin  https://github.com/apache/tomcat (push)
>
> My 9.0.x local is all up-to-date with github, and github can see the
> commit in tc10.
>
> Other than manually handing the diffs myself, I have no idea what to
> do, next. :(
>

I tried and it looked "ok" to me.

Rémy


>
> - -chris
>
> On 2/24/20 11:33, Christopher Schultz wrote:
> > All,
> >
> > I'm trying to cherry-pick a commit. The commit went through
> > github, merged a PR from a contributor into master. I'm trying to
> > cherry-pick it back into the 9.0.x branch:
> >
> > $ git cherry-pick f124a9c7230227d3eaff9d2dc1c52f82ce10e03f error:
> > commit f124a9c7230227d3eaff9d2dc1c52f82ce10e03f is a merge but no
> > -m option was given. fatal: cherry-pick failed
> >
> > ??
> >
> > My local copy is all up-to-date, no weird local changes or
> > anything like that. What is a "merge", here? Supplying "-m" doesn't
> > like the commit id.
> >
> > Any ideas?
> >
> > -chris
> >
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl6nWssACgkQHPApP6U8
> pFgE0RAAkCCN0ai+byJh3TGyQRWGP1WTUc92UO7kbVCFiJTe/1s6XtUOwPguiJ87
> rbIAZRsKDefVJVZguad6mXQEkQEnAXQF3w5TvLt8abGbOKi1z4UG+ONwHdptwQfZ
> 83vIexa4mV2yw45mpTPqYIZ16eke41x+YV1cZea0iEqp7eQ12HN71je7E0HzEGFN
> lDCf+sBHGjBeJ63LSsZ/hIU+LoWgmGBmc0j9GK1UlsL0LhpH6Cz/dXoyqsCxIXl4
> 3BIP5FmSK+3d+f5ciVUrAQJCH6SF0yYEx4+JtUVIUl1lJN5OwvZsyhnHHX4OqiHg
> Qp0Zx7h8+mj83MAwZDDyyNcABoF4hyrEMoS9w/I2+zCNrs7RGZGKqvZRIwR2IhCR
> rdhfTisc9nkmwZhg+Yt485l0m/IOO/XNqijZ8O4oxUz14BmDHrUoIYlnT3BEKe4q
> 7roZpz78JmcCDlFDkEcvaZKJ68vww0CFZsoWXTGDCZuckJQaAOz6Jf9470g2Y79/
> WHtxmBtLNimexrbLN4COYsVoPQbk1X1xGhi2fYqyMNjVGV2cqdOo2I+VAurfRhnh
> wpoLzN2mNh0qi23pdyrRsSyRB/KdAszVa2fjIR7WD74AamNy/CzMrydx0b2OpB8k
> UbQ/uRuFR7q7jm5N2d0fELMWRPV03RcQ9iIFxtvPE0kGLLvyjm4=
> =LDJJ
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


[tomcat] 01/04: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=64384

2020-04-27 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

commit 56f21b8654260291d1e088016ab1145779c3329c
Author: Christopher Schultz 
AuthorDate: Mon Apr 27 18:01:00 2020 -0400

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

Respect partial multipart-config elements.
---
 .../org/apache/catalina/startup/ContextConfig.java |  30 ++--
 .../catalina/startup/TestMultipartConfig.java  | 171 +
 2 files changed, 189 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/catalina/startup/ContextConfig.java 
b/java/org/apache/catalina/startup/ContextConfig.java
index 82db594..252912b 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -1362,19 +1362,25 @@ public class ContextConfig implements LifecycleListener 
{
 wrapper.setServletClass(servlet.getServletClass());
 MultipartDef multipartdef = servlet.getMultipartDef();
 if (multipartdef != null) {
-if (multipartdef.getMaxFileSize() != null &&
-multipartdef.getMaxRequestSize()!= null &&
-multipartdef.getFileSizeThreshold() != null) {
-wrapper.setMultipartConfigElement(new 
MultipartConfigElement(
-multipartdef.getLocation(),
-Long.parseLong(multipartdef.getMaxFileSize()),
-Long.parseLong(multipartdef.getMaxRequestSize()),
-Integer.parseInt(
-multipartdef.getFileSizeThreshold(;
-} else {
-wrapper.setMultipartConfigElement(new 
MultipartConfigElement(
-multipartdef.getLocation()));
+long maxFileSize = -1;
+long maxRequestSize = -1;
+int fileSizeThreshold = 0;
+
+if(null != multipartdef.getMaxFileSize()) {
+maxFileSize = 
Long.parseLong(multipartdef.getMaxFileSize());
+}
+if(null != multipartdef.getMaxRequestSize()) {
+maxRequestSize = 
Long.parseLong(multipartdef.getMaxRequestSize());
 }
+if(null != multipartdef.getFileSizeThreshold()) {
+fileSizeThreshold = 
Integer.parseInt(multipartdef.getFileSizeThreshold());
+}
+
+wrapper.setMultipartConfigElement(new MultipartConfigElement(
+multipartdef.getLocation(),
+maxFileSize,
+maxRequestSize,
+fileSizeThreshold));
 }
 if (servlet.getAsyncSupported() != null) {
 wrapper.setAsyncSupported(
diff --git a/test/org/apache/catalina/startup/TestMultipartConfig.java 
b/test/org/apache/catalina/startup/TestMultipartConfig.java
new file mode 100644
index 000..d0ca905
--- /dev/null
+++ b/test/org/apache/catalina/startup/TestMultipartConfig.java
@@ -0,0 +1,171 @@
+package org.apache.catalina.startup;
+
+import java.lang.reflect.Method;
+
+import jakarta.servlet.MultipartConfigElement;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.Context;
+import org.apache.catalina.LifecycleState;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.core.StandardEngine;
+import org.apache.catalina.core.StandardHost;
+import org.apache.catalina.core.StandardService;
+import org.apache.catalina.core.StandardWrapper;
+import org.apache.tomcat.util.descriptor.web.MultipartDef;
+import org.apache.tomcat.util.descriptor.web.ServletDef;
+import org.apache.tomcat.util.descriptor.web.WebXml;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestMultipartConfig {
+@Test
+public void testNoMultipartConfig() throws Exception {
+StandardWrapper servlet =  config(null);
+
+MultipartConfigElement mce = servlet.getMultipartConfigElement();
+
+Assert.assertNull(mce);
+}
+
+@Test
+public void testDefaultMultipartConfig() throws Exception {
+MultipartDef multipartDef = new MultipartDef();
+// Do not set any attributes on multipartDef: expect defaults
+
+StandardWrapper servlet =  config(multipartDef);
+MultipartConfigElement mce = servlet.getMultipartConfigElement();
+
+Assert.assertNotNull(mce);
+Assert.assertEquals("", mce.getLocation());
+Assert.assertEquals(-1, mce.getMaxFileSize());
+Assert.assertEquals(-1, mce.getMaxRequestSize());
+Assert.assertEquals(0, mce.getFileSizeThreshold());
+}
+
+@Test
+public void testPartialMultipartConfigMaxFileSize() throws Exception {
+MultipartDef multipartDef = new 

[tomcat] 03/04: Add changelog

2020-04-27 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

commit 24439fa833e41a1545750731f051210e181759c5
Author: remm 
AuthorDate: Tue Apr 28 00:36:10 2020 +0200

Add changelog
---
 webapps/docs/changelog.xml | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 7d04a52..4d3dbf1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -79,10 +79,14 @@
 Sakhare. (markt)
   
   
-64309; Improve the regular expression used to search for
+64309: Improve the regular expression used to search for
 class loader repositories when bootstrapping Tomcat. Pull request
 provided by Paul Muriel Biya-Bi. (markt)
   
+  
+64384: Fix multipart configuration ignoring some parameters
+in some cases. (schultz)
+  
 
   
   


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



[tomcat] 04/04: Use javax for 9

2020-04-27 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

commit e928ee579285a5f9cbf446658da46e6f072fd55a
Author: remm 
AuthorDate: Tue Apr 28 00:39:43 2020 +0200

Use javax for 9
---
 test/org/apache/catalina/startup/TestMultipartConfig.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/startup/TestMultipartConfig.java 
b/test/org/apache/catalina/startup/TestMultipartConfig.java
index 986edb4..c152255 100644
--- a/test/org/apache/catalina/startup/TestMultipartConfig.java
+++ b/test/org/apache/catalina/startup/TestMultipartConfig.java
@@ -18,7 +18,7 @@ package org.apache.catalina.startup;
 
 import java.lang.reflect.Method;
 
-import jakarta.servlet.MultipartConfigElement;
+import javax.servlet.MultipartConfigElement;
 
 import org.junit.Assert;
 import org.junit.Test;


-
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 (d361c6e -> e928ee5)

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

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


from d361c6e  Fix bz 64373. Ensure tag file unpacked from WAR can be found.
 new 56f21b8  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=64384
 new 8455a25  Fix validate
 new 24439fa  Add changelog
 new e928ee5  Use javax for 9

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/catalina/startup/ContextConfig.java |  30 ++--
 .../catalina/startup/TestMultipartConfig.java  | 188 +
 webapps/docs/changelog.xml |   6 +-
 3 files changed, 211 insertions(+), 13 deletions(-)
 create mode 100644 test/org/apache/catalina/startup/TestMultipartConfig.java


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



[tomcat] 02/04: Fix validate

2020-04-27 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

commit 8455a251d2d077d1aaa58458acbf360851570ce7
Author: remm 
AuthorDate: Tue Apr 28 00:33:00 2020 +0200

Fix validate
---
 .../catalina/startup/TestMultipartConfig.java   | 21 +++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/catalina/startup/TestMultipartConfig.java 
b/test/org/apache/catalina/startup/TestMultipartConfig.java
index d0ca905..986edb4 100644
--- a/test/org/apache/catalina/startup/TestMultipartConfig.java
+++ b/test/org/apache/catalina/startup/TestMultipartConfig.java
@@ -1,9 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.catalina.startup;
 
 import java.lang.reflect.Method;
 
 import jakarta.servlet.MultipartConfigElement;
 
+import org.junit.Assert;
+import org.junit.Test;
+
 import org.apache.catalina.Container;
 import org.apache.catalina.Context;
 import org.apache.catalina.LifecycleState;
@@ -16,8 +35,6 @@ import org.apache.catalina.core.StandardWrapper;
 import org.apache.tomcat.util.descriptor.web.MultipartDef;
 import org.apache.tomcat.util.descriptor.web.ServletDef;
 import org.apache.tomcat.util.descriptor.web.WebXml;
-import org.junit.Assert;
-import org.junit.Test;
 
 public class TestMultipartConfig {
 @Test


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



[tomcat] branch master updated: Add changelog

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 788a657  Add changelog
788a657 is described below

commit 788a6573f7a867703b536c6941a361022a8ea0a1
Author: remm 
AuthorDate: Tue Apr 28 00:36:10 2020 +0200

Add changelog
---
 webapps/docs/changelog.xml | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 7058fd2..be7691e 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -94,10 +94,14 @@
 (michaelo)
   
   
-64309; Improve the regular expression used to search for
+64309: Improve the regular expression used to search for
 class loader repositories when bootstrapping Tomcat. Pull request
 provided by Paul Muriel Biya-Bi. (markt)
   
+  
+64384: Fix multipart configuration ignoring some parameters
+in some cases. (schultz)
+  
 
   
   


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



[tomcat] branch master updated: Fix validate

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 5860d32  Fix validate
5860d32 is described below

commit 5860d32afe0a7f44927edf87273d198bf0a9824c
Author: remm 
AuthorDate: Tue Apr 28 00:33:00 2020 +0200

Fix validate
---
 .../catalina/startup/TestMultipartConfig.java   | 21 +++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/catalina/startup/TestMultipartConfig.java 
b/test/org/apache/catalina/startup/TestMultipartConfig.java
index d0ca905..986edb4 100644
--- a/test/org/apache/catalina/startup/TestMultipartConfig.java
+++ b/test/org/apache/catalina/startup/TestMultipartConfig.java
@@ -1,9 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.catalina.startup;
 
 import java.lang.reflect.Method;
 
 import jakarta.servlet.MultipartConfigElement;
 
+import org.junit.Assert;
+import org.junit.Test;
+
 import org.apache.catalina.Container;
 import org.apache.catalina.Context;
 import org.apache.catalina.LifecycleState;
@@ -16,8 +35,6 @@ import org.apache.catalina.core.StandardWrapper;
 import org.apache.tomcat.util.descriptor.web.MultipartDef;
 import org.apache.tomcat.util.descriptor.web.ServletDef;
 import org.apache.tomcat.util.descriptor.web.WebXml;
-import org.junit.Assert;
-import org.junit.Test;
 
 public class TestMultipartConfig {
 @Test


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



buildbot success in on tomcat-trunk

2020-04-27 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/5145

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] 8dddc11512fbd3b91ed9d737a42e4b8415458ddf
Blamelist: Christopher Schultz 

Build succeeded!

Sincerely,
 -The Buildbot




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



Re: git-fu is (still) weak

2020-04-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

All,

I tried again to commit to tc10 branch, got commit id
8dddc11512fbd3b91ed9d737a42e4b8415458ddf.

Moving to tc9 branch:

$ git cherry-pick -n 8dddc11512fbd3b91ed9d737a42e4b8415458ddf
fatal: bad object 8dddc11512fbd3b91ed9d737a42e4b8415458ddf

- From tc10:

$ git remote -v
origin  https://github.com/apache/tomcat (fetch)
origin  https://github.com/apache/tomcat (push)

- From tc9.0.x:

$ git remote -v
origin  https://github.com/apache/tomcat (fetch)
origin  https://github.com/apache/tomcat (push)

My 9.0.x local is all up-to-date with github, and github can see the
commit in tc10.

Other than manually handing the diffs myself, I have no idea what to
do, next. :(

- -chris

On 2/24/20 11:33, Christopher Schultz wrote:
> All,
>
> I'm trying to cherry-pick a commit. The commit went through
> github, merged a PR from a contributor into master. I'm trying to
> cherry-pick it back into the 9.0.x branch:
>
> $ git cherry-pick f124a9c7230227d3eaff9d2dc1c52f82ce10e03f error:
> commit f124a9c7230227d3eaff9d2dc1c52f82ce10e03f is a merge but no
> -m option was given. fatal: cherry-pick failed
>
> ??
>
> My local copy is all up-to-date, no weird local changes or
> anything like that. What is a "merge", here? Supplying "-m" doesn't
> like the commit id.
>
> Any ideas?
>
> -chris
>
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl6nWssACgkQHPApP6U8
pFgE0RAAkCCN0ai+byJh3TGyQRWGP1WTUc92UO7kbVCFiJTe/1s6XtUOwPguiJ87
rbIAZRsKDefVJVZguad6mXQEkQEnAXQF3w5TvLt8abGbOKi1z4UG+ONwHdptwQfZ
83vIexa4mV2yw45mpTPqYIZ16eke41x+YV1cZea0iEqp7eQ12HN71je7E0HzEGFN
lDCf+sBHGjBeJ63LSsZ/hIU+LoWgmGBmc0j9GK1UlsL0LhpH6Cz/dXoyqsCxIXl4
3BIP5FmSK+3d+f5ciVUrAQJCH6SF0yYEx4+JtUVIUl1lJN5OwvZsyhnHHX4OqiHg
Qp0Zx7h8+mj83MAwZDDyyNcABoF4hyrEMoS9w/I2+zCNrs7RGZGKqvZRIwR2IhCR
rdhfTisc9nkmwZhg+Yt485l0m/IOO/XNqijZ8O4oxUz14BmDHrUoIYlnT3BEKe4q
7roZpz78JmcCDlFDkEcvaZKJ68vww0CFZsoWXTGDCZuckJQaAOz6Jf9470g2Y79/
WHtxmBtLNimexrbLN4COYsVoPQbk1X1xGhi2fYqyMNjVGV2cqdOo2I+VAurfRhnh
wpoLzN2mNh0qi23pdyrRsSyRB/KdAszVa2fjIR7WD74AamNy/CzMrydx0b2OpB8k
UbQ/uRuFR7q7jm5N2d0fELMWRPV03RcQ9iIFxtvPE0kGLLvyjm4=
=LDJJ
-END PGP SIGNATURE-

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



[Bug 64384] is ignored if any of max-file-size/max-request-size/file-threshold-size elements are missing

2020-04-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64384

Christopher Schultz  changed:

   What|Removed |Added

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

--- Comment #7 from Christopher Schultz  ---
Fixed in trunk (tc10) in commit 8dddc11512fbd3b91ed9d737a42e4b8415458ddf

Working on my git-fu to back-port to other supported branches.

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



[tomcat] branch master updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=64384

2020-04-27 Thread schultz
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 8dddc11  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=64384
8dddc11 is described below

commit 8dddc11512fbd3b91ed9d737a42e4b8415458ddf
Author: Christopher Schultz 
AuthorDate: Mon Apr 27 18:01:00 2020 -0400

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

Respect partial multipart-config elements.
---
 .../org/apache/catalina/startup/ContextConfig.java |  30 ++--
 .../catalina/startup/TestMultipartConfig.java  | 171 +
 2 files changed, 189 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/catalina/startup/ContextConfig.java 
b/java/org/apache/catalina/startup/ContextConfig.java
index 2f3ebd0..18517e2 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -1362,19 +1362,25 @@ public class ContextConfig implements LifecycleListener 
{
 wrapper.setServletClass(servlet.getServletClass());
 MultipartDef multipartdef = servlet.getMultipartDef();
 if (multipartdef != null) {
-if (multipartdef.getMaxFileSize() != null &&
-multipartdef.getMaxRequestSize()!= null &&
-multipartdef.getFileSizeThreshold() != null) {
-wrapper.setMultipartConfigElement(new 
MultipartConfigElement(
-multipartdef.getLocation(),
-Long.parseLong(multipartdef.getMaxFileSize()),
-Long.parseLong(multipartdef.getMaxRequestSize()),
-Integer.parseInt(
-multipartdef.getFileSizeThreshold(;
-} else {
-wrapper.setMultipartConfigElement(new 
MultipartConfigElement(
-multipartdef.getLocation()));
+long maxFileSize = -1;
+long maxRequestSize = -1;
+int fileSizeThreshold = 0;
+
+if(null != multipartdef.getMaxFileSize()) {
+maxFileSize = 
Long.parseLong(multipartdef.getMaxFileSize());
+}
+if(null != multipartdef.getMaxRequestSize()) {
+maxRequestSize = 
Long.parseLong(multipartdef.getMaxRequestSize());
 }
+if(null != multipartdef.getFileSizeThreshold()) {
+fileSizeThreshold = 
Integer.parseInt(multipartdef.getFileSizeThreshold());
+}
+
+wrapper.setMultipartConfigElement(new MultipartConfigElement(
+multipartdef.getLocation(),
+maxFileSize,
+maxRequestSize,
+fileSizeThreshold));
 }
 if (servlet.getAsyncSupported() != null) {
 wrapper.setAsyncSupported(
diff --git a/test/org/apache/catalina/startup/TestMultipartConfig.java 
b/test/org/apache/catalina/startup/TestMultipartConfig.java
new file mode 100644
index 000..d0ca905
--- /dev/null
+++ b/test/org/apache/catalina/startup/TestMultipartConfig.java
@@ -0,0 +1,171 @@
+package org.apache.catalina.startup;
+
+import java.lang.reflect.Method;
+
+import jakarta.servlet.MultipartConfigElement;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.Context;
+import org.apache.catalina.LifecycleState;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.core.StandardEngine;
+import org.apache.catalina.core.StandardHost;
+import org.apache.catalina.core.StandardService;
+import org.apache.catalina.core.StandardWrapper;
+import org.apache.tomcat.util.descriptor.web.MultipartDef;
+import org.apache.tomcat.util.descriptor.web.ServletDef;
+import org.apache.tomcat.util.descriptor.web.WebXml;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestMultipartConfig {
+@Test
+public void testNoMultipartConfig() throws Exception {
+StandardWrapper servlet =  config(null);
+
+MultipartConfigElement mce = servlet.getMultipartConfigElement();
+
+Assert.assertNull(mce);
+}
+
+@Test
+public void testDefaultMultipartConfig() throws Exception {
+MultipartDef multipartDef = new MultipartDef();
+// Do not set any attributes on multipartDef: expect defaults
+
+StandardWrapper servlet =  config(multipartDef);
+MultipartConfigElement mce = servlet.getMultipartConfigElement();
+
+Assert.assertNotNull(mce);
+Assert.assertEquals("", mce.getLocation());
+Assert.assertEquals(-1, mce.getMaxFileSize());
+Assert.assertEquals(-1, mce.getMaxRequestSize());
+

[Bug 64373] tag-file reference from .tld in /WEB-INF/classes/META-INF cannot be resolved

2020-04-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64373

--- Comment #3 from Karl von Randow  ---
That's fantastic, thank you very much Mark.

-- 
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 64384] is ignored if any of max-file-size/max-request-size/file-threshold-size elements are missing

2020-04-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64384

--- Comment #6 from Christopher Schultz  ---
Initial testing indicates this patch is correct.

I'll commit once I build a proper test-case.

My guess is that this will not affect uses of @MultipartConfig annotation, as
this bug occurs when copying the web.xml config to the live servlet (wrapper)
object.

Temporary workaround for anyone observing lack of : Make sure
to specify all of max-file-size, max-request-size, file-size-threshold

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



Re: [VOTE] Release Apache Tomcat Native 1.2.24

2020-04-27 Thread Michael Osipov

Am 2020-04-24 um 22:10 schrieb Mark Thomas:

Version 1.2.24 includes the following changes compared to 1.2.23

- Various improvements to the build process related to OpenSSL

- Windows binaries built with OpenSSL 1.1.1g

Various other fixes and improvements. See the changelog for details.

The proposed release artefacts can be found at [1],
and the build was done using tag [2].

The Apache Tomcat Native 1.2.24 release is
  [ ] Stable, go ahead and release


Stable for me.

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



[Bug 64373] tag-file reference from .tld in /WEB-INF/classes/META-INF cannot be resolved

2020-04-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64373

Mark Thomas  changed:

   What|Removed |Added

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

--- Comment #2 from Mark Thomas  ---
Many thanks for the report and the patch. Your analysis looks to be spot on to
me.

Fixed in:
- master for 10.0.0-M5 onwards
- 9.0.x for 9.0.35 onwards
- 8.5.x for 8.5.55 onwards

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



buildbot failure in on tomcat-trunk

2020-04-27 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-trunk while building 
tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/5144

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] 224fb6c06528180213b6af28b28dee44029565d7
Blamelist: Mark Thomas 

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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



[tomcat] branch 8.5.x updated: Fix bz 64373. Ensure tag file unpacked from WAR can be found.

2020-04-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 59bd13c  Fix bz 64373. Ensure tag file unpacked from WAR can be found.
59bd13c is described below

commit 59bd13c7b0d9360176f9a29e8fbece26d99388f4
Author: Mark Thomas 
AuthorDate: Mon Apr 27 19:34:25 2020 +0100

Fix bz 64373. Ensure tag file unpacked from WAR can be found.

Fixes https://bz.apache.org/bugzilla/show_bug.cgi?id=64373
Patch provided by Karl von Randow
---
 .../apache/jasper/compiler/TagLibraryInfoImpl.java |  8 ++
 .../jasper/compiler/TestTagLibraryInfoImpl.java| 15 +++
 test/webapp/WEB-INF/classes/META-INF/bug64373.tld  | 31 ++
 .../WEB-INF/classes/META-INF/tags/bug64373.tag | 17 
 test/webapp/bug6/bug64373.jsp  | 23 
 webapps/docs/changelog.xml |  5 
 6 files changed, 99 insertions(+)

diff --git a/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java 
b/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
index 50a7536..78da6d4 100644
--- a/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
+++ b/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
@@ -313,6 +313,7 @@ class TagLibraryInfoImpl extends TagLibraryInfo implements 
TagConstants {
 tagXml.hasDynamicAttributes());
 }
 
+@SuppressWarnings("null") // Impossible for path to be null at warning
 private TagFileInfo createTagFileInfo(TagFileXml tagFileXml, Jar jar) 
throws JasperException {
 
 String name = tagFileXml.getName();
@@ -325,6 +326,13 @@ class TagLibraryInfoImpl extends TagLibraryInfo implements 
TagConstants {
 err.jspError("jsp.error.tagfile.illegalPath", path);
 }
 
+if (jar == null && path.startsWith("/META-INF/tags")) {
+// This is a tag file that was packaged in a JAR that has been
+// unpacked into /WEB-INF/classes (probably by an IDE). Adjust the
+// path accordingly.
+path = "/WEB-INF/classes" + path;
+}
+
 TagInfo tagInfo =
 TagFileProcessor.parseTagFileDirectives(parserController, 
name, path, jar, this);
 return new TagFileInfo(name, path, tagInfo);
diff --git a/test/org/apache/jasper/compiler/TestTagLibraryInfoImpl.java 
b/test/org/apache/jasper/compiler/TestTagLibraryInfoImpl.java
index 88b0098..a4a6ace 100644
--- a/test/org/apache/jasper/compiler/TestTagLibraryInfoImpl.java
+++ b/test/org/apache/jasper/compiler/TestTagLibraryInfoImpl.java
@@ -40,4 +40,19 @@ public class TestTagLibraryInfoImpl extends TomcatBaseTest {
 Assert.assertEquals(HttpServletResponse.SC_OK, rc);
 }
 
+
+/*
+ * https://bz.apache.org/bugzilla/show_bug.cgi?id=64373
+ */
+@Test
+public void testTldFromExplodedWar() throws Exception {
+getTomcatInstanceTestWebapp(false, true);
+
+ByteChunk res = new ByteChunk();
+
+int rc = getUrl("http://localhost:; + getPort() +
+"/test/bug6/bug64373.jsp", res, null);
+Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+}
+
 }
diff --git a/test/webapp/WEB-INF/classes/META-INF/bug64373.tld 
b/test/webapp/WEB-INF/classes/META-INF/bug64373.tld
new file mode 100644
index 000..5fcf458
--- /dev/null
+++ b/test/webapp/WEB-INF/classes/META-INF/bug64373.tld
@@ -0,0 +1,31 @@
+
+http://java.sun.com/xml/ns/javaee;
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+  http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd;
+  version="2.1">
+  1.0
+  bug64373
+  http://tomcat.apache.org/bug64373
+
+  
+bug64373
+/META-INF/tags/bug64373.tag
+  
+
+
\ No newline at end of file
diff --git a/test/webapp/WEB-INF/classes/META-INF/tags/bug64373.tag 
b/test/webapp/WEB-INF/classes/META-INF/tags/bug64373.tag
new file mode 100644
index 000..14c713e
--- /dev/null
+++ b/test/webapp/WEB-INF/classes/META-INF/tags/bug64373.tag
@@ -0,0 +1,17 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under 

[tomcat] branch 9.0.x updated: Fix bz 64373. Ensure tag file unpacked from WAR can be found.

2020-04-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new d361c6e  Fix bz 64373. Ensure tag file unpacked from WAR can be found.
d361c6e is described below

commit d361c6ef98031954a269371f49962293d3ab4001
Author: Mark Thomas 
AuthorDate: Mon Apr 27 19:34:25 2020 +0100

Fix bz 64373. Ensure tag file unpacked from WAR can be found.

Fixes https://bz.apache.org/bugzilla/show_bug.cgi?id=64373
Patch provided by Karl von Randow
---
 .../apache/jasper/compiler/TagLibraryInfoImpl.java |  8 ++
 .../jasper/compiler/TestTagLibraryInfoImpl.java| 15 +++
 test/webapp/WEB-INF/classes/META-INF/bug64373.tld  | 31 ++
 .../WEB-INF/classes/META-INF/tags/bug64373.tag | 17 
 test/webapp/bug6/bug64373.jsp  | 23 
 webapps/docs/changelog.xml |  5 
 6 files changed, 99 insertions(+)

diff --git a/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java 
b/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
index 6abcec5..a6f952d 100644
--- a/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
+++ b/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
@@ -313,6 +313,7 @@ class TagLibraryInfoImpl extends TagLibraryInfo implements 
TagConstants {
 tagXml.hasDynamicAttributes());
 }
 
+@SuppressWarnings("null") // Impossible for path to be null at warning
 private TagFileInfo createTagFileInfo(TagFileXml tagFileXml, Jar jar) 
throws JasperException {
 
 String name = tagFileXml.getName();
@@ -325,6 +326,13 @@ class TagLibraryInfoImpl extends TagLibraryInfo implements 
TagConstants {
 err.jspError("jsp.error.tagfile.illegalPath", path);
 }
 
+if (jar == null && path.startsWith("/META-INF/tags")) {
+// This is a tag file that was packaged in a JAR that has been
+// unpacked into /WEB-INF/classes (probably by an IDE). Adjust the
+// path accordingly.
+path = "/WEB-INF/classes" + path;
+}
+
 TagInfo tagInfo =
 TagFileProcessor.parseTagFileDirectives(parserController, 
name, path, jar, this);
 return new TagFileInfo(name, path, tagInfo);
diff --git a/test/org/apache/jasper/compiler/TestTagLibraryInfoImpl.java 
b/test/org/apache/jasper/compiler/TestTagLibraryInfoImpl.java
index 88b0098..a4a6ace 100644
--- a/test/org/apache/jasper/compiler/TestTagLibraryInfoImpl.java
+++ b/test/org/apache/jasper/compiler/TestTagLibraryInfoImpl.java
@@ -40,4 +40,19 @@ public class TestTagLibraryInfoImpl extends TomcatBaseTest {
 Assert.assertEquals(HttpServletResponse.SC_OK, rc);
 }
 
+
+/*
+ * https://bz.apache.org/bugzilla/show_bug.cgi?id=64373
+ */
+@Test
+public void testTldFromExplodedWar() throws Exception {
+getTomcatInstanceTestWebapp(false, true);
+
+ByteChunk res = new ByteChunk();
+
+int rc = getUrl("http://localhost:; + getPort() +
+"/test/bug6/bug64373.jsp", res, null);
+Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+}
+
 }
diff --git a/test/webapp/WEB-INF/classes/META-INF/bug64373.tld 
b/test/webapp/WEB-INF/classes/META-INF/bug64373.tld
new file mode 100644
index 000..5fcf458
--- /dev/null
+++ b/test/webapp/WEB-INF/classes/META-INF/bug64373.tld
@@ -0,0 +1,31 @@
+
+http://java.sun.com/xml/ns/javaee;
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+  http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd;
+  version="2.1">
+  1.0
+  bug64373
+  http://tomcat.apache.org/bug64373
+
+  
+bug64373
+/META-INF/tags/bug64373.tag
+  
+
+
\ No newline at end of file
diff --git a/test/webapp/WEB-INF/classes/META-INF/tags/bug64373.tag 
b/test/webapp/WEB-INF/classes/META-INF/tags/bug64373.tag
new file mode 100644
index 000..14c713e
--- /dev/null
+++ b/test/webapp/WEB-INF/classes/META-INF/tags/bug64373.tag
@@ -0,0 +1,17 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under 

[tomcat] branch master updated: Fix bz 64373. Ensure tag file unpacked from WAR can be found.

2020-04-27 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 224fb6c  Fix bz 64373. Ensure tag file unpacked from WAR can be found.
224fb6c is described below

commit 224fb6c06528180213b6af28b28dee44029565d7
Author: Mark Thomas 
AuthorDate: Mon Apr 27 19:34:25 2020 +0100

Fix bz 64373. Ensure tag file unpacked from WAR can be found.

Fixes https://bz.apache.org/bugzilla/show_bug.cgi?id=64373
Patch provided by Karl von Randow
---
 .../apache/jasper/compiler/TagLibraryInfoImpl.java |  8 ++
 .../jasper/compiler/TestTagLibraryInfoImpl.java| 15 +++
 test/webapp/WEB-INF/classes/META-INF/bug64373.tld  | 31 ++
 .../WEB-INF/classes/META-INF/tags/bug64373.tag | 17 
 test/webapp/bug6/bug64373.jsp  | 23 
 webapps/docs/changelog.xml |  5 
 6 files changed, 99 insertions(+)

diff --git a/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java 
b/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
index 60a9522..4a284a8 100644
--- a/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
+++ b/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
@@ -313,6 +313,7 @@ class TagLibraryInfoImpl extends TagLibraryInfo implements 
TagConstants {
 tagXml.hasDynamicAttributes());
 }
 
+@SuppressWarnings("null") // Impossible for path to be null at warning
 private TagFileInfo createTagFileInfo(TagFileXml tagFileXml, Jar jar) 
throws JasperException {
 
 String name = tagFileXml.getName();
@@ -325,6 +326,13 @@ class TagLibraryInfoImpl extends TagLibraryInfo implements 
TagConstants {
 err.jspError("jsp.error.tagfile.illegalPath", path);
 }
 
+if (jar == null && path.startsWith("/META-INF/tags")) {
+// This is a tag file that was packaged in a JAR that has been
+// unpacked into /WEB-INF/classes (probably by an IDE). Adjust the
+// path accordingly.
+path = "/WEB-INF/classes" + path;
+}
+
 TagInfo tagInfo =
 TagFileProcessor.parseTagFileDirectives(parserController, 
name, path, jar, this);
 return new TagFileInfo(name, path, tagInfo);
diff --git a/test/org/apache/jasper/compiler/TestTagLibraryInfoImpl.java 
b/test/org/apache/jasper/compiler/TestTagLibraryInfoImpl.java
index 262da60..65c0ca5 100644
--- a/test/org/apache/jasper/compiler/TestTagLibraryInfoImpl.java
+++ b/test/org/apache/jasper/compiler/TestTagLibraryInfoImpl.java
@@ -40,4 +40,19 @@ public class TestTagLibraryInfoImpl extends TomcatBaseTest {
 Assert.assertEquals(HttpServletResponse.SC_OK, rc);
 }
 
+
+/*
+ * https://bz.apache.org/bugzilla/show_bug.cgi?id=64373
+ */
+@Test
+public void testTldFromExplodedWar() throws Exception {
+getTomcatInstanceTestWebapp(false, true);
+
+ByteChunk res = new ByteChunk();
+
+int rc = getUrl("http://localhost:; + getPort() +
+"/test/bug6/bug64373.jsp", res, null);
+Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+}
+
 }
diff --git a/test/webapp/WEB-INF/classes/META-INF/bug64373.tld 
b/test/webapp/WEB-INF/classes/META-INF/bug64373.tld
new file mode 100644
index 000..5fcf458
--- /dev/null
+++ b/test/webapp/WEB-INF/classes/META-INF/bug64373.tld
@@ -0,0 +1,31 @@
+
+http://java.sun.com/xml/ns/javaee;
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+  http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd;
+  version="2.1">
+  1.0
+  bug64373
+  http://tomcat.apache.org/bug64373
+
+  
+bug64373
+/META-INF/tags/bug64373.tag
+  
+
+
\ No newline at end of file
diff --git a/test/webapp/WEB-INF/classes/META-INF/tags/bug64373.tag 
b/test/webapp/WEB-INF/classes/META-INF/tags/bug64373.tag
new file mode 100644
index 000..14c713e
--- /dev/null
+++ b/test/webapp/WEB-INF/classes/META-INF/tags/bug64373.tag
@@ -0,0 +1,17 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations 

[Bug 64384] is ignored if any of max-file-size/max-request-size/file-threshold-size elements are missing

2020-04-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64384

Christopher Schultz  changed:

   What|Removed |Added

Summary| is   | is
   |ignored when there is no|ignored if any of
   |   |max-file-size/max-request-s
   |element specified   |ize/file-threshold-size
   ||elements are missing

--- Comment #5 from Christopher Schultz  ---
Updating description to reflect the fact that any missing element can cause
this.

-- 
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 64384] is ignored when there is no element specified

2020-04-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64384

--- Comment #4 from Christopher Schultz  ---
Created attachment 37199
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37199=edit
Proposed patch

-- 
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 64384] is ignored when there is no element specified

2020-04-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64384

--- Comment #3 from Christopher Schultz  ---
I think I've found the problem, at ContextConfig:1355:

1355MultipartDef multipartdef = servlet.getMultipartDef();
1356if (multipartdef != null) {
1357 if (multipartdef.getMaxFileSize() != null &&
1358multipartdef.getMaxRequestSize()!= null &&
1359multipartdef.getFileSizeThreshold() != null) {
1360wrapper.setMultipartConfigElement(new
MultipartConfigElement(
multipartdef.getLocation(),
Long.parseLong(multipartdef.getMaxFileSize()),
Long.parseLong(multipartdef.getMaxRequestSize()),
Integer.parseInt(
multipartdef.getFileSizeThreshold(;
} else {
wrapper.setMultipartConfigElement(new
MultipartConfigElement(
multipartdef.getLocation()));
}
}

When execution reaches 1355, the MultipartDef object contains the expected
values:

maxFileSize=1048576
maxRequestSize=1049600
fileSizeThreshold=null

The predicate on lines 1357 - 1359 cause this configuration to not be applied
if any of the items are missing.

The servlet spec allows any of these items to be missing, so I believe this is
a bug and spec violation together in one.

-- 
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 64373] tag-file reference from .tld in /WEB-INF/classes/META-INF cannot be resolved

2020-04-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64373

--- Comment #1 from Mark Thomas  ---
Looking at this now...

Yes, it is a spec requirement (JSP.8.4.1) that for tags packaged in a JAR the
path must always start with "/META-INF/tags/..."

-- 
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 64384] is ignored when there is no element specified

2020-04-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64384

--- Comment #2 from Remy Maucherat  ---
Ok, ok, the check here looks inaccurate:
https://github.com/apache/tomcat/blob/master/java/org/apache/catalina/startup/ContextConfig.java#L1365

Unless all are set, only the location would be used.

-- 
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 64384] is ignored when there is no element specified

2020-04-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64384

--- Comment #1 from Christopher Schultz  ---
Created attachment 37198
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37198=edit
Sample WAR file which reproduces the issue

This WAR file (including source) will work as expected:

1. Deploy the WAR file
2. Navigate to /test which will load index.html
3. Choose an arbitrary file and upload
4a. A small enough file will yield a debug output
4b. A large enough file (> 1MiB) will cause an error

If you edit WEB-INF/web.xml to remove the , you will be
able to upload any size file without error.

-- 
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 64384] New: is ignored when there is no element specified

2020-04-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64384

Bug ID: 64384
   Summary:  is ignored when there is no
 element specified
   Product: Tomcat 8
   Version: 8.5.51
  Hardware: PC
OS: Mac OS X 10.1
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: ch...@christopherschultz.net
  Target Milestone: 

When a  element is present without any 
child element, the whole  appears to be ignored. Specifying
0 (which is the default) results in
expected behavior.

With sample configuration:

  1048576
  1049600
  1024


File sizes larger than 1MiB are rejected as expected. Removing the
 element completely causes large files to be accepted as
if the configuration were not there.

Attaching a debugger, I can see that the multipartConfigElement is essentially
all defaults:

multipartConfigElement  MultipartConfigElement  (id=545)
fileSizeThreshold   0
location"" (id=550)
maxFileSize -1
maxRequestSize  -1

-- 
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 64157] Tomcat 7 performance: enable tomcat to pre-start pool of min spare threads optionally

2020-04-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64157

Mark Thomas  changed:

   What|Removed |Added

 Status|NEEDINFO|RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #3 from Mark Thomas  ---
Two months have passed with no further information being provided. Absent a
text case that demonstrates the issue, I am resolving this as WORKSFORME. If
the issue persists, feel free to re-open this provided the request test case is
supplied.

-- 
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 64155] Tomcat 7 Performance: acceptor thread bottleneck at getPoolSize() located at TaskQueue offer function

2020-04-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64155

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |WORKSFORME
 Status|NEEDINFO|RESOLVED

--- Comment #7 from Mark Thomas  ---
Two months have passed with no further information being provided. Absent a
text case that demonstrates the issue, I am resolving this as WORKSFORME. If
the issue persists, feel free to re-open this provided the request test case is
supplied.

-- 
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 62918] Tomcat Manager Server Status Errors After updating from 8.5.34 to 8.5.35. javax.management.AttributeNotFoundException: Cannot find attribute maxThreads for org.apache.tomcat.util.net.Sock

2020-04-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62918

--- Comment #5 from Remy Maucherat  ---
This works for me on 8.5.54. You should investigate on the user list if you run
into problems.

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



svn commit: r1877066 - in /tomcat: archive/taglibs/ taglibs/

2020-04-27 Thread markt
Author: markt
Date: Mon Apr 27 11:28:58 2020
New Revision: 1877066

URL: http://svn.apache.org/viewvc?rev=1877066=rev
Log:
Archive Taglibs repos

Added:
tomcat/archive/taglibs/
  - copied from r1877065, tomcat/taglibs/
Removed:
tomcat/taglibs/


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



Re: Position on failing tests with vendor-modified OpenSSL packages

2020-04-27 Thread Mark Thomas
On 26/04/2020 10:36, Michael Osipov wrote:
> Am 2020-04-24 um 18:30 schrieb Christopher Schultz:



>> This comes down to algorithms which have been compiled-out of the
>> library, right? So we just need to automatically skip tests which
>> attempt to use those algorithms.

Not entirely. We are affected both by algorithms being removed and
algorithms being added.

>> Unfortunately, the whole point of the unit tests is to make sure we
>> haven't missed anything. In order to both remove unsupported
>> algorithms AND test whether the remaining algorithms are
>> properly-mapped, we need ANOTHER implementation of the mapping, or
>> something similar to cross-check the two.

I think I agree with this. If you mean that somewhere we would need to
maintain a list of algorithms there were supported by the vendor
modified package then, yes I agree. The tricky part being that we can't
always identify what is a vendor modified package.

>> Somewhere, we have a /complete/ list of OpenSSL-specified names that
>> we support.

Ciphers is an enumeration of all the Ciphers OpenSSL supports or has
supported in the past.

In TesterOpenSSL we modify that list to remove Ciphers we know are not
supported in the version we are testing.

>> That can easily be dumped somewhere and sorted
>> alphabetically. Then, "openssl ciphers 'ALL'" can be run, sorted, and
>> compared to the sorted list we have.

"ALL" does not return all supported ciphers. Sigh. You need to use
"ALL:eNULL"

>> Anything which isn't in the
>> "openssl ciphers 'ALL'" list can be removed from the list of cipher
>> suites we test.

The problem is, that is how we detected that the list of supported
Cipher suites has changed for a given OpenSSL branch (yes it can change
between point releases).

>> AIUI, it's possible to individually-remove a cipher suite from the
>> unit tests if it's known to be missing on the platform. We just need
>> to make that process automated, right?
> 
> Up to the point! That's exactly the route one should go.

We would need to clearly separate (from memory I don't recall how clear
the separation is right now):

- Tests that compare the ciphers we think a version of OpenSSL supports
  with the ciphers it reports it supports. These only need to run when
  testing with an unmodified OpenSSL from openssl.org
- Tests just need to know which ciphers OpenSSL supports and, as long as
  they have the correct list, will always pass

Mark

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



[GitHub] [tomcat] martin-g commented on pull request #286: optimized code,replace some c-style array

2020-04-27 Thread GitBox


martin-g commented on pull request #286:
URL: https://github.com/apache/tomcat/pull/286#issuecomment-619872274


   Thanks for cherry-picking the change, Remy! I was interrupted after merging 
the PR and I was going to do it at lunch break.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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



[GitHub] [tomcat] rmaucher commented on pull request #286: optimized code,replace some c-style array

2020-04-27 Thread GitBox


rmaucher commented on pull request #286:
URL: https://github.com/apache/tomcat/pull/286#issuecomment-619853801


   Hmmm :(
   So, ok, I guess you have to start somewhere, but it is best to have PRs on 
something meaningful (like at least a small bugfix or real improvement of some 
sort). Here, maybe at least do the change to the entire codebase instead of a 
single class.
   Also the change then usually needs to be cherry picked to all current 
branches.
   Overall this sort of PR creates a ton of noise.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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



[tomcat] branch 7.0.x updated: optimized code, replace some c-style array

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

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


The following commit(s) were added to refs/heads/7.0.x by this push:
 new 9af6dc9  optimized code,replace some c-style array
9af6dc9 is described below

commit 9af6dc92a2e2e86c12c825b12c075f44bd81afa9
Author: xavier <1217353...@qq.com>
AuthorDate: Sun Apr 26 12:19:44 2020 +0800

optimized code,replace some c-style array
---
 .../tomcat/jdbc/naming/GenericNamingResourcesFactory.java  | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
index 7af82f7..a4ef41c 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
@@ -83,13 +83,13 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 String setter = "set" + capitalize(name);
 
 try {
-Method methods[] = o.getClass().getMethods();
+Method[] methods = o.getClass().getMethods();
 Method setPropertyMethodVoid = null;
 Method setPropertyMethodBool = null;
 
 // First, the ideal case - a setFoo( String ) method
 for (int i = 0; i < methods.length; i++) {
-Class paramT[] = methods[i].getParameterTypes();
+Class[] paramT = methods[i].getParameterTypes();
 if (setter.equals(methods[i].getName()) && paramT.length == 1
 && "java.lang.String".equals(paramT[0].getName())) {
 
@@ -106,7 +106,7 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 
 // match - find the type and invoke it
 Class paramType = methods[i].getParameterTypes()[0];
-Object params[] = new Object[1];
+Object[] params = new Object[1];
 
 // Try a setFoo ( int )
 if ("java.lang.Integer".equals(paramType.getName())
@@ -167,7 +167,7 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 
 // Ok, no setXXX found, try a setProperty("name", "value")
 if (setPropertyMethodBool != null || setPropertyMethodVoid != 
null) {
-Object params[] = new Object[2];
+Object[] params = new Object[2];
 params[0] = name;
 params[1] = value;
 if (setPropertyMethodBool != null) {
@@ -218,7 +218,7 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 if (name == null || name.length() == 0) {
 return name;
 }
-char chars[] = name.toCharArray();
+char[] chars = name.toCharArray();
 chars[0] = Character.toUpperCase(chars[0]);
 return new String(chars);
 }


-
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: optimized code, replace some c-style array

2020-04-27 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 7b6f1aa  optimized code,replace some c-style array
7b6f1aa is described below

commit 7b6f1aa395552e6ae93be6343d843ade251d562a
Author: xavier <1217353...@qq.com>
AuthorDate: Sun Apr 26 12:19:44 2020 +0800

optimized code,replace some c-style array
---
 .../tomcat/jdbc/naming/GenericNamingResourcesFactory.java  | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
index 7d0276a..f2e54d3 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
@@ -90,13 +90,13 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 String setter = "set" + capitalize(name);
 
 try {
-Method methods[] = o.getClass().getMethods();
+Method[] methods = o.getClass().getMethods();
 Method setPropertyMethodVoid = null;
 Method setPropertyMethodBool = null;
 
 // First, the ideal case - a setFoo( String ) method
 for (int i = 0; i < methods.length; i++) {
-Class paramT[] = methods[i].getParameterTypes();
+Class[] paramT = methods[i].getParameterTypes();
 if (setter.equals(methods[i].getName()) && paramT.length == 1
 && "java.lang.String".equals(paramT[0].getName())) {
 
@@ -113,7 +113,7 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 
 // match - find the type and invoke it
 Class paramType = methods[i].getParameterTypes()[0];
-Object params[] = new Object[1];
+Object[] params = new Object[1];
 
 // Try a setFoo ( int )
 if ("java.lang.Integer".equals(paramType.getName())
@@ -174,7 +174,7 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 
 // Ok, no setXXX found, try a setProperty("name", "value")
 if (setPropertyMethodBool != null || setPropertyMethodVoid != 
null) {
-Object params[] = new Object[2];
+Object[] params = new Object[2];
 params[0] = name;
 params[1] = value;
 if (setPropertyMethodBool != null) {
@@ -225,7 +225,7 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 if (name == null || name.length() == 0) {
 return name;
 }
-char chars[] = name.toCharArray();
+char[] chars = name.toCharArray();
 chars[0] = Character.toUpperCase(chars[0]);
 return new String(chars);
 }


-
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: optimized code, replace some c-style array

2020-04-27 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 73f8d72  optimized code,replace some c-style array
73f8d72 is described below

commit 73f8d729970373d95b0828cda7b5ad9700c2ea16
Author: xavier <1217353...@qq.com>
AuthorDate: Sun Apr 26 12:19:44 2020 +0800

optimized code,replace some c-style array
---
 .../tomcat/jdbc/naming/GenericNamingResourcesFactory.java  | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
index 7d0276a..f2e54d3 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
@@ -90,13 +90,13 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 String setter = "set" + capitalize(name);
 
 try {
-Method methods[] = o.getClass().getMethods();
+Method[] methods = o.getClass().getMethods();
 Method setPropertyMethodVoid = null;
 Method setPropertyMethodBool = null;
 
 // First, the ideal case - a setFoo( String ) method
 for (int i = 0; i < methods.length; i++) {
-Class paramT[] = methods[i].getParameterTypes();
+Class[] paramT = methods[i].getParameterTypes();
 if (setter.equals(methods[i].getName()) && paramT.length == 1
 && "java.lang.String".equals(paramT[0].getName())) {
 
@@ -113,7 +113,7 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 
 // match - find the type and invoke it
 Class paramType = methods[i].getParameterTypes()[0];
-Object params[] = new Object[1];
+Object[] params = new Object[1];
 
 // Try a setFoo ( int )
 if ("java.lang.Integer".equals(paramType.getName())
@@ -174,7 +174,7 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 
 // Ok, no setXXX found, try a setProperty("name", "value")
 if (setPropertyMethodBool != null || setPropertyMethodVoid != 
null) {
-Object params[] = new Object[2];
+Object[] params = new Object[2];
 params[0] = name;
 params[1] = value;
 if (setPropertyMethodBool != null) {
@@ -225,7 +225,7 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 if (name == null || name.length() == 0) {
 return name;
 }
-char chars[] = name.toCharArray();
+char[] chars = name.toCharArray();
 chars[0] = Character.toUpperCase(chars[0]);
 return new String(chars);
 }


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



Re: [VOTE] Release Apache Tomcat Native 1.2.24

2020-04-27 Thread Martin Grigorov
On Fri, Apr 24, 2020 at 11:10 PM Mark Thomas  wrote:

> Version 1.2.24 includes the following changes compared to 1.2.23
>
> - Various improvements to the build process related to OpenSSL
>
> - Windows binaries built with OpenSSL 1.1.1g
>
> Various other fixes and improvements. See the changelog for details.
>
> The proposed release artefacts can be found at [1],
> and the build was done using tag [2].
>
> The Apache Tomcat Native 1.2.24 release is
>  [ X ] Stable, go ahead and release
>  [ ] Broken because of ...
>

Tested with OpenSSL 1.1.1 HEAD, Apr 1.6.x and Tomcat 9.x on Ubuntu 18.04
x86_64 and ARM64.

Regards,
Martin


>
> Thanks,
>
> Mark
>
>
> [1]
>
> https://dist.apache.org/repos/dist/dev/tomcat/tomcat-connectors/native/1.2.24
> [2]
>
> https://gitbox.apache.org/repos/asf?p=tomcat-native.git;a=commit;h=6196301af335a4ae230923d1d031b86db0f7335d
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


[GitHub] [tomcat] martin-g commented on pull request #286: optimized code,replace some c-style array

2020-04-27 Thread GitBox


martin-g commented on pull request #286:
URL: https://github.com/apache/tomcat/pull/286#issuecomment-619781821


   Thank you, @XavierChengZW !



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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



[tomcat] branch master updated: optimized code, replace some c-style array

2020-04-27 Thread mgrigorov
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 2e2ac23  optimized code,replace some c-style array
 new 4684537  Merge pull request #286 from XavierChengZW/master
2e2ac23 is described below

commit 2e2ac23601603a47e85ae3f36088be05818755af
Author: xavier <1217353...@qq.com>
AuthorDate: Sun Apr 26 12:19:44 2020 +0800

optimized code,replace some c-style array
---
 .../tomcat/jdbc/naming/GenericNamingResourcesFactory.java  | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
index 7d0276a..f2e54d3 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/naming/GenericNamingResourcesFactory.java
@@ -90,13 +90,13 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 String setter = "set" + capitalize(name);
 
 try {
-Method methods[] = o.getClass().getMethods();
+Method[] methods = o.getClass().getMethods();
 Method setPropertyMethodVoid = null;
 Method setPropertyMethodBool = null;
 
 // First, the ideal case - a setFoo( String ) method
 for (int i = 0; i < methods.length; i++) {
-Class paramT[] = methods[i].getParameterTypes();
+Class[] paramT = methods[i].getParameterTypes();
 if (setter.equals(methods[i].getName()) && paramT.length == 1
 && "java.lang.String".equals(paramT[0].getName())) {
 
@@ -113,7 +113,7 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 
 // match - find the type and invoke it
 Class paramType = methods[i].getParameterTypes()[0];
-Object params[] = new Object[1];
+Object[] params = new Object[1];
 
 // Try a setFoo ( int )
 if ("java.lang.Integer".equals(paramType.getName())
@@ -174,7 +174,7 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 
 // Ok, no setXXX found, try a setProperty("name", "value")
 if (setPropertyMethodBool != null || setPropertyMethodVoid != 
null) {
-Object params[] = new Object[2];
+Object[] params = new Object[2];
 params[0] = name;
 params[1] = value;
 if (setPropertyMethodBool != null) {
@@ -225,7 +225,7 @@ public class GenericNamingResourcesFactory implements 
ObjectFactory {
 if (name == null || name.length() == 0) {
 return name;
 }
-char chars[] = name.toCharArray();
+char[] chars = name.toCharArray();
 chars[0] = Character.toUpperCase(chars[0]);
 return new String(chars);
 }


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