tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1684411 - in /tomcat/trunk/java/org/apache/coyote/http2: FrameType.java Http2Parser.java Http2UpgradeHandler.java
Date Tue, 09 Jun 2015 13:01:02 GMT
Author: markt
Date: Tue Jun  9 13:01:01 2015
New Revision: 1684411

URL: http://svn.apache.org/r1684411
Log:
Merge check methods

Modified:
    tomcat/trunk/java/org/apache/coyote/http2/FrameType.java
    tomcat/trunk/java/org/apache/coyote/http2/Http2Parser.java
    tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java

Modified: tomcat/trunk/java/org/apache/coyote/http2/FrameType.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/FrameType.java?rev=1684411&r1=1684410&r2=1684411&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/FrameType.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/FrameType.java Tue Jun  9 13:01:01 2015
@@ -58,15 +58,14 @@ public enum FrameType {
     }
 
 
-    public void checkStream(int streamId) throws Http2Exception {
+    public void check(int streamId, int payloadSize) throws Http2Exception {
+        // Is FrameType valid for the given stream?
         if (streamId == 0 && !streamZero || streamId != 0 && !streamNonZero)
{
             throw new ConnectionError(sm.getString("frameType.checkStream", this),
                     Error.PROTOCOL_ERROR);
         }
-    }
-
 
-    public void checkPayloadSize(int streamId, int payloadSize) throws Http2Exception {
+        // Is the payload size valid for the given FrameType
         if (payloadSizeValidator != null && !payloadSizeValidator.test(payloadSize))
{
             if (payloadErrorFatal) {
                 throw new ConnectionError(sm.getString("frameType.checkPayloadSize",

Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2Parser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2Parser.java?rev=1684411&r1=1684410&r2=1684411&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/Http2Parser.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2Parser.java Tue Jun  9 13:01:01 2015
@@ -434,8 +434,7 @@ class Http2Parser {
             }
         }
 
-        frameType.checkStream(streamId);
-        frameType.checkPayloadSize(streamId, payloadSize);
+        frameType.check(streamId, payloadSize);
     }
 
 

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=1684411&r1=1684410&r2=1684411&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java Tue Jun  9 13:01:01
2015
@@ -172,7 +172,7 @@ public class Http2UpgradeHandler extends
                 String base64Settings = stream.getCoyoteRequest().getHeader(HTTP2_SETTINGS_HEADER);
                 byte[] settings = Base64.decodeBase64(base64Settings);
 
-                FrameType.SETTINGS.checkPayloadSize(1, settings.length);
+                FrameType.SETTINGS.check(1, settings.length);
 
                 for (int i = 0; i < settings.length % 6; i++) {
                     int id = ByteUtil.getTwoBytes(settings, i * 6);



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


Mime
View raw message