[Bug 57767] Websocket client proprietary configuration

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=57767

--- Comment #14 from J Fernandez  ---
(In reply to Remy Maucherat from comment #13)
> Ok, so that's obviously the big item (IMO), that looks good.
> I'm not convinced that digest is useful anymore, do you think it is ? On the
> plus side, you did it already, on the minus side we'll have to maintain the
> feature.

There is not much need for it nowadays given how ubiquitous SSL is. That being
said, it may prove to be useful in certain circumstances. I don't think it
should require too much maintenance.

-- 
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 61489] Disable creation of command line parameters from GET parameters in the URL for CGIServlet

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61489

--- Comment #5 from Christopher Schultz  ---
(In reply to jm009 from comment #4)
> I don't understand...
> My patch already uses .

Sorry, you are correct. I did not read the patch closely enough.

-- 
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 61189] CGIServlet should be able to set specific environment variables

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61189

--- Comment #5 from jm009  ---
Created attachment 35297
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35297=edit
Variable name in .

This patch implements your second suggestion.
For the moment it is my preferred one.
It also is the patch that adds the least number of lines of code :-)

First and second patch would be fine for me 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



[Bug 61189] CGIServlet should be able to set specific environment variables

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61189

--- Comment #4 from jm009  ---
Created attachment 35296
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35296=edit
All variable declarations in one .

So here is a patch, that would implement your first suggestion.
But, while implementing it, I thought of some inconveniences:

- People may think: Oh, I can put whitespace here, so I will do that somewhere
else too...

(- It is impossible, to put a line break in the variable value, or to put white
space at the beginning or the end of the variable value (its probably not used
very often))

I think I'd prefer your second suggestion...
I'll create a patch for that one 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



Release plans

2017-09-05 Thread Mark Thomas
Hi all,

I'm planning to complete the Tomcat Native 1.2.14 release tomorrow,
update 8.5.x and 9.0.x to use it and then tag them.

If there is anything you want me to hold the tags for, please let me know.

Mark

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



[Bug 61489] Disable creation of command line parameters from GET parameters in the URL for CGIServlet

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61489

--- Comment #4 from jm009  ---
I don't understand...
My patch already uses .

The patch as it is makes the feature disabled by default.

-- 
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 61489] Disable creation of command line parameters from GET parameters in the URL for CGIServlet

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61489

Christopher Schultz  changed:

   What|Removed |Added

   Keywords||PatchAvailable

-- 
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 61489] Disable creation of command line parameters from GET parameters in the URL for CGIServlet

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61489

--- Comment #3 from Christopher Schultz  ---
I like the idea of locking this down, but requiring a rebuild-from-source to
change the setting isn't acceptable.

Can you add a new  to control this behavior?

+1 for making it DISABLED by default (i.e. DO NOT CREATE COMMAND-LINE ARGUMENTS
by default).

-- 
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 61189] CGIServlet should be able to set specific environment variables

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61189

Christopher Schultz  changed:

   What|Removed |Added

   Keywords||PatchAvailable

-- 
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 61189] CGIServlet should be able to set specific environment variables

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61189

--- Comment #3 from Christopher Schultz  ---
I don't like the use of unique names that don't have any meaning, like
`environment-variable-N`. Might I suggest one or the other of these schemes:


  environment-variables
  
ENV_VAR_1=foo
ENV_VAR_2=bar
...
  


Or:


environment-variable-ENV_VAR_1
foo


environment-variable-ENV_VAR_2
bar

...


I think I'd prefer the former over the latter.

Second, I think it makes sense to strip whitespace from around the names and
values of the environment variables. Basically, just add ".trim()" to all of
your .substring() calls. This will solve silly problems like people placing
leading/trailing spaces around names/values/equal signs. XML allows a lot of
optional whitespace, and some editors (and humans) like to be verbose.

-- 
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 57767] Websocket client proprietary configuration

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=57767

Christopher Schultz  changed:

   What|Removed |Added

   Keywords||PatchAvailable

-- 
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 57767] Websocket client proprietary configuration

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=57767

--- Comment #13 from Remy Maucherat  ---
Ok, so that's obviously the big item (IMO), that looks good.
I'm not convinced that digest is useful anymore, do you think it is ? On the
plus side, you did it already, on the minus side we'll have to maintain the
feature.

-- 
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: Dynamic reloading of SSL certificates

2017-09-05 Thread Romain Manni-Bucau
Hello guys,

wonder if this thread went anywhere? Would be very neat to have a let's
encrypt integration (don't know if it would be a listener to declare to
have automatic reloading or just a flag on the SSL config but it would ease
deploying self hosted instances).


Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | JavaEE Factory


2017-01-23 23:18 GMT+01:00 Christopher Schultz :

> Mark and Emmanuel,
>
> On 1/23/17 5:01 AM, Mark Thomas wrote:
> > On 23/01/2017 09:36, Emmanuel Bourg wrote:
> >> Hi all,
> >>
> >> With the fast adoption of Let's Encrypt many people are interested in
> >> integrating it with Tomcat. A first step was to ensure that Tomcat can
> >> directly use the PEM certificates generated by the letsencrypt/certbot
> >> client. An important aspect of Let's Encrypt is automation, the
> >> certificates are relatively short lived (90 days) and must be updated
> >> automatically. AFAIK there is no easy way yet to reload a connector in
> >> Tomcat to pick a new certificate. The administrator either has to
> >> restart Tomcat (bad in a production environment) or do some JMX tricks
> >> [1] (but JMX must be enabled and secured properly).
> >>
> >> I'm wondering if it would be possible for Tomcat to monitor the
> >> certificates/keystore files and reload the associated connectors
> >> automatically? If there is a consensus on this feature I'd be interested
> >> in implementing it.
> >
> > For background reading:
> >
> > http://tomcat.markmail.org/thread/fthbtwuozidno6lw
> >
> > http://tomcat.markmail.org/thread/753blzkslmifcvh4
>
> Yep. I'm also planning on giving a presentation about this exact topic
> at ApacheCon in Miami.
>
> -chris
>
>


