You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New to Hpack. Consider hpack/hpack/src/main/java/com/twitter/hpack/Encoder.java: encodeHeader() (starting at line 69)
Consider the input name="content-length", value = "1000" and sensitive == false
We fall through checks in line 72 and 79. Assume we have capacity:
Line 99: HeaderEntry headerField = getEntry("content-length", "1000") // as byte arrays
// Assume that it is not yet in dynamic array and so headerField == null
Line 105: int staticTableIndex = StaticTable.getIndex("content-length", "1000");
In StaticTable.java:
getIndex returns something not -1 because it found this name
For the loop in Line 133: Entry = HeaderField("content-length", EMPTY)
So, line 138 will never match:
if (HpackUtil.equals(value, entry.value)) {
return index;
}
The problem is not with HpackUtil.equals per se because if it did match EMPTY against "1000", then we need to encode "1000".
In Encoder.java:
if (staticTableIndex != -1) {
// Section 6.1. Indexed Header Field Representation
encodeInteger(out, 0x80, 7, staticTableIndex);
}
We need to encodeLiteral of the value "1000" and a encoderInteger of the Index. What am I missing? Thanks
The text was updated successfully, but these errors were encountered:
New to Hpack. Consider hpack/hpack/src/main/java/com/twitter/hpack/Encoder.java: encodeHeader() (starting at line 69)
Consider the input name="content-length", value = "1000" and sensitive == false
We fall through checks in line 72 and 79. Assume we have capacity:
Line 99:
HeaderEntry headerField = getEntry("content-length", "1000")
// as byte arrays// Assume that it is not yet in dynamic array and so headerField == null
Line 105:
int staticTableIndex = StaticTable.getIndex("content-length", "1000");
In StaticTable.java:
getIndex returns something not -1 because it found this name
For the loop in Line 133:
Entry = HeaderField("content-length", EMPTY)
So, line 138 will never match:
The problem is not with HpackUtil.equals per se because if it did match EMPTY against "1000", then we need to encode "1000".
In Encoder.java:
We need to encodeLiteral of the value "1000" and a encoderInteger of the Index. What am I missing? Thanks
The text was updated successfully, but these errors were encountered: