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 2017/03/24 14:16:12 UTC

svn commit: r1788455 - in /tomcat/trunk: java/org/apache/coyote/http2/HpackDecoder.java java/org/apache/coyote/http2/LocalStrings.properties webapps/docs/changelog.xml

Author: markt
Date: Fri Mar 24 14:16:12 2017
New Revision: 1788455

URL: http://svn.apache.org/viewvc?rev=1788455&view=rev
Log:
HPACK table size updates must occur at the start of a header block.
Identified by Moto Ishizawa's h2spec tool.

Modified:
    tomcat/trunk/java/org/apache/coyote/http2/HpackDecoder.java
    tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/coyote/http2/HpackDecoder.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/HpackDecoder.java?rev=1788455&r1=1788454&r2=1788455&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/HpackDecoder.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/HpackDecoder.java Fri Mar 24 14:16:12 2017
@@ -156,6 +156,9 @@ public class HpackDecoder {
     }
 
     private boolean handleMaxMemorySizeChange(ByteBuffer buffer, int originalPos) throws HpackException {
+        if (headerCount != 0) {
+            throw new HpackException(sm.getString("hpackdecoder.tableSizeUpdateNotAtStart"));
+        }
         buffer.position(buffer.position() - 1); //unget the byte
         int size = Hpack.decodeInteger(buffer, 5);
         if (size == -1) {

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=1788455&r1=1788454&r2=1788455&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties Fri Mar 24 14:16:12 2017
@@ -35,6 +35,7 @@ hpack.integerEncodedOverTooManyOctets=HP
 hpack.invalidCharacter=The Unicode character [{0}] at code point [{1}] cannot be encoded as it is outside the permitted range of 0 to 255.
 
 hpackdecoder.zeroNotValidHeaderTableIndex=Zero is not a valid header table index
+hpackdecoder.tableSizeUpdateNotAtStart=Any table size update must be sent at the start of a header block
 
 hpackEncoder.encodeHeader=Encoding header [{0}] with value [{1}]
 

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1788455&r1=1788454&r2=1788455&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Fri Mar 24 14:16:12 2017
@@ -128,6 +128,10 @@
         configuration attributes and internal code. Based on a pacth by Michael
         Osipov. (markt)
       </fix>
+      <fix>
+        Improve HPACK specification compliance by fixing some test failures
+        reported by the h2spec tool written by Moto Ishizawa. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">



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