[Bug 61201] CGIServlet adds too much to the SCRIPT_NAME environment variable if script followed by extra path

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61201

jm009  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #3 from jm009  ---
It seems, that the fix disables calling

http://127.0.0.1:8086/nextcloud/test2.sh/login


It gives:

HTTP Status [404] – [Not Found]

Type Status Report

Description The origin server did not find a current representation for the
target resource or is not willing to disclose that one exists.

-- 
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 61491] New: IllegalArgumentException thrown by PerMessageDeflate sendMessagePart()

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61491

Bug ID: 61491
   Summary: IllegalArgumentException thrown by PerMessageDeflate
sendMessagePart()
   Product: Tomcat 8
   Version: 8.5.20
  Hardware: PC
Status: NEW
  Severity: critical
  Priority: P2
 Component: WebSocket
  Assignee: dev@tomcat.apache.org
  Reporter: email.w...@gmail.com
  Target Milestone: 

This issue is similar to https://bz.apache.org/bugzilla/show_bug.cgi?id=59635
but it is happending in another location of the code.   Please refer to the
following stack.  

compressedPayload.limit() is zero because of the compressedPayload.flip() call.

Sep 04, 2017 11:10:08 PM org.glassfish.jersey.server.ServerRuntime$Responder
writeResponse
SEVERE: Error while closing the output stream in order to commit response.
java.lang.IllegalArgumentException
at java.nio.Buffer.limit(Unknown Source)
at
org.apache.tomcat.websocket.PerMessageDeflate.sendMessagePart(PerMessageDeflate.java:374)
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:341)
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase$TextMessageSendHandler.write(WsRemoteEndpointImplBase.java:803)
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendStringByCompletion(WsRemoteEndpointImplBase.java:212)
at
org.apache.tomcat.websocket.WsRemoteEndpointAsync.sendText(WsRemoteEndpointAsync.java:47)
at
org.atmosphere.container.version.JSR356WebSocket.write(JSR356WebSocket.java:73)
at org.atmosphere.websocket.WebSocket.write(WebSocket.java:255)
at org.atmosphere.websocket.WebSocket.write(WebSocket.java:46)
at
org.atmosphere.cpr.AtmosphereResponseImpl$Stream.write(AtmosphereResponseImpl.java:980)
at
org.glassfish.jersey.servlet.internal.ResponseWriter$NonCloseableOutputStreamWrapper.write(ResponseWriter.java:325)
at java.io.ByteArrayOutputStream.writeTo(Unknown Source)
at
org.glassfish.jersey.message.internal.CommittingOutputStream.flushBuffer(CommittingOutputStream.java:307)
at
org.glassfish.jersey.message.internal.CommittingOutputStream.commit(CommittingOutputStream.java:261)
at
org.glassfish.jersey.message.internal.CommittingOutputStream.close(CommittingOutputStream.java:276)
at
org.glassfish.jersey.message.internal.OutboundMessageContext.close(OutboundMessageContext.java:877)
at
org.glassfish.jersey.server.ContainerResponse.close(ContainerResponse.java:412)
at
org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:784)
at
org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:444)
at
org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:434)
at
org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:329)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:321)
at
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
at
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
at
org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
at
org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
at
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
at
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
at
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
at
com.apriori.async.ws.config.AsyncServletContainer.service(AsyncServletContainer.java:108)
at
org.atmosphere.util.AtmosphereFilterChain.doFilter(AtmosphereFilterChain.java:135)
at
org.atmosphere.util.AtmosphereFilterChain.invokeFilterChain(AtmosphereFilterChain.java:96)
at
org.atmosphere.handler.ReflectorServletProcessor$FilterChainServletWrapper.service(ReflectorServletProcessor.java:337)
at
org.atmosphere.handler.ReflectorServletProcessor.onRequest(ReflectorServletProcessor.java:175)
at
org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:223)
at
org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:115)
at
org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:67)
at

buildbot success in on tomcat-trunk

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

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

Buildslave for this Build: silvanus_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch tomcat/trunk] 1807334
Blamelist: markt

Build succeeded!

Sincerely,
 -The Buildbot




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



svn commit: r1807334 - /tomcat/trunk/test/org/apache/coyote/http2/TestAbstractStream.java

2017-09-05 Thread markt
Author: markt
Date: Tue Sep  5 10:29:11 2017
New Revision: 1807334

URL: http://svn.apache.org/viewvc?rev=1807334=rev
Log:
Fix NPEs in tests after refactoring

Modified:
tomcat/trunk/test/org/apache/coyote/http2/TestAbstractStream.java

