aboutsummaryrefslogtreecommitdiff
path: root/okhttp
diff options
context:
space:
mode:
authorEric Gribkoff <ericgribkoff@google.com>2018-03-27 11:28:01 -0700
committerEric Gribkoff <ericgribkoff@google.com>2018-03-28 14:53:19 -0700
commit77e3b97f913c50594a0de28946d3e0416edbe86c (patch)
treec9f0b99ed41d52068a28fd0b178121a0878020ac /okhttp
parentecc36ac96d40a8d329eacfe9b20b89b55734a0ba (diff)
downloadgrpc-grpc-java-77e3b97f913c50594a0de28946d3e0416edbe86c.tar.gz
okhttp: add hpack test for max dynamic table size
Diffstat (limited to 'okhttp')
-rw-r--r--okhttp/third_party/okhttp/test/java/io/grpc/okhttp/internal/framed/HpackTest.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/okhttp/third_party/okhttp/test/java/io/grpc/okhttp/internal/framed/HpackTest.java b/okhttp/third_party/okhttp/test/java/io/grpc/okhttp/internal/framed/HpackTest.java
index e512582e9..143ad5fb6 100644
--- a/okhttp/third_party/okhttp/test/java/io/grpc/okhttp/internal/framed/HpackTest.java
+++ b/okhttp/third_party/okhttp/test/java/io/grpc/okhttp/internal/framed/HpackTest.java
@@ -92,6 +92,22 @@ public class HpackTest {
assertEquals(headerEntries("custom-key", "custom-header"), hpackReader.getAndResetHeaderList());
}
+ @Test public void setMaxDynamicTableToZeroDoesNotClearHeaderList() throws IOException {
+ bytesIn.writeByte(0x40); // Literal indexed
+ bytesIn.writeByte(0x0a); // Literal name (len = 10)
+ bytesIn.writeUtf8("custom-key");
+
+ bytesIn.writeByte(0x0d); // Literal value (len = 13)
+ bytesIn.writeUtf8("custom-header");
+
+ bytesIn.writeByte(0x20); // Set max table size to 0
+
+ hpackReader.readHeaders();
+
+ assertEquals(0, hpackReader.maxDynamicTableByteCount());
+ assertEquals(headerEntries("custom-key", "custom-header"), hpackReader.getAndResetHeaderList());
+ }
+
/** Oldest entries are evicted to support newer ones. */
@Test public void testEviction() throws IOException {
bytesIn.writeByte(0x40); // Literal indexed