tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1679200 - in /tomcat/trunk/java/org/apache/coyote/http2: ConnectionSettings.java Http2UpgradeHandler.java LocalStrings.properties
Date Wed, 13 May 2015 12:57:41 GMT
Author: markt
Date: Wed May 13 12:57:40 2015
New Revision: 1679200

URL: http://svn.apache.org/r1679200
Log:
Complete some i18n TODOs
Add more debug logging

Modified:
    tomcat/trunk/java/org/apache/coyote/http2/ConnectionSettings.java
    tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
    tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties

Modified: tomcat/trunk/java/org/apache/coyote/http2/ConnectionSettings.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/ConnectionSettings.java?rev=1679200&r1=1679199&r2=1679200&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/ConnectionSettings.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/ConnectionSettings.java Wed May 13 12:57:40
2015
@@ -41,6 +41,11 @@ public class ConnectionSettings {
     private volatile long maxHeaderListSize = UNLIMITED;
 
     public void set(int parameterId, long value) throws IOException {
+        if (log.isDebugEnabled()) {
+            log.debug(sm.getString("connectionSettings.debug",
+                    Integer.toString(parameterId), Long.toString(value)));
+        }
+
         switch(parameterId) {
         case 1:
             setHeaderTableSize(value);

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=1679200&r1=1679199&r2=1679200&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java Wed May 13 12:57:40
2015
@@ -245,9 +245,9 @@ public class Http2UpgradeHandler impleme
         }
         // Validate the frame
         if (payloadSize != 4) {
-            // TODO i18n
             // Use stream 0 since this is always a connection error
-            throw new Http2Exception("", 0, Http2Exception.FRAME_SIZE_ERROR);
+            throw new Http2Exception(sm.getString("upgradeHandler.processFrameWindowUpdate.invalidPayloadSize",
+                    Integer.toString(payloadSize)), 0, Http2Exception.FRAME_SIZE_ERROR);
         }
 
         byte[] payload = new byte[4];
@@ -255,10 +255,15 @@ public class Http2UpgradeHandler impleme
         int windowSizeIncrement = ((payload[0] & 0x7F) << 24) + ((payload[1] &
0xFF) << 16) +
                 ((payload[2] & 0xFF) << 8) + (payload[3] & 0xFF);
 
+        if (log.isDebugEnabled()) {
+            log.debug(sm.getString("upgradeHandler.processFrameWindowUpdate.debug",
+                    Integer.toString(streamId), Integer.toString(windowSizeIncrement)));
+        }
+
         // Validate the data
         if (windowSizeIncrement == 0) {
-            // TODO i18n
-            throw new Http2Exception("", streamId, Http2Exception.PROTOCOL_ERROR);
+            throw new Http2Exception("upgradeHandler.processFrameWindowUpdate.invalidIncrement",
+                    streamId, Http2Exception.PROTOCOL_ERROR);
         }
         if (streamId == 0) {
             flowControlWindowSize += windowSizeIncrement;

Modified: tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties?rev=1679200&r1=1679199&r2=1679200&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties Wed May 13 12:57:40
2015
@@ -17,6 +17,7 @@ connectionPrefaceParser.eos=Unexpected e
 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=Parameter type [{0}] set to [{1}]
 connectionSettings.enablePushInvalid=The requested value for enable push [{0}] is not one
of the permitted values (zero or one)
 connectionSettings.maxFrameSizeInvalid=The requested maximum frame size of [{0}] is ouside
the permitted range of [{1}] to [{2}]
 connectionSettings.unknown=An unknown setting with identifier [{0}] and value [{1}] was ignored
@@ -35,6 +36,9 @@ upgradeHandler.processFrame.ioerror=An I
 upgradeHandler.processFrameSettings.ackWithNonZeroPayload=Settings frame received with the
ACK flag set and payload present
 upgradeHandler.processFrameSettings.invalidPayloadSize=Settings frame received with a payload
size of [{0}] which is not a multiple of 6
 upgradeHandler.processFrameSettings.invalidStream=Settings frame received for stream [{0}]
+upgradeHandler.processFrameWindowUpdate.debug=Received notification to increment the flow
control window for stream [{0}] by [{1}]
+upgradeHandler.processFrameWindowUpdate.invalidIncrement=Window update frame received with
an invalid increment size of [0]
+upgradeHandler.processFrameWindowUpdate.invalidPayloadSize=Window update frame received with
an invalid payload size of [{0}]
 upgradeHandler.receivePrefaceNotSettings=The first frame received from the client was not
a settings frame
 upgradeHandler.sendPrefaceFail=Failed to send preface to client
 upgradeHandler.socketCloseFailed=Error closing socket



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


Mime
View raw message