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 64c14b18bdd6088c623e29d27a88cbfff0e8598b
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Sep 4 23:52:54 2019 +0100

    Add setting direction to debug logging.
---
 java/org/apache/coyote/http2/ConnectionSettingsBase.java   | 4 +++-
 java/org/apache/coyote/http2/ConnectionSettingsLocal.java  | 8 ++++++++
 java/org/apache/coyote/http2/ConnectionSettingsRemote.java | 8 ++++++++
 java/org/apache/coyote/http2/LocalStrings.properties       | 2 +-
 4 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/ConnectionSettingsBase.java 
b/java/org/apache/coyote/http2/ConnectionSettingsBase.java
index 515219e..ed0dcd3 100644
--- a/java/org/apache/coyote/http2/ConnectionSettingsBase.java
+++ b/java/org/apache/coyote/http2/ConnectionSettingsBase.java
@@ -64,7 +64,7 @@ abstract class ConnectionSettingsBase<T extends Throwable> {
     final void set(Setting setting, long value) throws T {
         if (log.isDebugEnabled()) {
             log.debug(sm.getString("connectionSettings.debug",
-                    connectionId, setting, Long.toString(value)));
+                    connectionId, getEndpointName(), setting, 
Long.toString(value)));
         }
 
         switch(setting) {
@@ -215,4 +215,6 @@ abstract class ConnectionSettingsBase<T extends Throwable> {
 
 
     abstract void throwException(String msg, Http2Error error) throws T;
+
+    abstract String getEndpointName();
 }
diff --git a/java/org/apache/coyote/http2/ConnectionSettingsLocal.java 
b/java/org/apache/coyote/http2/ConnectionSettingsLocal.java
index af7ff8c..64e68bb 100644
--- a/java/org/apache/coyote/http2/ConnectionSettingsLocal.java
+++ b/java/org/apache/coyote/http2/ConnectionSettingsLocal.java
@@ -32,6 +32,8 @@ import java.util.Map;
  */
 class ConnectionSettingsLocal extends 
ConnectionSettingsBase<IllegalArgumentException> {
 
+    private static final String ENDPOINT_NAME = "Local(client->server)";
+
     private boolean sendInProgress = false;
 
 
@@ -97,4 +99,10 @@ class ConnectionSettingsLocal extends 
ConnectionSettingsBase<IllegalArgumentExce
     final void throwException(String msg, Http2Error error) throws 
IllegalArgumentException {
         throw new IllegalArgumentException(msg);
     }
+
+
+    @Override
+    final String getEndpointName() {
+        return ENDPOINT_NAME;
+    }
 }
diff --git a/java/org/apache/coyote/http2/ConnectionSettingsRemote.java 
b/java/org/apache/coyote/http2/ConnectionSettingsRemote.java
index e50a5d2..235446a 100644
--- a/java/org/apache/coyote/http2/ConnectionSettingsRemote.java
+++ b/java/org/apache/coyote/http2/ConnectionSettingsRemote.java
@@ -22,6 +22,8 @@ package org.apache.coyote.http2;
  */
 class ConnectionSettingsRemote extends 
ConnectionSettingsBase<ConnectionException> {
 
+    private static final String ENDPOINT_NAME = "Remote(server->client)";
+
     ConnectionSettingsRemote(String connectionId) {
         super(connectionId);
     }
@@ -31,4 +33,10 @@ class ConnectionSettingsRemote extends 
ConnectionSettingsBase<ConnectionExceptio
     final void throwException(String msg, Http2Error error) throws 
ConnectionException {
         throw new ConnectionException(msg, error);
     }
+
+
+    @Override
+    final String getEndpointName() {
+        return ENDPOINT_NAME;
+    }
 }
diff --git a/java/org/apache/coyote/http2/LocalStrings.properties 
b/java/org/apache/coyote/http2/LocalStrings.properties
index 83afc74..670dce3 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -21,7 +21,7 @@ connectionPrefaceParser.eos=Unexpected end of stream while 
reading opening clien
 connectionPrefaceParser.ioError=Failed to read opening client preface byte 
sequence
 connectionPrefaceParser.mismatch=An unexpected byte sequence was received at 
the start of the client preface [{0}]
 
-connectionSettings.debug=Connection [{0}], Parameter type [{1}] set to [{2}]
+connectionSettings.debug=Connection [{0}], Endpoint [{1}], Parameter type 
[{2}] set to [{3}]
 connectionSettings.enablePushInvalid=Connection [{0}], The requested value for 
enable push [{1}] is not one of the permitted values (zero or one)
 connectionSettings.headerTableSizeLimit=Connection [{0}], Attempted to set a 
header table size of [{1}] but the limit is 16k
 connectionSettings.maxFrameSizeInvalid=Connection [{0}], The requested maximum 
frame size of [{1}] is outside the permitted range of [{2}] to [{3}]


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

Reply via email to