You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/03/22 00:59:54 UTC

[incubator-servicecomb-java-chassis] branch master updated: [SCB-420] change default HTTP header size limitation to 32K

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

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git


The following commit(s) were added to refs/heads/master by this push:
     new 973a483  [SCB-420] change default HTTP header size limitation to 32K
973a483 is described below

commit 973a4831ec5ea68bbb88948b69c0b229920b7e17
Author: yaohaishi <ya...@huawei.com>
AuthorDate: Wed Mar 21 18:17:15 2018 +0800

    [SCB-420] change default HTTP header size limitation to 32K
---
 .../transport/rest/vertx/TransportConfig.java      | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/TransportConfig.java b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/TransportConfig.java
index 75bcc98..fee033c 100644
--- a/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/TransportConfig.java
+++ b/transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/TransportConfig.java
@@ -21,9 +21,17 @@ import com.netflix.config.DynamicIntProperty;
 import com.netflix.config.DynamicPropertyFactory;
 import com.netflix.config.DynamicStringProperty;
 
-import io.vertx.core.http.HttpServerOptions;
-
 public final class TransportConfig {
+
+  public static final int DEFAULT_SERVER_THREAD_COUNT = 1;
+
+  public static final int DEFAULT_SERVER_CONNECTION_IDLE_TIMEOUT_SECOND = 60;
+
+  public static final boolean DEFAULT_SERVER_COMPRESSION_SUPPORT = false;
+
+  // 32K
+  public static final int DEFAULT_SERVER_MAX_HEADER_SIZE = 32 * 1024;
+
   private TransportConfig() {
   }
 
@@ -35,25 +43,27 @@ public final class TransportConfig {
 
   public static int getThreadCount() {
     DynamicIntProperty address =
-        DynamicPropertyFactory.getInstance().getIntProperty("cse.rest.server.thread-count", 1);
+        DynamicPropertyFactory.getInstance()
+            .getIntProperty("cse.rest.server.thread-count", DEFAULT_SERVER_THREAD_COUNT);
     return address.get();
   }
 
   public static int getConnectionIdleTimeoutInSeconds() {
     return DynamicPropertyFactory.getInstance()
-        .getIntProperty("cse.rest.server.connection.idleTimeoutInSeconds", 60)
+        .getIntProperty("cse.rest.server.connection.idleTimeoutInSeconds",
+            DEFAULT_SERVER_CONNECTION_IDLE_TIMEOUT_SECOND)
         .get();
   }
 
   public static boolean getCompressed() {
     return DynamicPropertyFactory.getInstance()
-        .getBooleanProperty("cse.rest.server.compression", false)
+        .getBooleanProperty("cse.rest.server.compression", DEFAULT_SERVER_COMPRESSION_SUPPORT)
         .get();
   }
 
   public static int getMaxHeaderSize() {
     return DynamicPropertyFactory.getInstance()
-        .getIntProperty("cse.rest.server.maxHeaderSize", HttpServerOptions.DEFAULT_MAX_HEADER_SIZE)
+        .getIntProperty("cse.rest.server.maxHeaderSize", DEFAULT_SERVER_MAX_HEADER_SIZE)
         .get();
   }
 }

-- 
To stop receiving notification emails like this one, please contact
liubao@apache.org.