Re: [VOTE] Release Apache Tomcat 7.0.104

2020-05-13 Thread Martin Grigorov
On Thu, May 7, 2020 at 11:17 PM Violeta Georgieva 
wrote:

> The proposed Apache Tomcat 7.0.104 release is now available for voting.
>
> It can be obtained from:
> https://dist.apache.org/repos/dist/dev/tomcat/tomcat-7/v7.0.104/
> The Maven staging repo is:
> https://repository.apache.org/content/repositories/orgapachetomcat-1268/
> The git tag is:
> https://github.com/apache/tomcat/tree/7.0.104
> 28db826c5a92a870a6632d85dae89d4dc3b7af00
>
> The proposed 7.0.104 release is:
> [ ] Broken - do not release
> [ X ] Stable - go ahead and release as 7.0.104 Stable
>

Tested the .tar.gz binary with Apache Wicket 7.x examples.

Regards,
Martin



>
> Regards,
> Violeta
>


[tomcat] branch master updated: Fix subsection name in changelog.xml

2020-05-13 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 73c4260  Fix subsection name in changelog.xml
73c4260 is described below

commit 73c4260a1879425186b497aa73705d926a8dbaac
Author: Martin Tzvetanov Grigorov 
AuthorDate: Wed May 13 10:15:16 2020 +0300

Fix subsection name in changelog.xml
---
 webapps/docs/changelog.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f6d1e43..73549a4 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -52,7 +52,7 @@
   
 
   
-  
+  
 
   
 Add default implementations for init() and


-
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: Add a constant for invalid URI

2020-05-13 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 2da247c  Add a constant for invalid URI
2da247c is described below

commit 2da247ccaf14810fbc7f2eca18a8600aaa614ff4
Author: remm 
AuthorDate: Wed May 13 09:45:03 2020 +0200

Add a constant for invalid URI

Add a space to it to make the code look cleaner.
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index 8587bfd..606311f 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -72,6 +72,8 @@ public class CoyoteAdapter implements Adapter {
 System.getProperty("java.vm.vendor") + "/" +
 System.getProperty("java.runtime.version") + ")";
 
+private static final String INVALID_URI = "Invalid URI ";
+
 private static final EnumSet SSL_ONLY =
 EnumSet.of(SessionTrackingMode.SSL);
 
@@ -614,7 +616,7 @@ public class CoyoteAdapter implements Adapter {
 connector.getService().getContainer().logAccess(request, 
response, 0, true);
 return false;
 } else {
-response.sendError(400, "Invalid URI");
+response.sendError(400, INVALID_URI);
 }
 }
 
