markt-asf commented on a change in pull request #344:
URL: https://github.com/apache/tomcat/pull/344#discussion_r476515349



##########
File path: java/org/apache/catalina/connector/CoyoteAdapter.java
##########
@@ -1144,6 +1144,12 @@ public static boolean normalize(MessageBytes uriMB, 
boolean allowBackslash) {
         int pos = 0;
         int index = 0;
 
+
+        // The URL must start with '/' (or '\' that will be replaced soon)
+        if (b[start] != (byte) '/' && b[start] != (byte) '\\') {

Review comment:
       I find this slightly harder to follow than the original but I can see 
the potential benefit so no objection.

##########
File path: java/org/apache/tomcat/util/threads/TaskQueue.java
##########
@@ -109,18 +110,22 @@ public Runnable take() throws InterruptedException {
 
     @Override
     public int remainingCapacity() {
-        if (forcedRemainingCapacity != null) {
+        if (forcedRemainingCapacity > DEFAULT_FORCED_REMAINING_CAPACITY) {
             // ThreadPoolExecutor.setCorePoolSize checks that
             // remainingCapacity==0 to allow to interrupt idle threads
             // I don't see why, but this hack allows to conform to this
             // "requirement"
-            return forcedRemainingCapacity.intValue();
+            return forcedRemainingCapacity;
         }
         return super.remainingCapacity();
     }
 
-    public void setForcedRemainingCapacity(Integer forcedRemainingCapacity) {
+    public void setForcedRemainingCapacity(int forcedRemainingCapacity) {
         this.forcedRemainingCapacity = forcedRemainingCapacity;

Review comment:
       Technically this is a change in a public API but it looks sufficiently 
low level / part of Tomcat's internals that I'm OK with the change.

##########
File path: java/org/apache/tomcat/util/threads/StopPooledThreadException.java
##########
@@ -26,6 +26,6 @@
     private static final long serialVersionUID = 1L;
 
     public StopPooledThreadException(String msg) {
-        super(msg);
+        super(msg, null, false, false);
     }

Review comment:
       This does mean that the stack trace in the debug log is lost but I don't 
think it tells us anything useful (it looks like it will be (nearly?) always 
the same). I'm happy with this change.




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

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



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

Reply via email to