implement a buffer pool for STREAM frames

This commit is contained in:
Marten Seemann
2019-09-04 16:45:39 +07:00
parent 326ec9e16e
commit 5ea33cd31e
70 changed files with 193 additions and 48 deletions

View File

@@ -1 +1 @@
s <09><><EFBFBD>

View File

@@ -1 +1 @@
Ą ´ŮÉ ÝťRß×MvBaz źź
d ´ŮÉ ÝťRß×MvBaz źź

View File

@@ -1 +1 @@
<EFBFBD>74
W

View File

@@ -1 +1 @@
¦z˙˙˙˙˙˙˙˙
<EFBFBD>fL<66>l<EFBFBD>Q5

View File

@@ -1 +1,2 @@
?イlコQ
6
u*.租マ<05>

View File

@@ -1 +1 @@
<EFBFBD><10><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
wK

View File

@@ -1 +1 @@
<EFBFBD>5<><35>M
<EFBFBD><10><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>

View File

@@ -1 +1 @@
<EFBFBD>H<>

Binary file not shown.

View File

@@ -1 +1 @@
M<13><EFBFBD>
<EFBFBD><11><>u<EFBFBD><75><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>

View File

@@ -1 +1 @@
/'
Z•ňG&

View File

@@ -1 +1 @@
<EFBFBD>R<>
`Ο

View File

@@ -1 +1 @@
P<14><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>

View File

@@ -1 +1 @@
o/
<EFBFBD><14><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>

View File

@@ -1 +1 @@
<EFBFBD><EFBFBD>g<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>5z<EFBFBD>

View File

@@ -1 +1 @@
îE
k€<6B><E282AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>

View File

@@ -1 +1 @@
<EFBFBD>L<>
В•Ј.

View File

@@ -1 +1 @@

<EFBFBD><16><12>M

View File

@@ -1 +1 @@
C
w

View File

@@ -1 +1 @@
<EFBFBD>


View File

@@ -1 +1 @@
ËF­F­ÓÔ˙ćŐ™VQ__S‡ä”f™Ł®ÁJ|¶®»
w˝[ŢmĽ!źvť)n§v¸#¨/ş

View File

@@ -1 +1,2 @@
<EFBFBD>
}
gʆ+«ÔKu!_²ˆ]2`ñÞ—ƒÔ š6ùl ”FãíM¦F©®´ü: ºúuí2z†¸°ÃšñÏÒ³µêyS:¿D<C2BF>,G<>2`u3<75>YÈÌð<>£ž<>J¼¼±i9{·4çï

View File

@@ -1 +1 @@
с <0C><>В_џџџџџџџџЮІшПF`ёо<D191><D0BE>
¦

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -57,6 +57,7 @@ func Fuzz(data []byte) int {
// We accept empty STREAM frames, but we don't write them.
if sf, ok := f.(*wire.StreamFrame); ok {
if sf.DataLen() == 0 {
sf.PutBack()
continue
}
}
@@ -68,6 +69,9 @@ func Fuzz(data []byte) int {
if f.Length(version) != protocol.ByteCount(frameLen) {
panic(fmt.Sprintf("Inconsistent frame length for %#v: expected %d, got %d", f, frameLen, f.Length(version)))
}
if sf, ok := f.(*wire.StreamFrame); ok {
sf.PutBack()
}
}
if b.Len() > parsedLen {
panic(fmt.Sprintf("Serialized length (%d) is longer than parsed length (%d)", b.Len(), parsedLen))

View File

@@ -88,6 +88,12 @@ func getFrames() []wire.Frame {
Data: getRandomData(50),
FinBit: true,
},
&wire.StreamFrame{ // STREAM frame at non-zero offset, with data and FIN bit. Long enough to use the buffer.
StreamID: protocol.StreamID(getRandomNumber()),
Offset: protocol.ByteCount(getRandomNumber()),
Data: getRandomData(2 * protocol.MinStreamFrameBufferSize),
FinBit: true,
},
&wire.StreamFrame{ // STREAM frame at maximum offset, with FIN bit
StreamID: protocol.StreamID(getRandomNumber()),
Offset: protocol.MaxByteCount - 5,