Re: javax.tools based JSP compiler

2019-05-13 Thread Emmanuel Bourg
Le 13/05/2019 à 12:17, Mark Thomas a écrit :

> If I am understanding this all correctly, the proposed way forward is to
> (eventually) replace the Ant compiler with the JSR199 based Javac
> compiler? If so, then +1 from me.

I mostly aim at providing an easy way to use the new language features
in JSPs, removing the legacy Ant compiler is a bonus. This perspective
raises a couple of questions:

- When the Ant compiler could be deprecated/removed? Should we deprecate
in Tomcat 9.0.x and remove in 10, or deprecate in Tomcat 10 and remove
in 11?

- What should be done with the JspServlets configured to use Ant once
the compiler is deprecated/removed? Throw an error or redirect to the
new javac compiler?

Emmanuel Bourg

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



[tomcat] branch master updated: Add async IO API to APR

2019-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 fdaa8c1  Add async IO API to APR
fdaa8c1 is described below

commit fdaa8c1b9ba5ccc2007e0d2d5547eba8f521b7c8
Author: remm 
AuthorDate: Mon May 13 22:58:21 2019 +0200

Add async IO API to APR

This works from what I can see with the testsuite, but will remain
disabled by default forever. I'm adding it for consistency only, based
on the idea it would be easy to implement using the NIO code (it was,
mostly). The major problems with APR and the design this async API are
lack of IO vectoring (this could probably be added), and the need to use
direct buffers. This in turns forces extra flushes on output (maybe the
amount of flushes can be brought down), plus use of the main buffers
(which are direct). So the performance of APR ends up being worse than
NIO(2), while without async it is slightly faster.
---
 java/org/apache/tomcat/util/net/AprEndpoint.java | 390 ++-
 webapps/docs/changelog.xml   |   4 +
 webapps/docs/config/http.xml |  16 +-
 3 files changed, 385 insertions(+), 25 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java 
b/java/org/apache/tomcat/util/net/AprEndpoint.java
index 77c0034..bff1dda 100644
--- a/java/org/apache/tomcat/util/net/AprEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AprEndpoint.java
@@ -21,6 +21,10 @@ import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.SocketTimeoutException;
 import java.nio.ByteBuffer;
+import java.nio.channels.CompletionHandler;
+import java.nio.channels.InterruptedByTimeoutException;
+import java.nio.channels.ReadPendingException;
+import java.nio.channels.WritePendingException;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -28,6 +32,8 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.RejectedExecutionException;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
@@ -115,6 +121,11 @@ public class AprEndpoint extends 
AbstractEndpoint implements SNICallB
 // Need to override the default for maxConnections to align it with 
what
 // was pollerSize (before the two were merged)
 setMaxConnections(8 * 1024);
+// Asynchronous IO has significantly lower performance with APR:
+// - no IO vectoring
+// - mandatory use of direct buffers causing required output buffering
+// - needs extra output flushes due to the buffering
+setUseAsyncIO(false);
 }
 
 // - Properties
@@ -129,10 +140,6 @@ public class AprEndpoint extends 
AbstractEndpoint implements SNICallB
 public boolean getDeferAccept() { return deferAccept; }
 
 
-@Override
-public boolean getUseAsyncIO() { return false; }
-
-
 private boolean ipv6v6only = false;
 public void setIpv6v6only(boolean ipv6v6only) { this.ipv6v6only = 
ipv6v6only; }
 public boolean getIpv6v6only() { return ipv6v6only; }
@@ -350,12 +357,6 @@ public class AprEndpoint extends 
AbstractEndpoint implements SNICallB
 setUseSendfileInternal(false);
 }
 
-// Initialize thread count default for acceptor
-if (acceptorThreadCount == 0) {
-// FIXME: Doesn't seem to work that well with multiple accept 
threads
-acceptorThreadCount = 1;
-}
-
 // Delay accepting of new connections until data is available
 // Only Linux kernels 2.4 + have that implemented
 // on other platforms this call is noop and will return APR_ENOTIMPL.
@@ -732,8 +733,14 @@ public class AprEndpoint extends 
AbstractEndpoint implements SNICallB
  * socket should be closed
  */
 protected boolean processSocket(long socket, SocketEvent event) {
-SocketWrapperBase socketWrapper = 
connections.get(Long.valueOf(socket));
-return processSocket(socketWrapper, event, true);
+AprSocketWrapper socketWrapper = connections.get(Long.valueOf(socket));
+if (event == SocketEvent.OPEN_READ && socketWrapper.readOperation != 
null) {
+return socketWrapper.readOperation.process();
+} else if (event == SocketEvent.OPEN_WRITE && 
socketWrapper.writeOperation != null) {
+return socketWrapper.writeOperation.process();
+} else {
+return processSocket(socketWrapper, event, true);
+}
 }
 
 
@@ -1322,9 +1329,17 @@ public class AprEndpoint 

small extension for Tomcat in ApacheConNA2019

2019-05-13 Thread jean-frederic clere
Hi,

We have a small extension for The Tomcat track in ApacheConNA2019 CfP
until Tuesday 23h59 GMT! Go and submit now ;-)

-- 
Cheers

Jean-Frederic

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



[Bug 63403] TestHttp2InitialConnection test is failing on a non-English PC (i18n)

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

Mark Thomas  changed:

   What|Removed |Added

 OS||All
 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Mark Thomas  ---
Fixed in:
- master for 9.0.21 onwards
- 8.5.x for 8.5.42 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



[tomcat] branch 8.5.x updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63403

2019-05-13 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 c7095ae  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63403
c7095ae is described below

commit c7095aeb50c10c972fdd22b98000401fc199
Author: Konstantin Kolinko 
AuthorDate: Sun May 5 17:13:48 2019 +0300

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

Fix TestHttp2InitialConnection test failures on a non-English PC.