@@ -632,7 +634,7 @@ public class CoyoteAdapter implements Adapter {
 try {
 req.getURLDecoder().convert(decodedURI.getByteChunk(), 
connector.getEncodedSolidusHandlingInternal());
 } catch (IOException ioe) {
-response.sendError(400, "Invalid URI: " + ioe.getMessage());
+response.sendError(400, INVALID_URI + ioe.getMessage());
 }
 // Normalization
 if (normalize(req.decodedURI())) {
@@ -646,7 +648,7 @@ public class CoyoteAdapter implements Adapter {
 response.sendError(400, "Invalid URI");
 }
 } else {
-response.sendError(400, "Invalid URI");
+response.sendError(400, INVALID_URI);
 }
 } else {
 /* The URI is chars or String, and has been sent using an in-memory


-
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: Add a constant for invalid URI

2020-05-13 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 e9fcc05  Add a constant for invalid URI
e9fcc05 is described below

commit e9fcc05ed6aa9222c30fc694c0ff2f517ea1ed65
Author: remm 
AuthorDate: Wed May 13 09:45:03 2020 +0200

Add a constant for invalid URI

Add a space to it to make the code look cleaner.
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index 0f11f3d..a559124 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -72,6 +72,8 @@ public class CoyoteAdapter implements Adapter {
 System.getProperty("java.vm.vendor") + "/" +
 System.getProperty("java.runtime.version") + ")";
 
+private static final String INVALID_URI = "Invalid URI ";
+
 private static final EnumSet SSL_ONLY =
 EnumSet.of(SessionTrackingMode.SSL);
 
@@ -614,7 +616,7 @@ public class CoyoteAdapter implements Adapter {
 connector.getService().getContainer().logAccess(request, 
response, 0, true);
 return false;
 } else {
-response.sendError(400, "Invalid URI");
+response.sendError(400, INVALID_URI);
 }
 }
 
@@ -632,7 +634,7 @@ public class CoyoteAdapter implements Adapter {
 try {
 req.getURLDecoder().convert(decodedURI.getByteChunk(), 
connector.getEncodedSolidusHandlingInternal());
 } catch (IOException ioe) {
-response.sendError(400, "Invalid URI: " + ioe.getMessage());
+response.sendError(400, INVALID_URI + ioe.getMessage());
 }
 // Normalization
 if (normalize(req.decodedURI())) {
@@ -643,7 +645,7 @@ public class CoyoteAdapter implements Adapter {
 response.sendError(400, "Invalid URI");
 }
 } else {
-response.sendError(400, "Invalid URI");
+response.sendError(400, INVALID_URI);
 }
 } else {
 /* The URI is chars or String, and has been sent using an in-memory


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



[tomcat] branch master updated: Add a constant for invalid URI

2020-05-13 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 f34dd07  Add a constant for invalid URI
f34dd07 is described below

commit f34dd072d189183cbe152135d0a6b88e0a13315b
Author: remm 
AuthorDate: Wed May 13 09:45:03 2020 +0200

Add a constant for invalid URI

Add a space to it to make the code look cleaner.
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index ab113a7..98a33e8 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -72,6 +72,8 @@ public class CoyoteAdapter implements Adapter {
 System.getProperty("java.vm.vendor") + "/" +
 System.getProperty("java.runtime.version") + ")";
 
+private static final String INVALID_URI = "Invalid URI ";
+
 private static final EnumSet SSL_ONLY =
 EnumSet.of(SessionTrackingMode.SSL);
 
@@ -610,7 +612,7 @@ public class CoyoteAdapter implements Adapter {
 connector.getService().getContainer().logAccess(request, 
response, 0, true);
 return false;
 } else {
-response.sendError(400, "Invalid URI");
+response.sendError(400, INVALID_URI);
 }
 }
 
@@ -628,7 +630,7 @@ public class CoyoteAdapter implements Adapter {
 try {
 req.getURLDecoder().convert(decodedURI.getByteChunk(), 
connector.getEncodedSolidusHandlingInternal());
 } catch (IOException ioe) {
-response.sendError(400, "Invalid URI: " + ioe.getMessage());
+response.sendError(400, INVALID_URI + ioe.getMessage());
 }
 // Normalization
 if (normalize(req.decodedURI(), connector.getAllowBackslash())) {
@@ -638,7 +640,7 @@ public class CoyoteAdapter implements Adapter {
 // Therefore it is not necessary to check that the URI remains
 // normalized after character decoding
 } else {
-response.sendError(400, "Invalid URI");
+response.sendError(400, INVALID_URI);
 }
 } else {
 /* The URI is chars or String, and has been sent using an in-memory


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



buildbot success in on tomcat-9-trunk

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

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

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-9-commit' 
triggered this build
Build Source Stamp: [branch 9.0.x] 2da247ccaf14810fbc7f2eca18a8600aaa614ff4
Blamelist: remm 

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: [tomcat] branch master updated: Add a constant for invalid URI

2020-05-13 Thread Michael Osipov

Am 2020-05-13 um 11:47 schrieb Rémy Maucherat:

On Wed, May 13, 2020 at 11:30 AM Michael Osipov  wrote:


Am 2020-05-13 um 11:18 schrieb Rémy Maucherat:

On Wed, May 13, 2020 at 11:08 AM Michael Osipov 

wrote:



Am 2020-05-13 um 09:45 schrieb r...@apache.org:

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 f34dd07  Add a constant for invalid URI
f34dd07 is described below

commit f34dd072d189183cbe152135d0a6b88e0a13315b
Author: remm 
AuthorDate: Wed May 13 09:45:03 2020 +0200

   Add a constant for invalid URI

   Add a space to it to make the code look cleaner.
---
java/org/apache/catalina/connector/CoyoteAdapter.java | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java

b/java/org/apache/catalina/connector/CoyoteAdapter.java

index ab113a7..98a33e8 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -72,6 +72,8 @@ public class CoyoteAdapter implements Adapter {
System.getProperty("java.vm.vendor") + "/" +
System.getProperty("java.runtime.version") + ")";

+private static final String INVALID_URI = "Invalid URI ";
+
private static final EnumSet SSL_ONLY =
EnumSet.of(SessionTrackingMode.SSL);

@@ -610,7 +612,7 @@ public class CoyoteAdapter implements Adapter {


   connector.getService().getContainer().logAccess(request, response, 0,
true);

return false;
} else {
-response.sendError(400, "Invalid URI");
+response.sendError(400, INVALID_URI);
}
}

@@ -628,7 +630,7 @@ public class CoyoteAdapter implements Adapter {
try {


req.getURLDecoder().convert(decodedURI.getByteChunk(),

connector.getEncodedSolidusHandlingInternal());

} catch (IOException ioe) {
-response.sendError(400, "Invalid URI: " +

ioe.getMessage());

+response.sendError(400, INVALID_URI +

ioe.getMessage());

}
// Normalization
if (normalize(req.decodedURI(),

connector.getAllowBackslash())) {

@@ -638,7 +640,7 @@ public class CoyoteAdapter implements Adapter {
// Therefore it is not necessary to check that the

URI

remains

// normalized after character decoding
} else {
-response.sendError(400, "Invalid URI");
+response.sendError(400, INVALID_URI);
}
} else {
/* The URI is chars or String, and has been sent using

an

in-memory

This change is complete: You have have a trailing 0x20 after the message
and in the case of IOE#getMessage() the colon is gone. Please rework.



What is the big issue ? This is just a string that goes in a HTML that
nobody ever sees [as the URI is invalid, this is not a real client,

simply

a hack attempt], I preferred to simplify a bit since the extra space is

not

a problem and the colon is cosmetic. I can revert this is you decide to
veto it.


If no one ever sees why to write a message at all? Those are just wasted
bytes, aren't they?



It's hard to anticipate which error messages are actually seen, so it's
better to keep them. Although I believe no actual client will see it, I
will not remove this one since the amount saved is zero. Just in case.
I am still trying to find ways to change the Connector situation and am
looking at these classes. If you don't like the change, you should veto and
I will revert no questions asked.


Kindly do so.



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



Re: [tomcat] branch master updated: Add a constant for invalid URI

2020-05-13 Thread Rémy Maucherat
On Wed, May 13, 2020 at 11:08 AM Michael Osipov  wrote:

> Am 2020-05-13 um 09:45 schrieb r...@apache.org:
> > 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 f34dd07  Add a constant for invalid URI
> > f34dd07 is described below
> >
> > commit f34dd072d189183cbe152135d0a6b88e0a13315b
> > Author: remm 
> > AuthorDate: Wed May 13 09:45:03 2020 +0200
> >
> >  Add a constant for invalid URI
> >
> >  Add a space to it to make the code look cleaner.
> > ---
> >   java/org/apache/catalina/connector/CoyoteAdapter.java | 8 +---
> >   1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java
> b/java/org/apache/catalina/connector/CoyoteAdapter.java
> > index ab113a7..98a33e8 100644
> > --- a/java/org/apache/catalina/connector/CoyoteAdapter.java
> > +++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
> > @@ -72,6 +72,8 @@ public class CoyoteAdapter implements Adapter {
> >   System.getProperty("java.vm.vendor") + "/" +
> >   System.getProperty("java.runtime.version") + ")";
> >
> > +private static final String INVALID_URI = "Invalid URI ";
> > +
> >   private static final EnumSet SSL_ONLY =
> >   EnumSet.of(SessionTrackingMode.SSL);
> >
> > @@ -610,7 +612,7 @@ public class CoyoteAdapter implements Adapter {
> >
>  connector.getService().getContainer().logAccess(request, response, 0,
> true);
> >   return false;
> >   } else {
> > -response.sendError(400, "Invalid URI");
> > +response.sendError(400, INVALID_URI);
> >   }
> >   }
> >
> > @@ -628,7 +630,7 @@ public class CoyoteAdapter implements Adapter {
> >   try {
> >   req.getURLDecoder().convert(decodedURI.getByteChunk(),
> connector.getEncodedSolidusHandlingInternal());
> >   } catch (IOException ioe) {
> > -response.sendError(400, "Invalid URI: " +
> ioe.getMessage());
> > +response.sendError(400, INVALID_URI + ioe.getMessage());
> >   }
> >   // Normalization
> >   if (normalize(req.decodedURI(),
> connector.getAllowBackslash())) {
> > @@ -638,7 +640,7 @@ public class CoyoteAdapter implements Adapter {
> >   // Therefore it is not necessary to check that the URI
> remains
> >   // normalized after character decoding
> >   } else {
> > -response.sendError(400, "Invalid URI");
> > +response.sendError(400, INVALID_URI);
> >   }
> >   } else {
> >   /* The URI is chars or String, and has been sent using an
> in-memory
>
> This change is complete: You have have a trailing 0x20 after the message
> and in the case of IOE#getMessage() the colon is gone. Please rework.
>

What is the big issue ? This is just a string that goes in a HTML that
nobody ever sees [as the URI is invalid, this is not a real client, simply
a hack attempt], I preferred to simplify a bit since the extra space is not
a problem and the colon is cosmetic. I can revert this is you decide to
veto it.

Rémy


[Bug 64419] Build problem with tomcat-native on FreeBSD 11.3/LibreSSL

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64419

--- Comment #6 from gessel  ---
tomcat-native-1.2.24_1 builds successfully, thank you!

-- 
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 64419] Build problem with tomcat-native on FreeBSD 11.3/LibreSSL

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64419

Michael Osipov  changed:

   What|Removed |Added

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

--- Comment #7 from Michael Osipov  ---
I will supersede this ticket with a new, general one. Downstream patches have
been applied, but upstream is still broken.

-- 
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 64429] Commit b8649e81458194d70667952d9e26df82a79c773f in 1.1.24 breaks compilation with LibreSSL

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64429

--- Comment #2 from Michael Osipov  ---
(In reply to Christopher Schultz from comment #1)
> I think a solution is desired, but there is no need to revert.
> 
> Support for LibreSSL is a goal, not a requirement.

I agree, but if it worked before we shouldn't break it w/o any further
announcement. Are you skilled enough to work on a working solution?

-- 
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 64431] Enable response compression by default

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64431

--- Comment #3 from Christopher Schultz  ---
(In reply to Craig from comment #2)
> (In reply to Remy Maucherat from comment #1)
> > I'd likely vote no to this proposal.
> 
> For posterity, why not?

CRIME, BREACH.

I'm in favor of HTTP compression for static files (e.g. CSS, javascript, maybe
SVG), but not for dynamically-generated content.

-- 
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 64432] New: RewriteValve does not work with multiple rules

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64432

Bug ID: 64432
   Summary: RewriteValve does not work with multiple rules
   Product: Tomcat 9
   Version: unspecified
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: j...@scaldingspoon.com
  Target Milestone: -

Created attachment 37241
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37241=edit
patch with simple tests and potential fix

When a multiline configuration file is used for RewriteValve is used, only the
first rule is ever run/applied. Attached is a patch for a couple simple test
cases, and a potential fix.

This problem is exhibited in master and the 8.5.x branch.

I'm not sure of the fuller impact of the fix since this reverts recent changes
in the code.

-- 
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 64430] rotating catalina.out (using named pipe)

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64430

--- Comment #3 from Michael Osipov  ---
The shell script has to be portable, "mknod -p" is not portable. This will
require cases for various Unix systems. What about fifo with mkfifo?

-- 
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 64431] Enable response compression by default

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64431

--- Comment #4 from Craig  ---
> 
> CRIME, BREACH.
> 
CRIME is a vulnerability that applies to TLS compression - I'm not suggesting
here that TLS compression be used (it was actually removed in TLS 1.3). So I
don't believe CRIME is relevant.

BREACH is relevant... There are mitigations (such as SameSite cookies), but
there's no guarantee that applications running Tomcat have implemented them. So
I see your point :)

Roes Tomcat have any mitigations for BREACH in place today? It seems Tomcat
doesn't do any kind of random response padding (such as with empty response
chunks or randomly sized response chunking).

-- 
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: [tomcat] 02/02: Avoid waste of resources due to reconstruction of objects

2020-05-13 Thread Rémy Maucherat
On Mon, May 4, 2020 at 4:43 PM  wrote:

> 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
>
> commit 1719b71374d57d59bdcd99537bf13348cdaf87c7
> Author: KangZhiDong 
> AuthorDate: Sat Apr 25 01:30:47 2020 +0800
>
> Avoid waste of resources due to reconstruction of objects
> ---
>  .../apache/catalina/core/ApplicationContext.java   |  2 +-
>  .../apache/catalina/ha/tcp/ReplicationValve.java   |  2 +-
>  .../catalina/session/PersistentManagerBase.java|  2 +-
>  .../catalina/valves/rewrite/RewriteCond.java   |  2 +-
>  .../catalina/valves/rewrite/RewriteRule.java   |  4 ++--
>  .../catalina/valves/rewrite/RewriteValve.java  |  2 +-
>  java/org/apache/juli/ClassLoaderLogManager.java|  2 +-
>  test/org/apache/catalina/valves/Benchmarks.java| 26
> +++---
>  8 files changed, 21 insertions(+), 21 deletions(-)
>

https://bz.apache.org/bugzilla/show_bug.cgi?id=64432
Ok, so this looked like very fishy savings. It turns out each object
instance may want to have its own thread local. IMO that's the case for
nearly all the classes above, and either way it's probably not a good idea
to take any chances.
I think this should be reverted.

Rémy


>
> diff --git a/java/org/apache/catalina/core/ApplicationContext.java
> b/java/org/apache/catalina/core/ApplicationContext.java
> index 61981e5..004055a 100644
> --- a/java/org/apache/catalina/core/ApplicationContext.java
> +++ b/java/org/apache/catalina/core/ApplicationContext.java
> @@ -171,7 +171,7 @@ public class ApplicationContext implements
> ServletContext {
>  /**
>   * Thread local data used during request dispatch.
>   */
> -private final ThreadLocal dispatchData = new
> ThreadLocal<>();
> +private static final ThreadLocal dispatchData = new
> ThreadLocal<>();
>
>
>  /**
> diff --git a/java/org/apache/catalina/ha/tcp/ReplicationValve.java
> b/java/org/apache/catalina/ha/tcp/ReplicationValve.java
> index 144dbbb..8cd73b9 100644
> --- a/java/org/apache/catalina/ha/tcp/ReplicationValve.java
> +++ b/java/org/apache/catalina/ha/tcp/ReplicationValve.java
> @@ -85,7 +85,7 @@ public class ReplicationValve
>  /**
>   * crossContext session container
>   */
> -protected final ThreadLocal>
> crossContextSessions =
> +protected static final ThreadLocal>
> crossContextSessions =
>  new ThreadLocal<>() ;
>
>  /**
> diff --git a/java/org/apache/catalina/session/PersistentManagerBase.java
> b/java/org/apache/catalina/session/PersistentManagerBase.java
> index 9f52c44..1fd08be 100644
> --- a/java/org/apache/catalina/session/PersistentManagerBase.java
> +++ b/java/org/apache/catalina/session/PersistentManagerBase.java
> @@ -188,7 +188,7 @@ public abstract class PersistentManagerBase extends
> ManagerBase
>   * Session that is currently getting swapped in to prevent loading it
> more
>   * than once concurrently
>   */
> -private final ThreadLocal sessionToSwapIn = new
> ThreadLocal<>();
> +private static final ThreadLocal sessionToSwapIn = new
> ThreadLocal<>();
>
>
>  // -
> Properties
> diff --git a/java/org/apache/catalina/valves/rewrite/RewriteCond.java
> b/java/org/apache/catalina/valves/rewrite/RewriteCond.java
> index 47a904c..a980d81 100644
> --- a/java/org/apache/catalina/valves/rewrite/RewriteCond.java
> +++ b/java/org/apache/catalina/valves/rewrite/RewriteCond.java
> @@ -28,7 +28,7 @@ public class RewriteCond {
>
>  public static class PatternCondition extends Condition {
>  public Pattern pattern;
> -private ThreadLocal matcher = new ThreadLocal<>();
> +private static ThreadLocal matcher = new ThreadLocal<>();
>
>  @Override
>  public boolean evaluate(String value, Resolver resolver) {
> diff --git a/java/org/apache/catalina/valves/rewrite/RewriteRule.java
> b/java/org/apache/catalina/valves/rewrite/RewriteRule.java
> index 833a12c..0aa96de 100644
> --- a/java/org/apache/catalina/valves/rewrite/RewriteRule.java
> +++ b/java/org/apache/catalina/valves/rewrite/RewriteRule.java
> @@ -26,7 +26,7 @@ public class RewriteRule {
>
>  protected RewriteCond[] conditions = new RewriteCond[0];
>
> -protected ThreadLocal pattern = new ThreadLocal<>();
> +protected static ThreadLocal pattern = new ThreadLocal<>();
>  protected Substitution substitution = null;
>
>  protected String patternString = null;
> @@ -186,7 +186,7 @@ public class RewriteRule {
>  protected boolean cookieSecure = false;
>  protected boolean cookieHttpOnly = false;
>  protected Substitution cookieSubstitution = null;
> -protected ThreadLocal cookieResult = new ThreadLocal<>();
> +protected static ThreadLocal cookieResult = new
> ThreadLocal<>();
>
>  /**
>   *  This forces a request attribute named VAR to be set to the 

Re: [tomcat] 02/02: Avoid waste of resources due to reconstruction of objects

2020-05-13 Thread Mark Thomas
On 13/05/2020 19:23, Rémy Maucherat wrote:
> On Mon, May 4, 2020 at 4:43 PM  > wrote:
> 
> 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
> 
> commit 1719b71374d57d59bdcd99537bf13348cdaf87c7
> Author: KangZhiDong mailto:world...@gmail.com>>
> AuthorDate: Sat Apr 25 01:30:47 2020 +0800
> 
>     Avoid waste of resources due to reconstruction of objects
> ---
>  .../apache/catalina/core/ApplicationContext.java   |  2 +-
>  .../apache/catalina/ha/tcp/ReplicationValve.java   |  2 +-
>  .../catalina/session/PersistentManagerBase.java    |  2 +-
>  .../catalina/valves/rewrite/RewriteCond.java       |  2 +-
>  .../catalina/valves/rewrite/RewriteRule.java       |  4 ++--
>  .../catalina/valves/rewrite/RewriteValve.java      |  2 +-
>  java/org/apache/juli/ClassLoaderLogManager.java    |  2 +-
>  test/org/apache/catalina/valves/Benchmarks.java    | 26
> +++---
>  8 files changed, 21 insertions(+), 21 deletions(-)
> 
> 
> https://bz.apache.org/bugzilla/show_bug.cgi?id=64432
> Ok, so this looked like very fishy savings. It turns out each object
> instance may want to have its own thread local. IMO that's the case for
> nearly all the classes above, and either way it's probably not a good
> idea to take any chances.
> I think this should be reverted.

I went through each of these in turn and checked that a static
ThreadLocal was safe to use. What do you think I missed?

Mark

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



Re: [tomcat] 02/02: Avoid waste of resources due to reconstruction of objects

2020-05-13 Thread Rémy Maucherat
On Thu, May 14, 2020 at 12:20 AM Mark Thomas  wrote:

> On 13/05/2020 19:23, Rémy Maucherat wrote:
> > On Mon, May 4, 2020 at 4:43 PM  > > wrote:
> >
> > 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
> >
> > commit 1719b71374d57d59bdcd99537bf13348cdaf87c7
> > Author: KangZhiDong mailto:world...@gmail.com>>
> > AuthorDate: Sat Apr 25 01:30:47 2020 +0800
> >
> > Avoid waste of resources due to reconstruction of objects
> > ---
> >  .../apache/catalina/core/ApplicationContext.java   |  2 +-
> >  .../apache/catalina/ha/tcp/ReplicationValve.java   |  2 +-
> >  .../catalina/session/PersistentManagerBase.java|  2 +-
> >  .../catalina/valves/rewrite/RewriteCond.java   |  2 +-
> >  .../catalina/valves/rewrite/RewriteRule.java   |  4 ++--
> >  .../catalina/valves/rewrite/RewriteValve.java  |  2 +-
> >  java/org/apache/juli/ClassLoaderLogManager.java|  2 +-
> >  test/org/apache/catalina/valves/Benchmarks.java| 26
> > +++---
> >  8 files changed, 21 insertions(+), 21 deletions(-)
> >
> >
> > https://bz.apache.org/bugzilla/show_bug.cgi?id=64432
> > Ok, so this looked like very fishy savings. It turns out each object
> > instance may want to have its own thread local. IMO that's the case for
> > nearly all the classes above, and either way it's probably not a good
> > idea to take any chances.
> > I think this should be reverted.
>
> I went through each of these in turn and checked that a static
> ThreadLocal was safe to use. What do you think I missed?
>

I used the testcases and verified the patch from the BZ:
https://bz.apache.org/bugzilla/attachment.cgi?id=37241
The static thread local would mean all rules are sharing the pattern of the
first rule.

So overall: this optimization using static thread locals sounds dangerous
as it could lead to hard to find bugs later on as soon as there are two or
more instances of an object. So I'd prefer passing on it, even if it would
be acceptable in some cases.

Rémy


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


[Bug 64430] rotating catalina.out (using named pipe)

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64430

--- Comment #4 from harald.dun...@aixigo.de ---
Created attachment 37242
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37242=edit
even better patch

Good suggestion. I highly appreciate your effort to keep portability.

Attached is a new patch, using mkfifo. The comment about CATALINA_OUT_CMD and
the indentation style have been adjusted, too.

-- 
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: [tomcat] branch master updated: Add a constant for invalid URI

2020-05-13 Thread Michael Osipov

Am 2020-05-13 um 11:18 schrieb Rémy Maucherat:

On Wed, May 13, 2020 at 11:08 AM Michael Osipov  wrote:


Am 2020-05-13 um 09:45 schrieb r...@apache.org:

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 f34dd07  Add a constant for invalid URI
f34dd07 is described below

commit f34dd072d189183cbe152135d0a6b88e0a13315b
Author: remm 
AuthorDate: Wed May 13 09:45:03 2020 +0200

  Add a constant for invalid URI

  Add a space to it to make the code look cleaner.
---
   java/org/apache/catalina/connector/CoyoteAdapter.java | 8 +---
   1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java

b/java/org/apache/catalina/connector/CoyoteAdapter.java

index ab113a7..98a33e8 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -72,6 +72,8 @@ public class CoyoteAdapter implements Adapter {
   System.getProperty("java.vm.vendor") + "/" +
   System.getProperty("java.runtime.version") + ")";

+private static final String INVALID_URI = "Invalid URI ";
+
   private static final EnumSet SSL_ONLY =
   EnumSet.of(SessionTrackingMode.SSL);

@@ -610,7 +612,7 @@ public class CoyoteAdapter implements Adapter {


  connector.getService().getContainer().logAccess(request, response, 0,
true);

   return false;
   } else {
-response.sendError(400, "Invalid URI");
+response.sendError(400, INVALID_URI);
   }
   }

@@ -628,7 +630,7 @@ public class CoyoteAdapter implements Adapter {
   try {
   req.getURLDecoder().convert(decodedURI.getByteChunk(),

connector.getEncodedSolidusHandlingInternal());

   } catch (IOException ioe) {
-response.sendError(400, "Invalid URI: " +

ioe.getMessage());

+response.sendError(400, INVALID_URI + ioe.getMessage());
   }
   // Normalization
   if (normalize(req.decodedURI(),

connector.getAllowBackslash())) {

@@ -638,7 +640,7 @@ public class CoyoteAdapter implements Adapter {
   // Therefore it is not necessary to check that the URI

remains

   // normalized after character decoding
   } else {
-response.sendError(400, "Invalid URI");
+response.sendError(400, INVALID_URI);
   }
   } else {
   /* The URI is chars or String, and has been sent using an

in-memory

This change is complete: You have have a trailing 0x20 after the message
and in the case of IOE#getMessage() the colon is gone. Please rework.



What is the big issue ? This is just a string that goes in a HTML that
nobody ever sees [as the URI is invalid, this is not a real client, simply
a hack attempt], I preferred to simplify a bit since the extra space is not
a problem and the colon is cosmetic. I can revert this is you decide to
veto it.


If no one ever sees why to write a message at all? Those are just wasted 
bytes, aren't they?



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



Re: [tomcat] branch master updated: Add a constant for invalid URI

2020-05-13 Thread Rémy Maucherat
On Wed, May 13, 2020 at 11:30 AM Michael Osipov  wrote:

> Am 2020-05-13 um 11:18 schrieb Rémy Maucherat:
> > On Wed, May 13, 2020 at 11:08 AM Michael Osipov 
> wrote:
> >
> >> Am 2020-05-13 um 09:45 schrieb r...@apache.org:
> >>> 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 f34dd07  Add a constant for invalid URI
> >>> f34dd07 is described below
> >>>
> >>> commit f34dd072d189183cbe152135d0a6b88e0a13315b
> >>> Author: remm 
> >>> AuthorDate: Wed May 13 09:45:03 2020 +0200
> >>>
> >>>   Add a constant for invalid URI
> >>>
> >>>   Add a space to it to make the code look cleaner.
> >>> ---
> >>>java/org/apache/catalina/connector/CoyoteAdapter.java | 8 +---
> >>>1 file changed, 5 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java
> >> b/java/org/apache/catalina/connector/CoyoteAdapter.java
> >>> index ab113a7..98a33e8 100644
> >>> --- a/java/org/apache/catalina/connector/CoyoteAdapter.java
> >>> +++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
> >>> @@ -72,6 +72,8 @@ public class CoyoteAdapter implements Adapter {
> >>>System.getProperty("java.vm.vendor") + "/" +
> >>>System.getProperty("java.runtime.version") + ")";
> >>>
> >>> +private static final String INVALID_URI = "Invalid URI ";
> >>> +
> >>>private static final EnumSet SSL_ONLY =
> >>>EnumSet.of(SessionTrackingMode.SSL);
> >>>
> >>> @@ -610,7 +612,7 @@ public class CoyoteAdapter implements Adapter {
> >>>
> >>   connector.getService().getContainer().logAccess(request, response, 0,
> >> true);
> >>>return false;
> >>>} else {
> >>> -response.sendError(400, "Invalid URI");
> >>> +response.sendError(400, INVALID_URI);
> >>>}
> >>>}
> >>>
> >>> @@ -628,7 +630,7 @@ public class CoyoteAdapter implements Adapter {
> >>>try {
> >>>
> req.getURLDecoder().convert(decodedURI.getByteChunk(),
> >> connector.getEncodedSolidusHandlingInternal());
> >>>} catch (IOException ioe) {
> >>> -response.sendError(400, "Invalid URI: " +
> >> ioe.getMessage());
> >>> +response.sendError(400, INVALID_URI +
> ioe.getMessage());
> >>>}
> >>>// Normalization
> >>>if (normalize(req.decodedURI(),
> >> connector.getAllowBackslash())) {
> >>> @@ -638,7 +640,7 @@ public class CoyoteAdapter implements Adapter {
> >>>// Therefore it is not necessary to check that the
> URI
> >> remains
> >>>// normalized after character decoding
> >>>} else {
> >>> -response.sendError(400, "Invalid URI");
> >>> +response.sendError(400, INVALID_URI);
> >>>}
> >>>} else {
> >>>/* The URI is chars or String, and has been sent using
> an
> >> in-memory
> >>
> >> This change is complete: You have have a trailing 0x20 after the message
> >> and in the case of IOE#getMessage() the colon is gone. Please rework.
> >>
> >
> > What is the big issue ? This is just a string that goes in a HTML that
> > nobody ever sees [as the URI is invalid, this is not a real client,
> simply
> > a hack attempt], I preferred to simplify a bit since the extra space is
> not
> > a problem and the colon is cosmetic. I can revert this is you decide to
> > veto it.
>
> If no one ever sees why to write a message at all? Those are just wasted
> bytes, aren't they?
>

It's hard to anticipate which error messages are actually seen, so it's
better to keep them. Although I believe no actual client will see it, I
will not remove this one since the amount saved is zero. Just in case.
I am still trying to find ways to change the Connector situation and am
looking at these classes. If you don't like the change, you should veto and
I will revert no questions asked.

Rémy


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


Re: [tomcat] branch master updated: Add a constant for invalid URI

2020-05-13 Thread Michael Osipov

Am 2020-05-13 um 09:45 schrieb r...@apache.org:

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 f34dd07  Add a constant for invalid URI
f34dd07 is described below

commit f34dd072d189183cbe152135d0a6b88e0a13315b
Author: remm 
AuthorDate: Wed May 13 09:45:03 2020 +0200

 Add a constant for invalid URI
 
 Add a space to it to make the code look cleaner.

---
  java/org/apache/catalina/connector/CoyoteAdapter.java | 8 +---
  1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index ab113a7..98a33e8 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -72,6 +72,8 @@ public class CoyoteAdapter implements Adapter {
  System.getProperty("java.vm.vendor") + "/" +
  System.getProperty("java.runtime.version") + ")";
  
+private static final String INVALID_URI = "Invalid URI ";

+
  private static final EnumSet SSL_ONLY =
  EnumSet.of(SessionTrackingMode.SSL);
  
@@ -610,7 +612,7 @@ public class CoyoteAdapter implements Adapter {

  connector.getService().getContainer().logAccess(request, 
response, 0, true);
  return false;
  } else {
-response.sendError(400, "Invalid URI");
+response.sendError(400, INVALID_URI);
  }
  }
  
@@ -628,7 +630,7 @@ public class CoyoteAdapter implements Adapter {

  try {
  req.getURLDecoder().convert(decodedURI.getByteChunk(), 
connector.getEncodedSolidusHandlingInternal());
  } catch (IOException ioe) {
-response.sendError(400, "Invalid URI: " + ioe.getMessage());
+response.sendError(400, INVALID_URI + ioe.getMessage());
  }
  // Normalization
  if (normalize(req.decodedURI(), connector.getAllowBackslash())) {
@@ -638,7 +640,7 @@ public class CoyoteAdapter implements Adapter {
  // Therefore it is not necessary to check that the URI remains
  // normalized after character decoding
  } else {
-response.sendError(400, "Invalid URI");
+response.sendError(400, INVALID_URI);
  }
  } else {
  /* The URI is chars or String, and has been sent using an 
in-memory


This change is complete: You have have a trailing 0x20 after the message 
and in the case of IOE#getMessage() the colon is gone. Please rework.


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



[Bug 64431] Enable response compression by default

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64431

Remy Maucherat  changed:

   What|Removed |Added

   Severity|normal  |enhancement

--- Comment #1 from Remy Maucherat  ---
I'd likely vote no to this proposal. It is not a bug, anyway.

-- 
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 64431] Enable response compression by default

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64431

--- Comment #2 from Craig  ---
(In reply to Remy Maucherat from comment #1)
> I'd likely vote no to this proposal.

For posterity, why not?

>It is not a bug, anyway.

I filed it as an "enhancement" not a bug - was that not the right thing? If
not, I apologize!

-- 
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 64430] rotating catalina.out (using named pipe)

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64430

--- Comment #1 from harald.dun...@aixigo.de ---
Created attachment 37240
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37240=edit
better 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 64430] rotating catalina.out (using named pipe)

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64430

--- Comment #2 from harald.dun...@aixigo.de ---
Please ignore the first patch. I picked the right file from the wrong
directory.

-- 
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 64415] Error in slow query report - Comparison method violates its general contract!

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64415

Christopher Schultz  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #10 from Christopher Schultz  ---


*** This bug has been marked as a duplicate of bug 58489 ***

-- 
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 58489] QueryStatsComparator throws IllegalArgumentException: Comparison method violates its general contract!

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58489

Christopher Schultz  changed:

   What|Removed |Added

 CC||spiffy2...@hotmail.com

--- Comment #12 from Christopher Schultz  ---
*** Bug 64415 has been marked as a duplicate of this bug. ***

-- 
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 58489] QueryStatsComparator throws IllegalArgumentException: Comparison method violates its general contract!

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58489

--- Comment #13 from Christopher Schultz  ---
There is some good information (IMHO) in bug #64415 about this.

My method is essentially the same, except that I don't copy the whole
QueryStats object - only what is required to perform the evaluation.

I also protect against the data being updated during the copy/sort with an
additional check.

Let me know what you think.

-- 
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 64429] Commit b8649e81458194d70667952d9e26df82a79c773f in 1.1.24 breaks compilation with LibreSSL

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64429

--- Comment #1 from Christopher Schultz  ---
I think a solution is desired, but there is no need to revert.

Support for LibreSSL is a goal, not a requirement.

-- 
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 64431] New: Enable response compression by default

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64431

Bug ID: 64431
   Summary: Enable response compression by default
   Product: Tomcat 10
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Connectors
  Assignee: dev@tomcat.apache.org
  Reporter: candr...@integralblue.com
  Target Milestone: --

In Tomcat 10, I believe that compression should be enabled by default for the
HTTP connector. In other words, change the default value of
Connector#compression from "off" to "on" as documented at:
https://tomcat.apache.org/tomcat-10.0-doc/config/http.html

I don't believe that there's any (significant) downside to enabling compression
by default, and I believe doing so aligns with the best experience for Tomcat's
users. Years ago, the extra CPU consumption of compression may have been a
concern, but I think the time for that worry has passed - the reduced network
transfer is far more important for the almost all situations. The default
values of "compressionMinSize", "compressibleMimeType", and
"noCompressionUserAgents" ensure that compressing is done in a useful, safe
way.

-- 
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 64431] Enable response compression by default

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64431

Craig  changed:

   What|Removed |Added

 CC||candr...@integralblue.com

-- 
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 64429] New: Commit b8649e81458194d70667952d9e26df82a79c773f in 1.1.24 breaks compilation with LibreSSL

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64429

Bug ID: 64429
   Summary: Commit b8649e81458194d70667952d9e26df82a79c773f in
1.1.24 breaks compilation with LibreSSL
   Product: Tomcat Native
   Version: unspecified
  Hardware: All
OS: All
Status: NEW
  Severity: regression
  Priority: P2
 Component: Library
  Assignee: dev@tomcat.apache.org
  Reporter: micha...@apache.org
  Target Milestone: ---

As documented in BZ 64419, commit b8649e81458194d70667952d9e26df82a79c773f
unfortunately breaks compilation with LibreSSL:

> src/ssl.c:789:41: error: use of undeclared identifier 'thread_exit_key'; did 
> you mean 'pthread_exit'?
> err = apr_threadkey_private_create(_exit_key, _ssl_thread_exit,
> ^~~
> pthread_exit
> /usr/include/pthread.h:215:7: note: 'pthread_exit' declared here
> voidpthread_exit(void *) __dead2;
> ^
> src/ssl.c:789:58: error: use of undeclared identifier '_ssl_thread_exit'
> err = apr_threadkey_private_create(_exit_key, _ssl_thread_exit,
>  ^
> src/ssl.c:796:5: error: use of undeclared identifier 'threadkey_initialized'
> threadkey_initialized = 1;
> ^
> src/ssl.c:799:5: warning: implicit declaration of function 'ssl_thread_setup' 
> is invalid in C99
>   [-Wimplicit-function-declaration]
> ssl_thread_setup(tcn_global_pool);
> ^

It seems like the change is incomplete for LibreSSL. We should either provide a
complete solution or revert the change until a complete solution has been
developed.

-- 
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 9.0.x updated: Revert

2020-05-13 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 c0796a1  Revert
c0796a1 is described below

commit c0796a1c283086d60d8a23212dab1d719bdb301d
Author: remm 
AuthorDate: Wed May 13 15:48:12 2020 +0200

Revert
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index 606311f..8587bfd 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -72,8 +72,6 @@ public class CoyoteAdapter implements Adapter {
 System.getProperty("java.vm.vendor") + "/" +
 System.getProperty("java.runtime.version") + ")";
 
-private static final String INVALID_URI = "Invalid URI ";
-
 private static final EnumSet SSL_ONLY =
 EnumSet.of(SessionTrackingMode.SSL);
 
@@ -616,7 +614,7 @@ public class CoyoteAdapter implements Adapter {
 connector.getService().getContainer().logAccess(request, 
response, 0, true);
 return false;
 } else {
-response.sendError(400, INVALID_URI);
+response.sendError(400, "Invalid URI");
 }
 }
 
@@ -634,7 +632,7 @@ public class CoyoteAdapter implements Adapter {
 try {
 req.getURLDecoder().convert(decodedURI.getByteChunk(), 
connector.getEncodedSolidusHandlingInternal());
 } catch (IOException ioe) {
-response.sendError(400, INVALID_URI + ioe.getMessage());
+response.sendError(400, "Invalid URI: " + ioe.getMessage());
 }
 // Normalization
 if (normalize(req.decodedURI())) {
@@ -648,7 +646,7 @@ public class CoyoteAdapter implements Adapter {
 response.sendError(400, "Invalid URI");
 }
 } else {
-response.sendError(400, INVALID_URI);
+response.sendError(400, "Invalid URI");
 }
 } else {
 /* The URI is chars or String, and has been sent using an in-memory


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

2020-05-13 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 2808a97  Revert
2808a97 is described below

commit 2808a97cd1c524fa8e187b4bf4bbd189c80a5085
Author: remm 
AuthorDate: Wed May 13 15:48:12 2020 +0200

Revert
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index a559124..0f11f3d 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -72,8 +72,6 @@ public class CoyoteAdapter implements Adapter {
 System.getProperty("java.vm.vendor") + "/" +
 System.getProperty("java.runtime.version") + ")";
 
-private static final String INVALID_URI = "Invalid URI ";
-
 private static final EnumSet SSL_ONLY =
 EnumSet.of(SessionTrackingMode.SSL);
 
@@ -616,7 +614,7 @@ public class CoyoteAdapter implements Adapter {
 connector.getService().getContainer().logAccess(request, 
response, 0, true);
 return false;
 } else {
-response.sendError(400, INVALID_URI);
+response.sendError(400, "Invalid URI");
 }
 }
 
@@ -634,7 +632,7 @@ public class CoyoteAdapter implements Adapter {
 try {
 req.getURLDecoder().convert(decodedURI.getByteChunk(), 
connector.getEncodedSolidusHandlingInternal());
 } catch (IOException ioe) {
-response.sendError(400, INVALID_URI + ioe.getMessage());
+response.sendError(400, "Invalid URI: " + ioe.getMessage());
 }
 // Normalization
 if (normalize(req.decodedURI())) {
@@ -645,7 +643,7 @@ public class CoyoteAdapter implements Adapter {
 response.sendError(400, "Invalid URI");
 }
 } else {
-response.sendError(400, INVALID_URI);
+response.sendError(400, "Invalid URI");
 }
 } else {
 /* The URI is chars or String, and has been sent using an in-memory


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



[Bug 64430] New: rotating catalina.out (using named pipe)

2020-05-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64430

Bug ID: 64430
   Summary: rotating catalina.out (using named pipe)
   Product: Tomcat 8
   Version: 8.5.54
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: harald.dun...@aixigo.de
  Target Milestone: 

Created attachment 37239
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37239=edit
patch for catalina.sh

AFAICS the code in catalina.sh to rotate catalina.out has been withdrawn with
5.8.39. #53930

Changing the system's logrotate.conf to rotate catalina.out requires root
permission. This might be not an option in some cases. 

I would like to suggest a new approach to rotate catalina.out. See attached
patch. The idea is to define CATALINA_OUT_CMD (as for 8.5.38), but this time
catalina.sh creates a named pipe on the fly, to be used instead of a plain file
"catalina.sh". The code about catalina's PID is not changed, i.e. the systemd
users should be happy with the new version.

The default behavior of catalina.sh hasn't been changed (hopefully). 

Just a suggestion, of course. Keep on your good work

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

2020-05-13 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 43b10e3  Revert
43b10e3 is described below

commit 43b10e37e6eda920e764cc94cd0cd079e614f2ab
Author: remm 
AuthorDate: Wed May 13 15:48:12 2020 +0200

Revert
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index 98a33e8..ab113a7 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -72,8 +72,6 @@ public class CoyoteAdapter implements Adapter {
 System.getProperty("java.vm.vendor") + "/" +
 System.getProperty("java.runtime.version") + ")";
 
-private static final String INVALID_URI = "Invalid URI ";
-
 private static final EnumSet SSL_ONLY =
 EnumSet.of(SessionTrackingMode.SSL);
 
@@ -612,7 +610,7 @@ public class CoyoteAdapter implements Adapter {
 connector.getService().getContainer().logAccess(request, 
response, 0, true);
 return false;
 } else {
-response.sendError(400, INVALID_URI);
+response.sendError(400, "Invalid URI");
 }
 }
 
@@ -630,7 +628,7 @@ public class CoyoteAdapter implements Adapter {
 try {
 req.getURLDecoder().convert(decodedURI.getByteChunk(), 
connector.getEncodedSolidusHandlingInternal());
 } catch (IOException ioe) {
-response.sendError(400, INVALID_URI + ioe.getMessage());
+response.sendError(400, "Invalid URI: " + ioe.getMessage());
 }
 // Normalization
 if (normalize(req.decodedURI(), connector.getAllowBackslash())) {
@@ -640,7 +638,7 @@ public class CoyoteAdapter implements Adapter {
 // Therefore it is not necessary to check that the URI remains
 // normalized after character decoding
 } else {
-response.sendError(400, INVALID_URI);
+response.sendError(400, "Invalid URI");
 }
 } else {
 /* The URI is chars or String, and has been sent using an in-memory


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