aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/http2_interop/s6.5.go
blob: 8145b6e031ab4af02383f8389b6488438f872d9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package http2interop

import (
	"time"
)

// Section 6.5 says the minimum SETTINGS_MAX_FRAME_SIZE is 16,384
func testSmallMaxFrameSize(ctx *HTTP2InteropCtx) error {
	conn, err := connect(ctx)
	if err != nil {
		return err
	}
	defer conn.Close()
	conn.Log = ctx.T.Log
	conn.SetDeadline(time.Now().Add(defaultTimeout))

	sf := &SettingsFrame{
		Params: []SettingsParameter{{
			Identifier: SettingsMaxFrameSize,
			Value:      1<<14 - 1, // 1 less than the smallest maximum
		}},
	}

	if err := http2Connect(conn, sf); err != nil {
		return err
	}

	if _, err := expectGoAwaySoon(conn); err != nil {
		return err
	}

	return nil
}