Modified: tomcat/trunk/test/org/apache/coyote/http2/TestAbstractStream.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/TestAbstractStream.java?rev=1807334=1807333=1807334=diff
==
--- tomcat/trunk/test/org/apache/coyote/http2/TestAbstractStream.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http2/TestAbstractStream.java Tue Sep  
5 10:29:11 2017
@@ -28,7 +28,7 @@ public class TestAbstractStream {
 @Test
 public void testDependenciesFig3() {
 // Setup
-Http2UpgradeHandler handler = new Http2UpgradeHandler(null, null, 
null);
+Http2UpgradeHandler handler = new Http2UpgradeHandler(new 
Http2Protocol(), null, null);
 Stream a = new Stream(Integer.valueOf(1), handler);
 Stream b = new Stream(Integer.valueOf(2), handler);
 Stream c = new Stream(Integer.valueOf(3), handler);
@@ -59,7 +59,7 @@ public class TestAbstractStream {
 @Test
 public void testDependenciesFig4() {
 // Setup
-Http2UpgradeHandler handler = new Http2UpgradeHandler(null, null, 
null);
+Http2UpgradeHandler handler = new Http2UpgradeHandler(new 
Http2Protocol(), null, null);
 Stream a = new Stream(Integer.valueOf(1), handler);
 Stream b = new Stream(Integer.valueOf(2), handler);
 Stream c = new Stream(Integer.valueOf(3), handler);
@@ -90,7 +90,7 @@ public class TestAbstractStream {
 @Test
 public void testDependenciesFig5NonExclusive() {
 // Setup
-Http2UpgradeHandler handler = new Http2UpgradeHandler(null, null, 
null);
+Http2UpgradeHandler handler = new Http2UpgradeHandler(new 
Http2Protocol(), null, null);
 Stream a = new Stream(Integer.valueOf(1), handler);
 Stream b = new Stream(Integer.valueOf(2), handler);
 Stream c = new Stream(Integer.valueOf(3), handler);
@@ -132,7 +132,7 @@ public class TestAbstractStream {
 @Test
 public void testDependenciesFig5Exclusive() {
 // Setup
-Http2UpgradeHandler handler = new Http2UpgradeHandler(null, null, 
null);
+Http2UpgradeHandler handler = new Http2UpgradeHandler(new 
Http2Protocol(), null, null);
 Stream a = new Stream(Integer.valueOf(1), handler);
 Stream b = new Stream(Integer.valueOf(2), handler);
 Stream c = new Stream(Integer.valueOf(3), handler);
@@ -174,7 +174,7 @@ public class TestAbstractStream {
 @Test
 public void testCircular01() {
 // Setup
-Http2UpgradeHandler handler = new Http2UpgradeHandler(null, null, 
null);
+Http2UpgradeHandler handler = new Http2UpgradeHandler(new 
Http2Protocol(), null, null);
 Stream a = new Stream(Integer.valueOf(1), handler);
 Stream b = new Stream(Integer.valueOf(2), handler);
 Stream c = new Stream(Integer.valueOf(3), handler);
@@ -204,7 +204,7 @@ public class TestAbstractStream {
 @Test
 public void testCircular02() {
 // Setup
-Http2UpgradeHandler handler = new Http2UpgradeHandler(null, null, 
null);
+Http2UpgradeHandler handler = new Http2UpgradeHandler(new 
Http2Protocol(), null, null);
 Stream a = new Stream(Integer.valueOf(1), handler);
 Stream b = new Stream(Integer.valueOf(2), handler);
 Stream c = new Stream(Integer.valueOf(3), handler);



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



buildbot failure in on tomcat-trunk

2017-09-05 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-trunk while building 
. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/2669

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

Buildslave for this Build: silvanus_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch tomcat/trunk] 1807331
Blamelist: markt

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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



svn commit: r1807331 - in /tomcat/trunk/java/org/apache/coyote/http2: Http2Protocol.java Http2UpgradeHandler.java

2017-09-05 Thread markt
Author: markt
Date: Tue Sep  5 09:44:09 2017
New Revision: 1807331

URL: http://svn.apache.org/viewvc?rev=1807331=rev
Log:
Refactor: Obtain ping configuration directly from protocol

Modified:
tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java
tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java

Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java?rev=1807331=1807330=1807331=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java Tue Sep  5 
09:44:09 2017
@@ -101,12 +101,9 @@ public class Http2Protocol implements Up
 @Override
 public InternalHttpUpgradeHandler 
getInternalUpgradeHandler(SocketWrapperBase socketWrapper,
 Adapter adapter, Request coyoteRequest) {
-Http2UpgradeHandler result = (socketWrapper.hasAsyncIO())
+return socketWrapper.hasAsyncIO()
 ? new Http2AsyncUpgradeHandler(this, adapter, coyoteRequest)
 : new Http2UpgradeHandler(this, adapter, coyoteRequest);
-
-result.setInitiatePingDisabled(initiatePingDisabled);
-return result;
 }
 
 
@@ -269,4 +266,9 @@ public class Http2Protocol implements Up
 public void setInitiatePingDisabled(boolean initiatePingDisabled) {
 this.initiatePingDisabled = initiatePingDisabled;
 }
+
+
+public boolean getInitiatePingDisabled() {
+return initiatePingDisabled;
+}
 }

Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java?rev=1807331=1807330=1807331=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java Tue Sep  
5 09:44:09 2017
@@ -150,6 +150,8 @@ class Http2UpgradeHandler extends Abstra
 localSettings.set(Setting.MAX_CONCURRENT_STREAMS, 
protocol.getMaxConcurrentStreams());
 localSettings.set(Setting.INITIAL_WINDOW_SIZE, 
protocol.getInitialWindowSize());
 
+pingManager.initiateDisabled = protocol.getInitiatePingDisabled();
+
 // Initial HTTP request becomes stream 1.
 if (coyoteRequest != null) {
 if (log.isDebugEnabled()) {
@@ -1117,13 +1119,6 @@ class Http2UpgradeHandler extends Abstra
 }
 
 
-// --- Configuration 
getters/setters
-
-public void setInitiatePingDisabled(boolean initiatePingDisabled) {
-pingManager.initiateDisabled = initiatePingDisabled;
-}
-
-
 // --- Http2Parser.Input 
methods
 
 @Override



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



svn commit: r1807327 - in /tomcat/trunk/java/org/apache/coyote/http2: Http2Protocol.java Http2UpgradeHandler.java

2017-09-05 Thread markt
Author: markt
Date: Tue Sep  5 09:43:54 2017
New Revision: 1807327

URL: http://svn.apache.org/viewvc?rev=1807327=rev
Log:
Refactor: Configure local settings directly from protocol

Modified:
tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java
tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java

Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java?rev=1807327=1807326=1807327=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java Tue Sep  5 
09:43:54 2017
@@ -105,9 +105,7 @@ public class Http2Protocol implements Up
 ? new Http2AsyncUpgradeHandler(this, adapter, coyoteRequest)
 : new Http2UpgradeHandler(this, adapter, coyoteRequest);
 
-result.setMaxConcurrentStreams(getMaxConcurrentStreams());
 
result.setMaxConcurrentStreamExecution(getMaxConcurrentStreamExecution());
-result.setInitialWindowSize(getInitialWindowSize());
 result.setAllowedTrailerHeaders(allowedTrailerHeaders);
 result.setMaxHeaderCount(getMaxHeaderCount());
 result.setMaxHeaderSize(getMaxHeaderSize());

Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java?rev=1807327=1807326=1807327=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java Tue Sep  
5 09:43:54 2017
@@ -156,6 +156,9 @@ class Http2UpgradeHandler extends Abstra
 remoteSettings = new ConnectionSettingsRemote(connectionId);
 localSettings = new ConnectionSettingsLocal(connectionId);
 
+localSettings.set(Setting.MAX_CONCURRENT_STREAMS, 
protocol.getMaxConcurrentStreams());
+localSettings.set(Setting.INITIAL_WINDOW_SIZE, 
protocol.getInitialWindowSize());
+
 // Initial HTTP request becomes stream 1.
 if (coyoteRequest != null) {
 if (log.isDebugEnabled()) {
@@ -1125,21 +1128,11 @@ class Http2UpgradeHandler extends Abstra
 
 // --- Configuration 
getters/setters
 
-public void setMaxConcurrentStreams(long maxConcurrentStreams) {
-localSettings.set(Setting.MAX_CONCURRENT_STREAMS, 
maxConcurrentStreams);
-}
-
-
 public void setMaxConcurrentStreamExecution(int 
maxConcurrentStreamExecution) {
 this.maxConcurrentStreamExecution = maxConcurrentStreamExecution;
 }
 
 
-public void setInitialWindowSize(int initialWindowSize) {
-localSettings.set(Setting.INITIAL_WINDOW_SIZE, initialWindowSize);
-}
-
-
 public void setAllowedTrailerHeaders(Set allowedTrailerHeaders) {
 this.allowedTrailerHeaders = allowedTrailerHeaders;
 }



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



svn commit: r1807328 - in /tomcat/trunk/java/org/apache/coyote/http2: Http2Protocol.java Http2UpgradeHandler.java

2017-09-05 Thread markt
Author: markt
Date: Tue Sep  5 09:43:59 2017
New Revision: 1807328

URL: http://svn.apache.org/viewvc?rev=1807328=rev
Log:
Refactor: Access concurrency control directly from protocol

Modified:
tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java
tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java

Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java?rev=1807328=1807327=1807328=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java Tue Sep  5 
09:43:59 2017
@@ -105,7 +105,6 @@ public class Http2Protocol implements Up
 ? new Http2AsyncUpgradeHandler(this, adapter, coyoteRequest)
 : new Http2UpgradeHandler(this, adapter, coyoteRequest);
 
-
result.setMaxConcurrentStreamExecution(getMaxConcurrentStreamExecution());
 result.setAllowedTrailerHeaders(allowedTrailerHeaders);
 result.setMaxHeaderCount(getMaxHeaderCount());
 result.setMaxHeaderSize(getMaxHeaderSize());

Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java?rev=1807328=1807327=1807328=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java Tue Sep  
5 09:43:59 2017
@@ -135,7 +135,6 @@ class Http2UpgradeHandler extends Abstra
 private long backLogSize = 0;
 
 // Stream concurrency control
-private int maxConcurrentStreamExecution = 
Http2Protocol.DEFAULT_MAX_CONCURRENT_STREAM_EXECUTION;
 private AtomicInteger streamConcurrency = null;
 private Queue queuedRunnable = null;
 
@@ -190,7 +189,7 @@ class Http2UpgradeHandler extends Abstra
 }
 
 // Init concurrency control if needed
-if (maxConcurrentStreamExecution < 
localSettings.getMaxConcurrentStreams()) {
+if (protocol.getMaxConcurrentStreamExecution() < 
localSettings.getMaxConcurrentStreams()) {
 streamConcurrency = new AtomicInteger(0);
 queuedRunnable = new ConcurrentLinkedQueue<>();
 }
@@ -269,7 +268,7 @@ class Http2UpgradeHandler extends Abstra
 if (streamConcurrency == null) {
 socketWrapper.execute(streamRunnable);
 } else {
-if (getStreamConcurrency() < maxConcurrentStreamExecution) {
+if (getStreamConcurrency() < 
protocol.getMaxConcurrentStreamExecution()) {
 increaseStreamConcurrency();
 socketWrapper.execute(streamRunnable);
 } else {
@@ -438,7 +437,7 @@ class Http2UpgradeHandler extends Abstra
 return;
 }
 decreaseStreamConcurrency();
-if (getStreamConcurrency() < maxConcurrentStreamExecution) {
+if (getStreamConcurrency() < 
protocol.getMaxConcurrentStreamExecution()) {
 StreamRunnable streamRunnable = queuedRunnable.poll();
 if (streamRunnable != null) {
 increaseStreamConcurrency();
@@ -1128,11 +1127,6 @@ class Http2UpgradeHandler extends Abstra
 
 // --- Configuration 
getters/setters
 
-public void setMaxConcurrentStreamExecution(int 
maxConcurrentStreamExecution) {
-this.maxConcurrentStreamExecution = maxConcurrentStreamExecution;
-}
-
-
 public void setAllowedTrailerHeaders(Set allowedTrailerHeaders) {
 this.allowedTrailerHeaders = allowedTrailerHeaders;
 }



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



svn commit: r1807329 - in /tomcat/trunk/java/org/apache/coyote/http2: Http2Protocol.java Http2UpgradeHandler.java Stream.java

2017-09-05 Thread markt
Author: markt
Date: Tue Sep  5 09:44:04 2017
New Revision: 1807329

URL: http://svn.apache.org/viewvc?rev=1807329=rev
Log:
Refactor: Obtain limits directly from protocol

Modified:
tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java
tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
tomcat/trunk/java/org/apache/coyote/http2/Stream.java

Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java?rev=1807329=1807328=1807329=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java Tue Sep  5 
09:44:04 2017
@@ -105,11 +105,6 @@ public class Http2Protocol implements Up
 ? new Http2AsyncUpgradeHandler(this, adapter, coyoteRequest)
 : new Http2UpgradeHandler(this, adapter, coyoteRequest);
 
-result.setAllowedTrailerHeaders(allowedTrailerHeaders);
-result.setMaxHeaderCount(getMaxHeaderCount());
-result.setMaxHeaderSize(getMaxHeaderSize());
-result.setMaxTrailerCount(getMaxTrailerCount());
-result.setMaxTrailerSize(getMaxTrailerSize());
 result.setInitiatePingDisabled(initiatePingDisabled);
 return result;
 }
@@ -226,6 +221,11 @@ public class Http2Protocol implements Up
 }
 
 
+boolean isTrailerHeaderAllowed(String headerName) {
+return allowedTrailerHeaders.contains(headerName);
+}
+
+
 public void setMaxHeaderCount(int maxHeaderCount) {
 this.maxHeaderCount = maxHeaderCount;
 }

Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java?rev=1807329=1807328=1807329=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java Tue Sep  
5 09:44:04 2017
@@ -20,7 +20,6 @@ import java.io.EOFException;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -138,13 +137,6 @@ class Http2UpgradeHandler extends Abstra
 private AtomicInteger streamConcurrency = null;
 private Queue queuedRunnable = null;
 
-// Limits
-private Set allowedTrailerHeaders = Collections.emptySet();
-private int maxHeaderCount = Constants.DEFAULT_MAX_HEADER_COUNT;
-private int maxHeaderSize = Constants.DEFAULT_MAX_HEADER_SIZE;
-private int maxTrailerCount = Constants.DEFAULT_MAX_TRAILER_COUNT;
-private int maxTrailerSize = Constants.DEFAULT_MAX_TRAILER_SIZE;
-
 
 Http2UpgradeHandler(Http2Protocol protocol, Adapter adapter, Request 
coyoteRequest) {
 super (STREAM_ID_ZERO);
@@ -384,6 +376,11 @@ class Http2UpgradeHandler extends Abstra
 }
 
 
+Http2Protocol getProtocol() {
+return protocol;
+}
+
+
 @Override
 public void pause() {
 if (log.isDebugEnabled()) {
@@ -1120,58 +1117,8 @@ class Http2UpgradeHandler extends Abstra
 }
 
 
-boolean isTrailerHeaderAllowed(String headerName) {
-return allowedTrailerHeaders.contains(headerName);
-}
-
-
 // --- Configuration 
getters/setters
 
-public void setAllowedTrailerHeaders(Set allowedTrailerHeaders) {
-this.allowedTrailerHeaders = allowedTrailerHeaders;
-}
-
-
-public void setMaxHeaderCount(int maxHeaderCount) {
-this.maxHeaderCount = maxHeaderCount;
-}
-
-
-public int getMaxHeaderCount() {
-return maxHeaderCount;
-}
-
-
-public void setMaxHeaderSize(int maxHeaderSize) {
-this.maxHeaderSize = maxHeaderSize;
-}
-
-
-public int getMaxHeaderSize() {
-return maxHeaderSize;
-}
-
-
-public void setMaxTrailerCount(int maxTrailerCount) {
-this.maxTrailerCount = maxTrailerCount;
-}
-
-
-public int getMaxTrailerCount() {
-return maxTrailerCount;
-}
-
-
-public void setMaxTrailerSize(int maxTrailerSize) {
-this.maxTrailerSize = maxTrailerSize;
-}
-
-
-public int getMaxTrailerSize() {
-return maxTrailerSize;
-}
-
-
 public void setInitiatePingDisabled(boolean initiatePingDisabled) {
 pingManager.initiateDisabled = initiatePingDisabled;
 }

Modified: tomcat/trunk/java/org/apache/coyote/http2/Stream.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Stream.java?rev=1807329=1807328=1807329=diff
==
--- 

svn commit: r1807325 - in /tomcat/trunk: java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java java/org/apache/coyote/http2/Http2Protocol.java java/org/apache/coyote/http2/Http2UpgradeHandler.jav

2017-09-05 Thread markt
Author: markt
Date: Tue Sep  5 09:43:44 2017
New Revision: 1807325

URL: http://svn.apache.org/viewvc?rev=1807325=rev
Log:
Refactor: Make Http2Protocol available to Http2UpgradeHandler.
This will enable some duplicated properties to be removed.

Modified:
tomcat/trunk/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java
tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
tomcat/trunk/test/org/apache/coyote/http2/TestAbstractStream.java

Modified: 
tomcat/trunk/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java?rev=1807325=1807324=1807325=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java Tue 
Sep  5 09:43:44 2017
@@ -36,8 +36,9 @@ public class Http2AsyncUpgradeHandler ex
 private Throwable error = null;
 private IOException applicationIOE = null;
 
-public Http2AsyncUpgradeHandler(Adapter adapter, Request coyoteRequest) {
-super (adapter, coyoteRequest);
+public Http2AsyncUpgradeHandler(Http2Protocol protocol, Adapter adapter,
+Request coyoteRequest) {
+super (protocol, adapter, coyoteRequest);
 }
 
 private CompletionHandler errorCompletion = new 
CompletionHandler() {

Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java?rev=1807325=1807324=1807325=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java Tue Sep  5 
09:43:44 2017
@@ -102,8 +102,8 @@ public class Http2Protocol implements Up
 public InternalHttpUpgradeHandler 
getInternalUpgradeHandler(SocketWrapperBase socketWrapper,
 Adapter adapter, Request coyoteRequest) {
 Http2UpgradeHandler result = (socketWrapper.hasAsyncIO())
-? new Http2AsyncUpgradeHandler(adapter, coyoteRequest)
-: new Http2UpgradeHandler(adapter, coyoteRequest);
+? new Http2AsyncUpgradeHandler(this, adapter, coyoteRequest)
+: new Http2UpgradeHandler(this, adapter, coyoteRequest);
 
 result.setReadTimeout(getReadTimeout());
 result.setKeepAliveTimeout(getKeepAliveTimeout());

Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java?rev=1807325=1807324=1807325=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java Tue Sep  
5 09:43:44 2017
@@ -96,6 +96,7 @@ class Http2UpgradeHandler extends Abstra
 
 protected final String connectionId;
 
+private final Http2Protocol protocol;
 private final Adapter adapter;
 protected volatile SocketWrapperBase socketWrapper;
 private volatile SSLSupport sslSupport;
@@ -151,8 +152,9 @@ class Http2UpgradeHandler extends Abstra
 private int maxTrailerSize = Constants.DEFAULT_MAX_TRAILER_SIZE;
 
 
-Http2UpgradeHandler(Adapter adapter, Request coyoteRequest) {
+Http2UpgradeHandler(Http2Protocol protocol, Adapter adapter, Request 
coyoteRequest) {
 super (STREAM_ID_ZERO);
+this.protocol = protocol;
 this.adapter = adapter;
 this.connectionId = 
Integer.toString(connectionIdGenerator.getAndIncrement());
 

Modified: tomcat/trunk/test/org/apache/coyote/http2/TestAbstractStream.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/TestAbstractStream.java?rev=1807325=1807324=1807325=diff
==
--- tomcat/trunk/test/org/apache/coyote/http2/TestAbstractStream.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http2/TestAbstractStream.java Tue Sep  
5 09:43:44 2017
@@ -28,7 +28,7 @@ public class TestAbstractStream {
 @Test
 public void testDependenciesFig3() {
 // Setup
-Http2UpgradeHandler handler = new Http2UpgradeHandler(null, null);
+Http2UpgradeHandler handler = new Http2UpgradeHandler(null, null, 
null);
 Stream a = new Stream(Integer.valueOf(1), handler);
 Stream b = new Stream(Integer.valueOf(2), handler);
 Stream c = new Stream(Integer.valueOf(3), handler);
@@ -59,7 +59,7 @@ public class TestAbstractStream {
 @Test
 public void testDependenciesFig4() {
 // 

svn commit: r1807326 - in /tomcat/trunk/java/org/apache/coyote/http2: Http2AsyncUpgradeHandler.java Http2Protocol.java Http2UpgradeHandler.java

2017-09-05 Thread markt
Author: markt
Date: Tue Sep  5 09:43:49 2017
New Revision: 1807326

URL: http://svn.apache.org/viewvc?rev=1807326=rev
Log:
Refactor: Obtain timeouts directly from protocol

Modified:
tomcat/trunk/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
tomcat/trunk/java/org/apache/coyote/http2/Http2Protocol.java
tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java

Modified: 
tomcat/trunk/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java?rev=1807326=1807325=1807326=diff
==
--- tomcat/trunk/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java Tue 
Sep  5 09:43:49 2017
@@ -71,8 +71,8 @@ public class Http2AsyncUpgradeHandler ex
 @Override
 protected void writeSettings() {
 // Send the initial settings frame
-socketWrapper.write(BlockingMode.SEMI_BLOCK, getWriteTimeout(), 
TimeUnit.MILLISECONDS,
-null, SocketWrapperBase.COMPLETE_WRITE, errorCompletion,
+socketWrapper.write(BlockingMode.SEMI_BLOCK, 
protocol.getWriteTimeout(),
+TimeUnit.MILLISECONDS, null, SocketWrapperBase.COMPLETE_WRITE, 
errorCompletion,
 ByteBuffer.wrap(localSettings.getSettingsFrameForPending()));
 if (error != null) {
 String msg = sm.getString("upgradeHandler.sendPrefaceFail", 
connectionId);
@@ -101,8 +101,8 @@ public class Http2AsyncUpgradeHandler ex
 ByteUtil.set31Bits(rstFrame, 5, se.getStreamId());
 // Payload
 ByteUtil.setFourBytes(rstFrame, 9, se.getError().getCode());
-socketWrapper.write(BlockingMode.SEMI_BLOCK, getWriteTimeout(), 
TimeUnit.MILLISECONDS,
-null, SocketWrapperBase.COMPLETE_WRITE, errorCompletion,
+socketWrapper.write(BlockingMode.SEMI_BLOCK, 
protocol.getWriteTimeout(),
+TimeUnit.MILLISECONDS, null, SocketWrapperBase.COMPLETE_WRITE, 
errorCompletion,
 ByteBuffer.wrap(rstFrame));
 handleAsyncException();
 }
@@ -121,13 +121,15 @@ public class Http2AsyncUpgradeHandler ex
 byte[] payloadLength = new byte[3];
 ByteUtil.setThreeBytes(payloadLength, 0, len);
 if (debugMsg != null) {
-socketWrapper.write(BlockingMode.SEMI_BLOCK, getWriteTimeout(), 
TimeUnit.MILLISECONDS,
-null, SocketWrapperBase.COMPLETE_WRITE, errorCompletion,
-ByteBuffer.wrap(payloadLength), ByteBuffer.wrap(GOAWAY), 
ByteBuffer.wrap(fixedPayload), ByteBuffer.wrap(debugMsg));
+socketWrapper.write(BlockingMode.SEMI_BLOCK, 
protocol.getWriteTimeout(),
+TimeUnit.MILLISECONDS, null, 
SocketWrapperBase.COMPLETE_WRITE, errorCompletion,
+ByteBuffer.wrap(payloadLength), ByteBuffer.wrap(GOAWAY),
+ByteBuffer.wrap(fixedPayload), ByteBuffer.wrap(debugMsg));
 } else {
-socketWrapper.write(BlockingMode.SEMI_BLOCK, getWriteTimeout(), 
TimeUnit.MILLISECONDS,
-null, SocketWrapperBase.COMPLETE_WRITE, errorCompletion,
-ByteBuffer.wrap(payloadLength), ByteBuffer.wrap(GOAWAY), 
ByteBuffer.wrap(fixedPayload));
+socketWrapper.write(BlockingMode.SEMI_BLOCK, 
protocol.getWriteTimeout(),
+TimeUnit.MILLISECONDS, null, 
SocketWrapperBase.COMPLETE_WRITE, errorCompletion,
+ByteBuffer.wrap(payloadLength), ByteBuffer.wrap(GOAWAY),
+ByteBuffer.wrap(fixedPayload));
 }
 handleAsyncException();
 }
@@ -171,9 +173,9 @@ public class Http2AsyncUpgradeHandler ex
 ByteUtil.set31Bits(header, 5, stream.getIdentifier().intValue());
 int orgLimit = data.limit();
 data.limit(data.position() + len);
-socketWrapper.write(BlockingMode.BLOCK, getWriteTimeout(), 
TimeUnit.MILLISECONDS,
-null, SocketWrapperBase.COMPLETE_WRITE, 
applicationErrorCompletion,
-ByteBuffer.wrap(header), data);
+socketWrapper.write(BlockingMode.BLOCK, protocol.getWriteTimeout(),
+TimeUnit.MILLISECONDS, null, 
SocketWrapperBase.COMPLETE_WRITE,
+applicationErrorCompletion, ByteBuffer.wrap(header), data);
 data.limit(orgLimit);
 handleAsyncException();
 }
@@ -197,8 +199,8 @@ public class Http2AsyncUpgradeHandler ex
 frame2[3] = FrameType.WINDOW_UPDATE.getIdByte();
 ByteUtil.set31Bits(frame2, 9, increment);
 ByteUtil.set31Bits(frame2, 5, stream.getIdentifier().intValue());
-socketWrapper.write(BlockingMode.SEMI_BLOCK, getWriteTimeout(), 
TimeUnit.MILLISECONDS,
-null, SocketWrapperBase.COMPLETE_WRITE, errorCompletion,
+ 

svn commit: r1807324 - in /tomcat/trunk/java/org/apache/coyote: AbstractProcessor.java ajp/AbstractAjpProtocol.java ajp/AjpProcessor.java http11/AbstractHttp11Protocol.java http11/Http11Processor.java

2017-09-05 Thread markt
Author: markt
Date: Tue Sep  5 09:43:38 2017
New Revision: 1807324

URL: http://svn.apache.org/viewvc?rev=1807324=rev
Log:
Refactor: Make adapter reference final

Modified:
tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java
tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
tomcat/trunk/java/org/apache/coyote/http2/StreamProcessor.java

Modified: tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java?rev=1807324=1807323=1807324=diff
==
--- tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java Tue Sep  5 
09:43:38 2017
@@ -42,7 +42,7 @@ public abstract class AbstractProcessor
 
 private static final StringManager sm = 
StringManager.getManager(AbstractProcessor.class);
 
-protected Adapter adapter;
+protected final Adapter adapter;
 protected final AsyncStateMachine asyncStateMachine;
 private volatile long asyncTimeout = -1;
 protected final Request request;
@@ -57,12 +57,13 @@ public abstract class AbstractProcessor
 private ErrorState errorState = ErrorState.NONE;
 
 
-public AbstractProcessor() {
-this(new Request(), new Response());
+public AbstractProcessor(Adapter adapter) {
+this(adapter, new Request(), new Response());
 }
 
 
-protected AbstractProcessor(Request coyoteRequest, Response 
coyoteResponse) {
+protected AbstractProcessor(Adapter adapter, Request coyoteRequest, 
Response coyoteResponse) {
+this.adapter = adapter;
 asyncStateMachine = new AsyncStateMachine(this);
 request = coyoteRequest;
 response = coyoteResponse;
@@ -113,16 +114,6 @@ public abstract class AbstractProcessor
 }
 
 
-/**
- * Set the associated adapter.
- *
- * @param adapter the new adapter
- */
-public void setAdapter(Adapter adapter) {
-this.adapter = adapter;
-}
-
-
 /**
  * Get the associated adapter.
  *

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java?rev=1807324=1807323=1807324=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java Tue Sep  5 
09:43:38 2017
@@ -195,8 +195,7 @@ public abstract class AbstractAjpProtoco
 
 @Override
 protected Processor createProcessor() {
-AjpProcessor processor = new AjpProcessor(this);
-processor.setAdapter(getAdapter());
+AjpProcessor processor = new AjpProcessor(this, getAdapter());
 return processor;
 }
 

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?rev=1807324=1807323=1807324=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Tue Sep  5 
09:43:38 2017
@@ -30,6 +30,7 @@ import javax.servlet.http.HttpServletRes
 
 import org.apache.coyote.AbstractProcessor;
 import org.apache.coyote.ActionCode;
+import org.apache.coyote.Adapter;
 import org.apache.coyote.ErrorState;
 import org.apache.coyote.InputBuffer;
 import org.apache.coyote.OutputBuffer;
@@ -244,8 +245,8 @@ public class AjpProcessor extends Abstra
 
 //  Constructor
 
-public AjpProcessor(AbstractAjpProtocol protocol) {
-super();
+public AjpProcessor(AbstractAjpProtocol protocol, Adapter adapter) {
+super(adapter);
 this.protocol = protocol;
 
 int packetSize = protocol.getPacketSize();

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java?rev=1807324=1807323=1807324=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java Tue 
Sep  5 09:43:38 2017
@@ -934,8 +934,7 @@ public abstract class AbstractHttp11Prot
 
 @Override
 protected Processor createProcessor() {
-Http11Processor processor = new Http11Processor(this);
-

[Bug 61489] Disable creation of command line parameters from GET parameters in the URL for CGIServlet

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61489

--- Comment #2 from jm009  ---
Created attachment 35293
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35293=edit
Make evaluation of enableCmdLineArguments in outer if.

In fact the evaluation of "boolean enableCmdLineArguments" can happen in the
outer if block.

-- 
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 61489] Disable creation of command line parameters from GET parameters in the URL for CGIServlet

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61489

jm009  changed:

   What|Removed |Added

Summary|Disable creation of command |Disable creation of command
   |line parameters from GET|line parameters from GET
   |parameters in the URL   |parameters in the URL for
   ||CGIServlet

-- 
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 61189] CGIServlet should be able to set specific environment variables

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61189

--- Comment #2 from jm009  ---
Created attachment 35291
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35291=edit
Allow to configure CGI specific environment variables.

This patch makes configuration of additional environment variables similar to
the configuration of executable-arg-1, executable-arg-2, and so on

   
  environment-variable-1
  SQWEBMAIL_MAXARGSIZE=2000
   
   
  nvironment-variable-2
  SQWEBMAIL_MAXATTSIZE=2000
   
   
  nvironment-variable-3
  SQWEBMAIL_MAXMSGSIZE=2000
   

-- 
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 61489] Disable creation of command line parameters from GET parameters in the URL

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61489

--- Comment #1 from jm009  ---
Why I suggest to disable this feature by default:

1) I never saw a servlet that uses this feature

2) I suppose, this feature comes from the beginnings of the internet, when
people wanted to run some system command by clicking on a link, and the term
"security" was not yet used in computer science :-)

-- 
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 61489] New: Disable creation of command line parameters from GET parameters in the URL

2017-09-05 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61489

Bug ID: 61489
   Summary: Disable creation of command line parameters from GET
parameters in the URL
   Product: Tomcat 9
   Version: unspecified
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: jan0mich...@yahoo.com
  Target Milestone: -

Created attachment 35290
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35290=edit
Make creation of command line parameters from GET parameters optional

The CGI RFC says, that the server SHOULD create command line arguments from
certain GET parameters.

https://tools.ietf.org/html/rfc3875#section-4.4
4.4.  The Script Command Line


I don't like this, because I think, this can be a security risk in certain
cases.
I suggest to disable this feature by default, or at least allow to disable it
by configuration.

The proposed patch makes this feature configurable.
The line

private boolean enableCmdLineArguments = false;

makes the feature disabled by default. Putting "= true" would make it enabled
by default.

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