blob: 8145b6e031ab4af02383f8389b6488438f872d9d [file] [log] [blame]
Carl Mastrangelo368a3042015-12-01 16:19:23 -08001package http2interop
2
3import (
4 "time"
5)
6
7// Section 6.5 says the minimum SETTINGS_MAX_FRAME_SIZE is 16,384
8func testSmallMaxFrameSize(ctx *HTTP2InteropCtx) error {
9 conn, err := connect(ctx)
10 if err != nil {
11 return err
12 }
13 defer conn.Close()
14 conn.Log = ctx.T.Log
15 conn.SetDeadline(time.Now().Add(defaultTimeout))
16
17 sf := &SettingsFrame{
18 Params: []SettingsParameter{{
19 Identifier: SettingsMaxFrameSize,
20 Value: 1<<14 - 1, // 1 less than the smallest maximum
21 }},
22 }
23
24 if err := http2Connect(conn, sf); err != nil {
25 return err
26 }
27
28 if _, err := expectGoAwaySoon(conn); err != nil {
29 return err
30 }
31
32 return nil
33}