1. The language was hard-coded as "en".
2. The length check was off, as String.getBytes() uses OS default code 
page, but the actual response is in UTF-8.
---
 test/org/apache/coyote/http2/TestHttp2InitialConnection.java | 10 ++
 webapps/docs/changelog.xml   |  8 +++-
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/test/org/apache/coyote/http2/TestHttp2InitialConnection.java 
b/test/org/apache/coyote/http2/TestHttp2InitialConnection.java
index 61a9fbd..c1c0702 100644
--- a/test/org/apache/coyote/http2/TestHttp2InitialConnection.java
+++ b/test/org/apache/coyote/http2/TestHttp2InitialConnection.java
@@ -118,12 +118,14 @@ public class TestHttp2InitialConnection extends 
Http2TestBase {
  */
 int serverInfoLength = 
ServerInfo.getServerInfo().getBytes().length;
 StringManager sm = 
StringManager.getManager(ErrorReportValve.class);
-int statusHeaderLength = sm.getString(
-"errorReportValve.statusHeader", "", "").getBytes().length;
+int statusHeaderLength = sm
+.getString("errorReportValve.statusHeader", "", "")
+.getBytes(StandardCharsets.UTF_8).length;
 int len = 1073 + serverInfoLength + statusHeaderLength * 2;
 String contentLength = String.valueOf(len);
-return getResponseBodyFrameTrace(streamId, 
testData.getExpectedStatus(),
-"text/html;charset=utf-8", "en", contentLength, 
contentLength);
+return getResponseBodyFrameTrace(streamId,
+testData.getExpectedStatus(), "text/html;charset=utf-8",
+sm.getLocale().getLanguage(), contentLength, 
contentLength);
 } else {
 Assert.fail();
 // To keep the IDE happy
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 6d28e08..51daa4b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -74,7 +74,13 @@
   
   
 
-  Switch from FindBugs to SpotBugs. (fschumacher)
+  
+Switch from FindBugs to SpotBugs. (fschumacher)
+  
+  
+63403: Fix TestHttp2InitialConnection test failures when
+running with a non-English locale. (kkolinko)
+  
 
   
 


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



[tomcat] branch master updated (0ec8370 -> a6cda98)

2019-05-13 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 0ec8370  Silence an IDE warning
 add a6cda98  Improve clean-up after an OOME during request processing

No new revisions were added by this update.

Summary of changes:
 .../apache/catalina/core/StandardWrapperValve.java | 79 +++---
 java/org/apache/coyote/AbstractProtocol.java   |  8 ++-
 java/org/apache/coyote/LocalStrings.properties |  1 +
 webapps/docs/changelog.xml |  4 ++
 4 files changed, 51 insertions(+), 41 deletions(-)


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



[GitHub] [tomcat] farnulfo commented on issue #165: Implementation of SameSite cookie attribute

2019-05-13 Thread GitBox
farnulfo commented on issue #165:  Implementation of SameSite cookie attribute
URL: https://github.com/apache/tomcat/pull/165#issuecomment-491922297
 
 
   I'm really sorry I didn't see the PR 
https://github.com/apache/tomcat/pull/162 .
   I closed mine.


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


With regards,
Apache Git Services

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



[GitHub] [tomcat] farnulfo closed pull request #165: Implementation of SameSite cookie attribute

2019-05-13 Thread GitBox
farnulfo closed pull request #165:  Implementation of SameSite cookie attribute
URL: https://github.com/apache/tomcat/pull/165
 
 
   


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


With regards,
Apache Git Services

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



[GitHub] [tomcat] farnulfo opened a new pull request #165: Implementation of SameSite cookie attribute

2019-05-13 Thread GitBox
farnulfo opened a new pull request #165:  Implementation of SameSite cookie 
attribute
URL: https://github.com/apache/tomcat/pull/165
 
 
   # Introduction
   Hi folks, this pull request is an attemp to implement the SameSite cookie 
attribute according to 
https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03 .
   
   The main objective is to reduce the CSRF vulnerability.
   Some articles : 
   https://web.dev/samesite-cookies-explained
   https://www.owasp.org/index.php/SameSite
   
   As this my first real pull request I'm listening to you :-)
   
   # Implementation:
   This implementation is on two level:
   - In Cookie / CookieGenerator classes
 - Add variable and getter/setter for this attribute
 - Generate the Set-Cookie header with this attribute if needed
   - In Apache Tomcat Context and subclasses
 - Enable the use of SameSite attribute for the session cookie (JSESSIONID) 
which can’t be easily done
   
   Implementation details:
   Classes patched based on what was needed to add HttpOnly (thanks to Mark 
Thomas comment 
http://tomcat.10.x6.nabble.com/Support-SameSite-cookie-attribute-in-Tomcat-td5075308.html
 that helped to identify which classes to edit).
   
   Design :
   Name of the cookie attribute : SameSiteEnforcement (with 
getSameSite/setSameSite methods)
   No boolean/method like isSameSite:
   If not null, the “SameSite” attribute with only allow the following valid 
value : None, Lax, Strict
   I don’t see the need for a isSameSite because we need to get the value which 
is not a boolean (not the case with httpOnly attribute).
   Choice open for discussion. FYI Undertow has isSame and 
(get|set)SameSiteMode : https://github.com/undertow-io/undertow/pull/499
   
   To set the SameSiteEnforcement for session cookie, set it on the Context 
Container like httpOnly before it was true by default or before it was part of 
Java EE standard.
   
   Not sure about ApplicationSessionCookieConfig.java modification : do the 
ApplicationSessionCookieConfig may be have a samesitesite ?
   
   # Next ?
   If you’re ok with the idea, I can go further :
   Add/Polish Javadocs
   Polish context.xml documentation
   Add tests 
   ...
   
   Thansk !


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


With regards,
Apache Git Services

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



[Bug 60174] HeadersTooLargeException should be logged

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

Mark Thomas  changed:

   What|Removed |Added

 CC||ch...@cerskine.com

--- Comment #2 from Mark Thomas  ---
*** Bug 63397 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 63397] Exception should be logged rather than having to increase log level.

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

Mark Thomas  changed:

   What|Removed |Added

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

--- Comment #1 from Mark Thomas  ---
This is already logged at ERROR level.

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

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



[GitHub] [tomcat] markt-asf commented on issue #162: Add support for same-site cookie attribute

2019-05-13 Thread GitBox
markt-asf commented on issue #162: Add support for same-site cookie attribute
URL: https://github.com/apache/tomcat/pull/162#issuecomment-491890888
 
 
   We have no latitude to change any part of a spec API. Being able to set a 
default for this is better than not being able to set anything at all. As and 
when the spec catches up, the per cookie setting can override any application 
wide default.


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


With regards,
Apache Git Services

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



[GitHub] [tomcat] ChristopherSchultz commented on issue #162: Add support for same-site cookie attribute

2019-05-13 Thread GitBox
ChristopherSchultz commented on issue #162: Add support for same-site cookie 
attribute
URL: https://github.com/apache/tomcat/pull/162#issuecomment-491889201
 
 
   Thank you for the proposed patch.
   
   Understanding that changing the definition of a class in the `javax.servlet` 
namespace (namely, `Cookie`) has some challenges, it seems to me that this is 
the wrong approach. I think the right approach is to allow individual cookies 
to have the "samesite" setting set individually.
   
   Changing `Cookie` would allow fewer changes to the core API and the 
`SameSiteCookies` class (which should be an `enum` IMO) would not need to exist.
   
   What are our options when it comes to messing-around with the servlet API 
classes?
   
   Would it be better to apply a variant of this patch wait for another servlet 
spec release to "fix" the Cookie API? Or would it be better to provide another 
(different) container-specific workaround for things in the meantime? As much 
as we all hate system properties, this might be a good time to use one, since 
(a) it's intended to be temporary (pending a spec revision) and (b) it will 
require fewer changes to the internal Tomcat API which will just have to be 
un-done when the spec revision is published.


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


With regards,
Apache Git Services

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



[Bug 63407] EL Compiler can not compile when the EL contains a java reserved word

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

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 OS||All
 Resolution|--- |INVALID

--- Comment #1 from Mark Thomas  ---
>From the EL 2.2 specification:

Identifier ::= Java language identifier

float is not a valid Java identifier because it is a reserved word in Java.

The same constraint was present in the EL 2.1 specification but Tomcat 6 was
not as strict.

In 7.0.x onwards you can disable this additional check using:
-Dorg.apache.el.parser.SKIP_IDENTIFIER_CHECK=false

