You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/07/24 14:51:27 UTC

[tomcat] 07/11: Polish. Align with 8.5.x. Re-order and clean-up. No functional change.

This is an automated email from the ASF dual-hosted git repository.

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

commit 49e01f938c8beda0ebb65cb9e8bd1840e08bb3c9
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jul 24 11:03:59 2019 +0100

    Polish. Align with 8.5.x. Re-order and clean-up. No functional change.
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java b/java/org/apache/catalina/connector/CoyoteAdapter.java
index 5245e84..1420dd2 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -279,6 +279,7 @@ public class CoyoteAdapter implements Adapter {
         if (request == null) {
             throw new IllegalStateException(sm.getString("coyoteAdapter.nullRequest"));
         }
+
         boolean comet = false;
         boolean success = true;
         AsyncContextImpl asyncConImpl = request.getAsyncContextInternal();
@@ -427,7 +428,6 @@ public class CoyoteAdapter implements Adapter {
 
             // Set query string encoding
             req.getParameters().setQueryStringEncoding(connector.getURIEncoding());
-
         }
 
         if (connector.getXpoweredBy()) {
@@ -472,8 +472,8 @@ public class CoyoteAdapter implements Adapter {
                         request.setFilterChain(null);
                     }
                 }
-
             }
+
             if (request.isAsync()) {
                 async = true;
                 Throwable throwable =
@@ -686,14 +686,14 @@ public class CoyoteAdapter implements Adapter {
         // If the processor has set the scheme (AJP does this, HTTP does this if
         // SSL is enabled) use this to set the secure flag as well. If the
         // processor hasn't set it, use the settings from the connector
-        if (! req.scheme().isNull()) {
-            // use processor specified scheme to determine secure state
-            request.setSecure(req.scheme().equals("https"));
-        } else {
-            // use connector scheme and secure configuration, (defaults to
+        if (req.scheme().isNull()) {
+            // Use connector scheme and secure configuration, (defaults to
             // "http" and false respectively)
             req.scheme().setString(connector.getScheme());
             request.setSecure(connector.getSecure());
+        } else {
+            // Use processor specified scheme to determine secure state
+            request.setSecure(req.scheme().equals("https"));
         }
 
         // At this point the Host header has been processed.
@@ -1419,8 +1419,6 @@ public class CoyoteAdapter implements Adapter {
      * @param len Length
      */
     protected static void copyBytes(byte[] b, int dest, int src, int len) {
-        for (int pos = 0; pos < len; pos++) {
-            b[pos + dest] = b[pos + src];
-        }
+        System.arraycopy(b, src, b, dest, len);
     }
 }


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