Author: markt
Date: Tue Jun  9 19:40:46 2015
New Revision: 1684508

URL: http://svn.apache.org/r1684508
Log:
Check stream IDs do not go backwards

Modified:
    tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_5_1.java

Modified: tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_5_1.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_5_1.java?rev=1684508&r1=1684507&r2=1684508&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_5_1.java 
(original)
+++ tomcat/trunk/test/org/apache/coyote/http2/TestHttp2Section_5_1.java Tue Jun 
 9 19:40:46 2015
@@ -144,7 +144,7 @@ public class TestHttp2Section_5_1 extend
         buildSimpleRequestPart1(frameHeader, headersPayload, 4);
         writeFrame(frameHeader, headersPayload);
 
-        // headers, body
+        // headers
         parser.readFrame(true);
 
         Assert.assertTrue(output.getTrace(),
@@ -152,6 +152,36 @@ public class TestHttp2Section_5_1 extend
                         Error.PROTOCOL_ERROR.getCode() + "]-["));
     }
 
+
+    @Test
+    public void testClientSendOldStream() throws Exception {
+        hpackEncoder = new 
HpackEncoder(ConnectionSettings.DEFAULT_HEADER_TABLE_SIZE);
+
+        http2Connect();
+        sendSimpleRequest(5);
+        readSimpleResponse();
+        Assert.assertEquals(getSimpleResponseTrace(5), output.getTrace());
+        output.clearTrace();
+
+
+        // Build the simple request on an old stream
+        byte[] frameHeader = new byte[9];
+        ByteBuffer headersPayload = ByteBuffer.allocate(128);
+        buildSimpleRequest(frameHeader, headersPayload, 3);
+
+        os.write(frameHeader);
+        os.flush();
+
+        // headers
+        parser.readFrame(true);
+
+        Assert.assertTrue(output.getTrace(),
+                output.getTrace().startsWith("0-Goaway-[2147483647]-[" +
+                        Error.PROTOCOL_ERROR.getCode() + "]-["));
+
+    }
+
+
     // TODO Remaining 5.1.1 tests
 
     // TODO 5.1.2 tests



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to