although the right thing to do would be to fix the app.

-- 
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: JDK 13 - Early Access build 20 is available

2019-05-13 Thread Rory O'Donnell

Thanks for the update Mark!

On 13/05/2019 12:53, Mark Thomas wrote:

On 10/05/2019 09:18, Rory O'Donnell wrote:

Hi Mark,


  *OpenJDK builds *- JDK 13 - Early Access build 20 is available at
  http://jdk.java.net/13/

Builds Tomcat 9.0.x HEAD without error and passes a simple smoke test.

Unit tests pass for 9.0.x HEAD on Linux for NIO, NIO2 and APR/Native
(with Tomcat Native 1.2.21)

Mark


--
Rgds, Rory O'Donnell
Quality Engineering Manager
Oracle EMEA, Dublin, Ireland


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



[tomcat] branch master updated: Silence an IDE warning

2019-05-13 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 0ec8370  Silence an IDE warning
0ec8370 is described below

commit 0ec837068b67ed9d876f0c77d80034be00ab3c9e
Author: Mark Thomas 
AuthorDate: Mon May 13 16:51:30 2019 +0100

Silence an IDE warning
---
 java/org/apache/coyote/http11/Http11NioProtocol.java | 5 +
 1 file changed, 5 insertions(+)

diff --git a/java/org/apache/coyote/http11/Http11NioProtocol.java 
b/java/org/apache/coyote/http11/Http11NioProtocol.java
index e27bc89..92c278c 100644
--- a/java/org/apache/coyote/http11/Http11NioProtocol.java
+++ b/java/org/apache/coyote/http11/Http11NioProtocol.java
@@ -46,6 +46,11 @@ public class Http11NioProtocol extends 
AbstractHttp11JsseProtocol {
 
 //  Pool setup 
 
+/**
+ * NO-OP.
+ *
+ * @param count Unused
+ */
 public void setPollerThreadCount(int count) {
 }
 


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



[GitHub] [tomcat] markt-asf commented on issue #162: Add support for same-site cookie attribute

2019-05-13 Thread GitBox
markt-asf commented on issue #162: Add support for same-site cookie attribute
URL: https://github.com/apache/tomcat/pull/162#issuecomment-491875787
 
 
   Sorry, any new configuration option needs to be added to the docs as well.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[tomcat] branch master updated: Add missing connection id to log message

2019-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 2a56e14  Add missing connection id to log message
2a56e14 is described below

commit 2a56e147dd36bbb6e701c9458b960d6bf6a42935
Author: remm 
AuthorDate: Mon May 13 17:28:30 2019 +0200

Add missing connection id to log message
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index fdc2859..134e501 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -251,7 +251,7 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 try {
 pingManager.sendPing(true);
 } catch (IOException ioe) {
-throw new 
ProtocolException(sm.getString("upgradeHandler.pingFailed"), ioe);
+throw new 
ProtocolException(sm.getString("upgradeHandler.pingFailed", connectionId), ioe);
 }
 
 if (webConnection != null) {


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



[GitHub] [tomcat] markt-asf commented on issue #162: Add support for same-site cookie attribute

2019-05-13 Thread GitBox
markt-asf commented on issue #162: Add support for same-site cookie attribute
URL: https://github.com/apache/tomcat/pull/162#issuecomment-491869493
 
 
   The configuration should be on the CookieProcessor, not the Context. We also 
need to look at https://scotthelme.co.uk/tough-cookies/ but that isn't a 
requirement to get this PR applied.


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


With regards,
Apache Git Services

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



[tomcat] branch master updated: Ensure context default request encoding applies to getReader()

2019-05-13 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 b0a743e  Ensure context default request encoding applies to getReader()
b0a743e is described below

commit b0a743e9ad6ba54f0ab91d0765b2003362ecd656
Author: Mark Thomas 
AuthorDate: Mon May 13 15:16:07 2019 +0100

Ensure context default request encoding applies to getReader()
---
 java/org/apache/catalina/connector/Request.java | 20 +++-
 webapps/docs/changelog.xml  |  5 +
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index db51182..dbcd799 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -1212,13 +1212,31 @@ public class Request implements HttpServletRequest {
 (sm.getString("coyoteRequest.getReader.ise"));
 }
 
+// InputBuffer has no easily accessible reference chain to the Context
+// to check for a default request character encoding at the Context.
+// Therefore, if a Context default should be used, it is set explicitly
+// here. Need to do this before setting usingReader.
+if (coyoteRequest.getCharacterEncoding() == null) {
+// Nothing currently set explicitly.
+// Check the content
+Context context = getContext();
+if (context != null) {
+String enc = context.getRequestCharacterEncoding();
+if (enc != null) {
+// Explicitly set the context default so it is visible to
+// InputBuffer when creating the Reader.
+setCharacterEncoding(enc);
+}
+}
+}
+
 usingReader = true;
+
 inputBuffer.checkConverter();
 if (reader == null) {
 reader = new CoyoteReader(inputBuffer);
 }
 return reader;
-
 }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f81c36e..f34c849 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -54,6 +54,11 @@
 Fix --no-jmx flag processing, which was called after
 registry initialization. (remm)
   
+  
+Ensure that a default request character encoding set on a
+ServletContext is used when calling
+ServletRequest#getReader(). (markt)
+  
 
   
   


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



[GitHub] [tomcat] rmaucher closed pull request #163: Remove multiple pollers from NIO

2019-05-13 Thread GitBox
rmaucher closed pull request #163: Remove multiple pollers from NIO
URL: https://github.com/apache/tomcat/pull/163
 
 
   


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


With regards,
Apache Git Services

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



[GitHub] [tomcat] rmaucher commented on issue #163: Remove multiple pollers from NIO

2019-05-13 Thread GitBox
rmaucher commented on issue #163: Remove multiple pollers from NIO
URL: https://github.com/apache/tomcat/pull/163#issuecomment-491806081
 
 
   Commited as e813ae0d9329ebf4b95c02043c39c676edb47d3c since nobody complained 
about it.


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


With regards,
Apache Git Services

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



[tomcat] branch master updated: Remove poller thread count from NIO connector

2019-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 e813ae0  Remove poller thread count from NIO connector
e813ae0 is described below

commit e813ae0d9329ebf4b95c02043c39c676edb47d3c
Author: remm 
AuthorDate: Mon May 13 14:40:36 2019 +0200

Remove poller thread count from NIO connector

Simplify code when possible. As the poller is set for the connector,
onlythe NioChannel and NioSocketWrapper have a dynamic association. I
will close PR163.
---
 .../apache/coyote/http11/Http11NioProtocol.java|   3 +-
 .../tomcat/util/net/NioBlockingSelector.java   |   4 +-
 java/org/apache/tomcat/util/net/NioChannel.java|  32 ++---
 java/org/apache/tomcat/util/net/NioEndpoint.java   | 145 -
 webapps/docs/changelog.xml |   6 +-
 webapps/docs/config/http.xml   |  12 --
 6 files changed, 75 insertions(+), 127 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11NioProtocol.java 
b/java/org/apache/coyote/http11/Http11NioProtocol.java
index e79390b..e27bc89 100644
--- a/java/org/apache/coyote/http11/Http11NioProtocol.java
+++ b/java/org/apache/coyote/http11/Http11NioProtocol.java
@@ -47,11 +47,10 @@ public class Http11NioProtocol extends 
AbstractHttp11JsseProtocol {
 //  Pool setup 
 
 public void setPollerThreadCount(int count) {
-((NioEndpoint)getEndpoint()).setPollerThreadCount(count);
 }
 
 public int getPollerThreadCount() {
-return ((NioEndpoint)getEndpoint()).getPollerThreadCount();
+return 1;
 }
 
 public void setSelectorTimeout(long timeout) {
diff --git a/java/org/apache/tomcat/util/net/NioBlockingSelector.java 
b/java/org/apache/tomcat/util/net/NioBlockingSelector.java
index d723c7a..eb8d511 100644
--- a/java/org/apache/tomcat/util/net/NioBlockingSelector.java
+++ b/java/org/apache/tomcat/util/net/NioBlockingSelector.java
@@ -82,7 +82,7 @@ public class NioBlockingSelector {
  */
 public int write(ByteBuffer buf, NioChannel socket, long writeTimeout)
 throws IOException {
-SelectionKey key = 
socket.getIOChannel().keyFor(socket.getPoller().getSelector());
+SelectionKey key = 
socket.getIOChannel().keyFor(socket.getSocketWrapper().getPoller().getSelector());
 if (key == null) {
 throw new 
IOException(sm.getString("nioBlockingSelector.keyNotRegistered"));
 }
@@ -158,7 +158,7 @@ public class NioBlockingSelector {
  * @throws IOException if an IO Exception occurs in the underlying socket 
logic
  */
 public int read(ByteBuffer buf, NioChannel socket, long readTimeout) 
throws IOException {
-SelectionKey key = 
socket.getIOChannel().keyFor(socket.getPoller().getSelector());
+SelectionKey key = 
socket.getIOChannel().keyFor(socket.getSocketWrapper().getPoller().getSelector());
 if (key == null) {
 throw new 
IOException(sm.getString("nioBlockingSelector.keyNotRegistered"));
 }
diff --git a/java/org/apache/tomcat/util/net/NioChannel.java 
b/java/org/apache/tomcat/util/net/NioChannel.java
index 4bc865c..01222e6 100644
--- a/java/org/apache/tomcat/util/net/NioChannel.java
+++ b/java/org/apache/tomcat/util/net/NioChannel.java
@@ -21,11 +21,10 @@ import java.nio.ByteBuffer;
 import java.nio.channels.ByteChannel;
 import java.nio.channels.GatheringByteChannel;
 import java.nio.channels.ScatteringByteChannel;
-import java.nio.channels.SelectionKey;
 import java.nio.channels.Selector;
 import java.nio.channels.SocketChannel;
 
-import org.apache.tomcat.util.net.NioEndpoint.Poller;
+import org.apache.tomcat.util.net.NioEndpoint.NioSocketWrapper;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
@@ -42,12 +41,10 @@ public class NioChannel implements ByteChannel, 
ScatteringByteChannel, Gathering
 protected static final ByteBuffer emptyBuf = ByteBuffer.allocate(0);
 
 protected SocketChannel sc = null;
-protected SocketWrapperBase socketWrapper = null;
+protected NioSocketWrapper socketWrapper = null;
 
 protected final SocketBufferHandler bufHandler;
 
-protected Poller poller;
-
 public NioChannel(SocketChannel channel, SocketBufferHandler bufHandler) {
 this.sc = channel;
 this.bufHandler = bufHandler;
@@ -63,11 +60,18 @@ public class NioChannel implements ByteChannel, 
ScatteringByteChannel, Gathering
 }
 
 
-void setSocketWrapper(SocketWrapperBase socketWrapper) {
+void setSocketWrapper(NioSocketWrapper socketWrapper) {
 this.socketWrapper = socketWrapper;
 }
 
 /**
+ * @return the socketWrapper
+ */
+NioSocketWrapper getSocketWrapper() {
+return socketWrapper;
+}
+
+/**
  * Free the channel memory
  */
 publi

[tomcat] branch master updated: Forgot to stage the main resource file ...

2019-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 6c3da66  Forgot to stage the main resource file ...
6c3da66 is described below

commit 6c3da66137339efc26b273ada433d83c3df7dd4a
Author: remm 
AuthorDate: Mon May 13 14:29:31 2019 +0200

Forgot to stage the main resource file ...
---
 java/org/apache/coyote/http2/LocalStrings.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http2/LocalStrings.properties 
b/java/org/apache/coyote/http2/LocalStrings.properties
index b949f28..3527b30 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -54,7 +54,7 @@ http2Parser.headers.wrongStream=Connection [{0}], headers in 
progress for stream
 http2Parser.invalidBuffers=Reading should be done with two buffers
 http2Parser.nonZeroPadding=Connection [{0}], Stream [{1}], Non-zero padding 
received
 http2Parser.payloadTooBig=The payload is [{0}] bytes long but the maximum 
frame size is [{1}]
-http2Parser.preface.invalid=Invalid connection preface [{0}] presented
+http2Parser.preface.invalid=Invalid connection preface presented
 http2Parser.preface.io=Unable to read connection preface
 http2Parser.processFrame=Connection [{0}], Stream [{1}], Frame type [{2}], 
Flags [{3}], Payload size [{4}]
 http2Parser.processFrame.tooMuchPadding=Connection [{0}], Stream [{1}], The 
padding length [{2}] was too big for the payload [{3}]


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



[tomcat] branch master updated: Fix message (no param used)

2019-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 263f9f9  Fix message (no param used)
263f9f9 is described below

commit 263f9f936d48b48906b84a5c7b1aa117676186d5
Author: remm 
AuthorDate: Mon May 13 14:13:06 2019 +0200

Fix message (no param used)
---
 java/org/apache/coyote/http2/LocalStrings_es.properties | 2 +-
 java/org/apache/coyote/http2/LocalStrings_fr.properties | 2 +-
 java/org/apache/coyote/http2/LocalStrings_ja.properties | 2 +-
 java/org/apache/coyote/http2/LocalStrings_ko.properties | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/coyote/http2/LocalStrings_es.properties 
b/java/org/apache/coyote/http2/LocalStrings_es.properties
index 04be2e3..9370a58 100644
--- a/java/org/apache/coyote/http2/LocalStrings_es.properties
+++ b/java/org/apache/coyote/http2/LocalStrings_es.properties
@@ -27,7 +27,7 @@ hpack.invalidCharacter=El carácter Unicode [{0}] en el punto 
del código [{1}]
 
 http2Parser.headerLimitSize=Conexión [{0}], Flujo [{1}], Tamaño total de la 
cabecera my grade
 http2Parser.headers.wrongStream=La conexión [{0}], tiene cabeceras en progreso 
para stream [{1}] pero un frame para stream [{2}] fue recibido
-http2Parser.preface.invalid=Se presentó un prefacio de conexión inválido [{0}]
+http2Parser.preface.invalid=Se presentó un prefacio de conexión inválido
 http2Parser.processFrameData.window=Conexión [{0}], El cliente mandó más datos 
que los permitidos por el flujo de ventana.
 http2Parser.processFrameHeaders.decodingDataLeft=Datos sobrantes luego de 
decodificar HPACK  - Estos datos se deberían haber consumido
 http2Parser.processFramePushPromise=Conexión [{0}], Flujo [{1}], Push promise 
frames no deben ser enviadas por el cliente
diff --git a/java/org/apache/coyote/http2/LocalStrings_fr.properties 
b/java/org/apache/coyote/http2/LocalStrings_fr.properties
index 203c0eb..2f73858 100644
--- a/java/org/apache/coyote/http2/LocalStrings_fr.properties
+++ b/java/org/apache/coyote/http2/LocalStrings_fr.properties
@@ -52,7 +52,7 @@ http2Parser.headers.wrongStream=Connection [{0}], en têtes en 
cours pour le flu
 http2Parser.invalidBuffers=La lecture doit être faite avec deux buffers
 http2Parser.nonZeroPadding=Connection [{0}], Stream [{1}], rembourrage 
(padding) non-zéro recu
 http2Parser.payloadTooBig=La taille des données est de [{0}] octets mais la 
taille maximale de la trame est de [{1}]
-http2Parser.preface.invalid=Une préface de connection invalide [{0}] a été 
présentée
+http2Parser.preface.invalid=Une préface de connection invalide a été présentée
 http2Parser.preface.io=Impossible de lire la préface de la connection
 http2Parser.processFrame=Connection [{0}], Flux [{1}], Type de trame [{2}], 
Drapeaux [{3}], Taille des données [{4}]
 http2Parser.processFrame.tooMuchPadding=Connection [{0}], Flux [{1}], La 
taille [{2}] des données tampon est trop grosse pour la taille de données [{3}]
diff --git a/java/org/apache/coyote/http2/LocalStrings_ja.properties 
b/java/org/apache/coyote/http2/LocalStrings_ja.properties
index 46f8023..0f69b6e 100644
--- a/java/org/apache/coyote/http2/LocalStrings_ja.properties
+++ b/java/org/apache/coyote/http2/LocalStrings_ja.properties
@@ -51,7 +51,7 @@ http2Parser.headers.wrongStream=接続[{0}]、ストリーム[{1}]のヘッダ
 http2Parser.invalidBuffers=読み込みは2つのバッファで行う必要があります。
 http2Parser.nonZeroPadding=コネクション[{0}]、ストリーム[{1}]、非ゼロのパディングを受信しました。
 http2Parser.payloadTooBig=ペイロードの長さは[{0}]バイトですが、最大フレームサイズは[{1}]です
-http2Parser.preface.invalid=無効なコネクションpreface {0}]が提示されました
+http2Parser.preface.invalid=無効なコネクションpreface が提示されました
 http2Parser.preface.io=コネクションprefaceを読むことができません。
 
http2Parser.processFrame=コネクション[{0}]、ストリーム[{1}]、フレームタイプ[{2}]、フラグ[{3}]、ペイロードサイズ[{4}]
 http2Parser.processFrame.tooMuchPadding=コネクション [{0}]、ストリーム [{1}]、ペイロード [{3}] 
に対してパディング長 [{2}] は大きすぎます。
diff --git a/java/org/apache/coyote/http2/LocalStrings_ko.properties 
b/java/org/apache/coyote/http2/LocalStrings_ko.properties
index f2072bc..c4f3bc2 100644
--- a/java/org/apache/coyote/http2/LocalStrings_ko.properties
+++ b/java/org/apache/coyote/http2/LocalStrings_ko.properties
@@ -52,7 +52,7 @@ http2Parser.headers.wrongStream=연결 [{0}]: 스트림 [{1}]의 헤더들을 
 http2Parser.invalidBuffers=읽기는 두 개의 버퍼들과 함께 이루어져야 합니다.
 http2Parser.nonZeroPadding=연결 [{0}], 스트림 [{1}], 0이 아닌 padding을 받았습니다.
 http2Parser.payloadTooBig=Payload의 길이가 [{0}]바이트이지만, 최대 프레임 크기는 [{1}]입니다.
-http2Parser.preface.invalid=유효하지 않은 연결 preface [{0}]이(가) 제공되었습니다.
+http2Parser.preface.invalid=유효하지 않은 연결 preface 이(가) 제공되었습니다.
 http2Parser.preface.io=연결 preface를 읽을 수 없습니다.
 http2Parser.processFrame=연결 [{0}], 스트림 [{1}], 프레임 타입 [{2}], 플래그들 [{3}], 
Payload 크기 [{4}]
 http2Parser.processFrame.tooMuchPadding=연결 [{0}], 스트림 [{1}], padding 길이 
[{2}]은(는) payload [{3}]을(를) 위해 너무 큽니다.


--

Re: JDK 13 - Early Access build 20 is available

2019-05-13 Thread Mark Thomas
On 10/05/2019 09:18, Rory O'Donnell wrote:
> 
> Hi Mark,
> 
> 
>  *OpenJDK builds *- JDK 13 - Early Access build 20 is available at
>  http://jdk.java.net/13/

Builds Tomcat 9.0.x HEAD without error and passes a simple smoke test.

Unit tests pass for 9.0.x HEAD on Linux for NIO, NIO2 and APR/Native
(with Tomcat Native 1.2.21)

Mark

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



[tomcat] 02/02: Fix javadoc warning

2019-05-13 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

commit 528058511246d702698feb0fc542f28412adfab3
Author: Mark Thomas 
AuthorDate: Mon May 13 12:51:44 2019 +0100

Fix javadoc warning
---
 java/org/apache/catalina/servlets/DefaultServlet.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java 
b/java/org/apache/catalina/servlets/DefaultServlet.java
index fdcb1da..5920470 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -2745,7 +2745,7 @@ public class DefaultServlet extends HttpServlet {
  * @param resources The array to sort.
  * @param order The ordering string.
  *
- * @see {@link #getOrder(String)}
+ * @see #getOrder(String)
  */
 public void sort(WebResource[] resources, String order) {
 Comparator comparator = getComparator(order);


-
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 (50ea37e -> 5280585)

2019-05-13 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 50ea37e  Fix concurrency issue that caused intermittent h2 test 
failures
 new 6c7d587  Fix unused import warnings
 new 5280585  Fix javadoc warning

The 2 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:
 java/org/apache/catalina/servlets/DefaultServlet.java  | 2 +-
 java/org/apache/tomcat/util/net/Nio2Endpoint.java  | 3 ---
 java/org/apache/tomcat/util/net/SocketWrapperBase.java | 4 
 3 files changed, 1 insertion(+), 8 deletions(-)


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



[tomcat] 01/02: Fix unused import warnings

2019-05-13 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

commit 6c7d587975ed47ca123a0f4513d75c887b6af464
Author: Mark Thomas 
AuthorDate: Mon May 13 12:51:38 2019 +0100

Fix unused import warnings
---
 java/org/apache/tomcat/util/net/Nio2Endpoint.java  | 3 ---
 java/org/apache/tomcat/util/net/SocketWrapperBase.java | 4 
 2 files changed, 7 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/Nio2Endpoint.java 
b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
index 68c4136..aa59715 100644
--- a/java/org/apache/tomcat/util/net/Nio2Endpoint.java
+++ b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
@@ -49,9 +49,6 @@ import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.collections.SynchronizedStack;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
-import org.apache.tomcat.util.net.SocketWrapperBase.BlockingMode;
-import org.apache.tomcat.util.net.SocketWrapperBase.CompletionHandlerCall;
-import org.apache.tomcat.util.net.SocketWrapperBase.CompletionState;
 import org.apache.tomcat.util.net.jsse.JSSESupport;
 
 /**
diff --git a/java/org/apache/tomcat/util/net/SocketWrapperBase.java 
b/java/org/apache/tomcat/util/net/SocketWrapperBase.java
index b3d7e1e..658d4e4 100644
--- a/java/org/apache/tomcat/util/net/SocketWrapperBase.java
+++ b/java/org/apache/tomcat/util/net/SocketWrapperBase.java
@@ -26,10 +26,6 @@ import 
java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
-import org.apache.tomcat.util.net.SocketWrapperBase.BlockingMode;
-import org.apache.tomcat.util.net.SocketWrapperBase.CompletionCheck;
-import org.apache.tomcat.util.net.SocketWrapperBase.CompletionHandlerCall;
-import org.apache.tomcat.util.net.SocketWrapperBase.CompletionState;
 import org.apache.tomcat.util.res.StringManager;
 
 public abstract class SocketWrapperBase {


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



Re: javax.tools based JSP compiler

2019-05-13 Thread Mark Thomas
On 11/05/2019 21:23, Emmanuel Bourg wrote:
> Le 11/05/2019 à 00:46, Emmanuel Bourg a écrit :
> 
>> - I'm not sure about the performance, ECJ was known to be faster than
>> javac in the past but I don't know if it's still true today.
> 
> I ran a quick test on an old Core 2 Duo with a SSD, compiling Tomcat and
> another Ant based project of mine. The Eclipse compiler is still faster
> than javac, by ~40%.

Thanks for all the explanations.

The performance testing is also interesting.

If I am understanding this all correctly, the proposed way forward is to
(eventually) replace the Ant compiler with the JSR199 based Javac
compiler? If so, then +1 from me.

Mark

-
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 concurrency issue that caused intermittent h2 test failures

2019-05-13 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 50ea37e  Fix concurrency issue that caused intermittent h2 test 
failures
50ea37e is described below

commit 50ea37ec4ccdabb615b53744c7c242970bb4ae7a
Author: Mark Thomas 
AuthorDate: Mon May 13 11:13:38 2019 +0100

Fix concurrency issue that caused intermittent h2 test failures

The Stream object was being used for both Stream window allocations and
connection window allocations. If a stream allocation occurred while
waiting for a connection allocation (and vice versa) processing would
continue on the incorrect assumption that the allocation being waited
for had occurred.
---
 .../apache/coyote/http2/Http2UpgradeHandler.java   | 60 --
 .../apache/coyote/http2/LocalStrings.properties|  5 +-
 java/org/apache/coyote/http2/Stream.java   | 22 ++--
 test/org/apache/coyote/http2/Http2TestBase.java| 10 ++--
 webapps/docs/changelog.xml |  4 ++
 5 files changed, 64 insertions(+), 37 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index a9ab68d..ffb0919 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -752,10 +752,11 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
 
 
 int reserveWindowSize(Stream stream, int reservation, boolean block) 
throws IOException {
-// Need to be holding the stream lock so releaseBacklog() can't notify
-// this thread until after this thread enters wait()
+// Need to be holding the connection allocation lock so 
releaseBacklog()
+// can't notify this thread until after this thread enters wait()
 int allocation = 0;
-synchronized (stream) {
+Object connectionAllocationLock = stream.getConnectionAllocationLock();
+synchronized (connectionAllocationLock) {
 do {
 synchronized (this) {
 if (!stream.canWrite()) {
@@ -810,22 +811,30 @@ public class Http2UpgradeHandler extends AbstractStream 
implements InternalHttpU
 // timeout
 long writeTimeout = protocol.getWriteTimeout();
 if (writeTimeout < 0) {
-stream.wait();
+connectionAllocationLock.wait();
 } else {
-stream.wait(writeTimeout);
-}
-// Has this stream been granted an allocation
-// Note: If the stream in not in this Map then the
-//   requested write has been fully allocated
-int[] value = backLogStreams.get(stream);
-if (value != null && value[1] == 0) {
-// No allocation
-// Close the connection. Do this first since
-// closing the stream will raise an exception
-close();
-// Close the stream (in app code so need to
-// signal to app stream is closing)
-stream.doWriteTimeout();
+connectionAllocationLock.wait(writeTimeout);
+// Has this stream been granted an allocation
+// Note: If the stream in not in this Map then 
the
+//   requested write has been fully 
allocated
+int[] value;
+// Ensure allocations made in other threads 
are visible
+synchronized (this) {
+value = backLogStreams.get(stream);
+}
+if (value != null && value[1] == 0) {
+if (log.isDebugEnabled()) {
+
log.debug(sm.getString("upgradeHandler.noAllocation",
+connectionId, 
stream.getIdentifier()));
+}
+// No allocation
+// Close the connection. Do this first 
since
+// closing the stream will raise an 
exception
+close();
+// Close the stream (in app code so need to
+  

[tomcat] branch master updated: Remove now dead code

2019-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 cf8a91a  Remove now dead code
cf8a91a is described below

commit cf8a91a49b743bda8497753f563368b5983d36bb
Author: remm 
AuthorDate: Mon May 13 11:27:48 2019 +0200

Remove now dead code
---
 java/org/apache/tomcat/util/net/Nio2Endpoint.java | 5 -
 1 file changed, 5 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/Nio2Endpoint.java 
b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
index d61803c..b56cbad 100644
--- a/java/org/apache/tomcat/util/net/Nio2Endpoint.java
+++ b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
@@ -141,11 +141,6 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint

[tomcat] 01/02: Update comments

2019-05-13 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

commit 95b65e0603f4bbcc413cdf621fdbffbd6ba2def2
Author: Mark Thomas 
AuthorDate: Mon May 13 09:38:35 2019 +0100

Update comments
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index 3c8d4e4..fdc2859 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -748,8 +748,8 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 
 
 int reserveWindowSize(Stream stream, int reservation, boolean block) 
throws IOException {
-// Need to be holding the stream lock so releaseBacklog() can't notify
-// this thread until after this thread enters wait()
+// Need to be holding the connection allocation lock so 
releaseBacklog()
+// can't notify this thread until after this thread enters wait()
 int allocation = 0;
 Object connectionAllocationLock = stream.getConnectionAllocationLock();
 synchronized (connectionAllocationLock) {
@@ -848,7 +848,7 @@ class Http2UpgradeHandler extends AbstractStream implements 
InternalHttpUpgradeH
 
 
 
-@SuppressWarnings("sync-override") // notifyAll() needs to be outside sync
+@SuppressWarnings("sync-override") // notify() needs to be outside sync
// to avoid deadlock
 @Override
 protected void incrementWindowSize(int increment) throws Http2Exception {


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



[tomcat] branch master updated (44fbe2c -> 61bb221)

2019-05-13 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 44fbe2c  More Graal tweaks and docs
 new 95b65e0  Update comments
 new 61bb221  Fix typo

The 2 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:
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 6 +++---
 webapps/docs/changelog.xml| 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)


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



[tomcat] 02/02: Fix typo

2019-05-13 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

commit 61bb22183b51cc631e9c26c55cf04ac74a7e0823
Author: Mark Thomas 
AuthorDate: Mon May 13 09:38:42 2019 +0100

Fix typo
---
 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 ba292ad..1084c95 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -64,7 +64,7 @@
 this. (remm)
   
   
-Fix concurrency issue that lean to incorrect HTTP/2 connection timeout.
+Fix concurrency issue that lead to incorrect HTTP/2 connection timeout.
 (remm/markt)
   
   


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



[tomcat] branch master updated: More Graal tweaks and docs

2019-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 44fbe2c  More Graal tweaks and docs
44fbe2c is described below

commit 44fbe2c47b43232d47e43134faf56084e3217408
Author: remm 
AuthorDate: Mon May 13 10:18:04 2019 +0200

More Graal tweaks and docs

There's still a lot I need to test, fix and verify ...
---
 java/org/apache/catalina/loader/WebappClassLoaderBase.java | 10 ++
 res/tomcat-maven/README.md | 11 +++
 res/tomcat-maven/tomcat-reflection.json|  1 +
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java 
b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
index 1ee573b..7418744 100644
--- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java
+++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
@@ -1614,19 +1614,21 @@ public abstract class WebappClassLoaderBase extends 
URLClassLoader
 }
 }
 
-// De-register any remaining JDBC drivers
-clearReferencesJdbc();
+if (!JreCompat.isGraalAvailable()) {
+// De-register any remaining JDBC drivers
+clearReferencesJdbc();
+}
 
 // Stop any threads the web application started
 clearReferencesThreads();
 
 // Clear any references retained in the serialization caches
-if (clearReferencesObjectStreamClassCaches) {
+if (clearReferencesObjectStreamClassCaches && 
!JreCompat.isGraalAvailable()) {
 clearReferencesObjectStreamClassCaches();
 }
 
 // Check for leaks triggered by ThreadLocals loaded by this class 
loader
-if (clearReferencesThreadLocals) {
+if (clearReferencesThreadLocals && !JreCompat.isGraalAvailable()) {
 checkThreadLocalsForLeaks();
 }
 
diff --git a/res/tomcat-maven/README.md b/res/tomcat-maven/README.md
index 2afbf36..170939a 100644
--- a/res/tomcat-maven/README.md
+++ b/res/tomcat-maven/README.md
@@ -80,8 +80,6 @@ oc policy add-role-to-user view system:serviceaccount:$(oc 
project -q):default -
 
 ## Native Image
 
-Note: Graal support in Tomcat is not functional yet.
-
 Download Graal native-image and tools.
 ```
 export JAVA_HOME=/absolute...path...to/graalvm-ce-19.0.0
@@ -89,16 +87,21 @@ export TOMCAT_MAVEN=/absolute...path...to/tomcat-maven
 cd $JAVA_HOME/bin
 ./gu install native-image
 ```
+As Graal does not support dynamic class loading, all Servlets and support 
classes of the webapp, which would traditionally be placed
+in `/WEB-INF/classes` and `/WEB-INF/lib`, must be included as part of the 
tomcat-maven build process, so they are packaged into the
+`target/tomcat-maven-1.0.jar`.
+
 Run Tomcat with the agent in full trace mode.
 ```
 cd $TOMCAT_MAVEN
 $JAVA_HOME/bin/java 
-agentlib:native-image-agent=trace-output=$TOMCAT_MAVEN/target/trace-file.json 
-jar target/tomcat-maven-1.0.jar
 ```
-Then exercise necessary paths of your service with the Tomcat configuration. 
Do not try to run any JSPs.
+Then exercise necessary paths of your service with the Tomcat configuration. 
Any changes to the Tomcat configuration requires running
+the substrate VM with the agent again.
 
 Generate the final json files using native-image-configuration then use native 
image using the generated reflection metadata:
 ```
 $JAVA_HOME/bin/native-image-configure generate 
--trace-input=$TOMCAT_MAVEN/target/trace-file.json 
--output-dir=$TOMCAT_MAVEN/target
-$JAVA_HOME/bin/native-image --allow-incomplete-classpath 
-H:+ReportUnsupportedElementsAtRuntime 
-H:ConfigurationFileDirectories=$TOMCAT_MAVEN/target/ 
-H:ReflectionConfigurationFiles=$TOMCAT_MAVEN/tomcat-reflection.json 
-H:ResourceConfigurationFiles=$TOMCAT_MAVEN/tomcat-resource.json 
-H:ResourceConfigurationFiles=$TOMCAT_MAVEN/tomcat-resource.json -jar 
$TOMCAT_MAVEN/target/tomcat-maven-1.0.jar
+$JAVA_HOME/bin/native-image --allow-incomplete-classpath 
-H:+ReportUnsupportedElementsAtRuntime -H:EnableURLProtocols=jar 
-H:ConfigurationFileDirectories=$TOMCAT_MAVEN/target/ 
-H:ReflectionConfigurationFiles=$TOMCAT_MAVEN/tomcat-reflection.json 
-H:ResourceConfigurationFiles=$TOMCAT_MAVEN/tomcat-resource.json 
-H:ResourceConfigurationFiles=$TOMCAT_MAVEN/tomcat-resource.json -jar 
$TOMCAT_MAVEN/target/tomcat-maven-1.0.jar
 ./tomcat-maven-1.0 -Dcatalina.base=. 
-Djava.util.logging.config.file=conf/logging.properties 
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
 ```
diff --git a/res/tomcat-maven/tomcat-reflection.json 
b/res/tomcat-maven/tomcat-reflection.json
index d1bbf79..9d799d3 100644
--- a/res/tomcat-maven/tomcat-reflection.json
+++ b/res/tomcat-maven/tomcat-reflection.json
@@ -11,6 +11,7 @@
   "name" : "org.apache.catalina.authenticator.jaspic.A

[tomcat] branch 8.5.x updated: Add 8.5.41 release date

2019-05-13 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 7cc6e5d  Add 8.5.41 release date
7cc6e5d is described below

commit 7cc6e5d180587780dd006bbc201190364963597e
Author: Mark Thomas 
AuthorDate: Mon May 13 09:04:25 2019 +0100

Add 8.5.41 release date
---
 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 e3e1313..eaba5dd 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -74,7 +74,7 @@
 
   
 
-
+
   
 
   


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



[tomcat] branch master updated: Add 9.0.20 release date

2019-05-13 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 73f55ef  Add 9.0.20 release date
73f55ef is described below

commit 73f55efb123e8b458f16f48fa5b8f7ea49f38c8a
Author: Mark Thomas 
AuthorDate: Mon May 13 09:03:27 2019 +0100

Add 9.0.20 release date
---
 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 1946863..ba292ad 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,7 +105,7 @@
 
   
 
-
+
   
 
   


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



svn commit: r34004 - /dev/tomcat/tomcat-8/v8.5.41/ /release/tomcat/tomcat-8/v8.5.41/

2019-05-13 Thread markt
Author: markt
Date: Mon May 13 08:01:23 2019
New Revision: 34004

Log:
Release Apache Tomcat 8.5.41

Added:
release/tomcat/tomcat-8/v8.5.41/
  - copied from r34003, dev/tomcat/tomcat-8/v8.5.41/
Removed:
dev/tomcat/tomcat-8/v8.5.41/


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



svn commit: r34003 - /release/tomcat/tomcat-9/v9.0.17/

2019-05-13 Thread markt
Author: markt
Date: Mon May 13 08:00:43 2019
New Revision: 34003

Log:
Drop Tomcat 9.0.17 from mirrors

Removed:
release/tomcat/tomcat-9/v9.0.17/


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



svn commit: r34002 - /dev/tomcat/tomcat-9/v9.0.20/ /release/tomcat/tomcat-9/v9.0.20/

2019-05-13 Thread markt
Author: markt
Date: Mon May 13 08:00:18 2019
New Revision: 34002

Log:
Release Apache Tomcat 9.0.20

Added:
release/tomcat/tomcat-9/v9.0.20/
  - copied from r34001, dev/tomcat/tomcat-9/v9.0.20/
Removed:
dev/tomcat/tomcat-9/v9.0.20/


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



Re: [VOTE][RESULT] Release Apache Tomcat 8.5.41

2019-05-13 Thread Mark Thomas
The following votes were cast:

Binding:
+1: remm, schultz, isapir, markt

No other votes were cast.

The vote therefore passes.

Thanks to everyone who contributed to this release.

Mark


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



Re: [VOTE] Release Apache Tomcat 8.5.41

2019-05-13 Thread Mark Thomas
On 04/05/2019 10:56, Mark Thomas wrote:

> The proposed 8.5.41 release is:
> [ ] Broken - do not release
> [X] Stable - go ahead and release as 8.5.41

Unit tests pass for NIO, NIO2 and APR/native with Tomcat Native 1.2.21
on Linux, OSX and Windows.

Mark

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



[VOTE][RESULT] Release Apache Tomcat 9.0.20

2019-05-13 Thread Mark Thomas
The following votes were cast:

Binding:
+1: markt, remm, isapir

No other votes were cast.

The vote therefore passes.

I'll note the WebSocket + SecurityManager regression and the HTTP/2
timeout issues in the release announcement.

Thank you to everyone who voted for this release.


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



[tomcat] branch master updated: Avoid other cases of NPEs on stop

2019-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 f562edd  Avoid other cases of NPEs on stop
f562edd is described below

commit f562edd3302866f34c0ca9fa97f6ff414450f1ae
Author: remm 
AuthorDate: Mon May 13 09:43:29 2019 +0200

Avoid other cases of NPEs on stop

As found in the CI logs.
---
 java/org/apache/catalina/core/StandardWrapperValve.java |  2 ++
 java/org/apache/coyote/http11/Http11InputBuffer.java|  9 -
 java/org/apache/coyote/http11/Http11OutputBuffer.java   | 10 +-
 webapps/docs/changelog.xml  |  3 +--
 4 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/core/StandardWrapperValve.java 
b/java/org/apache/catalina/core/StandardWrapperValve.java
index ae7b319..aff0b42 100644
--- a/java/org/apache/catalina/core/StandardWrapperValve.java
+++ b/java/org/apache/catalina/core/StandardWrapperValve.java
@@ -29,6 +29,7 @@ import javax.servlet.ServletException;
 import javax.servlet.UnavailableException;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.catalina.Container;
 import org.apache.catalina.Context;
 import org.apache.catalina.Globals;
 import org.apache.catalina.LifecycleException;
@@ -174,6 +175,7 @@ final class StandardWrapperValve
 
 // Call the filter chain for this request
 // NOTE: This also calls the servlet's service() method
+Container container = this.container;
 try {
 if ((servlet != null) && (filterChain != null)) {
 // Swallow output if needed
diff --git a/java/org/apache/coyote/http11/Http11InputBuffer.java 
b/java/org/apache/coyote/http11/Http11InputBuffer.java
index 15a7e83..5632de2 100644
--- a/java/org/apache/coyote/http11/Http11InputBuffer.java
+++ b/java/org/apache/coyote/http11/Http11InputBuffer.java
@@ -22,6 +22,7 @@ import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 
+import org.apache.coyote.CloseNowException;
 import org.apache.coyote.InputBuffer;
 import org.apache.coyote.Request;
 import org.apache.juli.logging.Log;
@@ -728,7 +729,13 @@ public class Http11InputBuffer implements InputBuffer, 
ApplicationBufferHandler
 byteBuffer.position(byteBuffer.limit());
 }
 byteBuffer.limit(byteBuffer.capacity());
-int nRead = wrapper.read(block, byteBuffer);
+SocketWrapperBase socketWrapper = this.wrapper;
+int nRead = -1;
+if (socketWrapper != null) {
+nRead = socketWrapper.read(block, byteBuffer);
+} else {
+throw new CloseNowException(sm.getString("iib.eof.error"));
+}
 byteBuffer.limit(byteBuffer.position()).reset();
 if (nRead > 0) {
 return true;
diff --git a/java/org/apache/coyote/http11/Http11OutputBuffer.java 
b/java/org/apache/coyote/http11/Http11OutputBuffer.java
index 62d5223..c369837 100644
--- a/java/org/apache/coyote/http11/Http11OutputBuffer.java
+++ b/java/org/apache/coyote/http11/Http11OutputBuffer.java
@@ -21,6 +21,7 @@ import java.nio.ByteBuffer;
 import java.util.Arrays;
 
 import org.apache.coyote.ActionCode;
+import org.apache.coyote.CloseNowException;
 import org.apache.coyote.Response;
 import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.buf.MessageBytes;
@@ -306,6 +307,8 @@ public class Http11OutputBuffer implements HttpOutputBuffer 
{
 SocketWrapperBase socketWrapper = this.socketWrapper;
 if (socketWrapper != null) {
 socketWrapper.write(isBlocking(), headerBuffer);
+} else {
+throw new 
CloseNowException(sm.getString("iob.failedwrite"));
 }
 } finally {
 headerBuffer.position(0).limit(headerBuffer.capacity());
@@ -530,7 +533,12 @@ public class Http11OutputBuffer implements 
HttpOutputBuffer {
 public int doWrite(ByteBuffer chunk) throws IOException {
 try {
 int len = chunk.remaining();
-socketWrapper.write(isBlocking(), chunk);
+SocketWrapperBase socketWrapper = 
Http11OutputBuffer.this.socketWrapper;
+if (socketWrapper != null) {
+socketWrapper.write(isBlocking(), chunk);
+} else {
+throw new 
CloseNowException(sm.getString("iob.failedwrite"));
+}
 len -= chunk.remaining();
 byteCount += len;
 return len;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 72a7da2..1946863 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -81,8 +81,7 @@
 certain microbenchmarks. (remm)
   
   
-Avoid po