From b0a6ffd8406f60cd0abe34dd0e1589e8f9e385ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 25 Apr 2023 17:30:12 +0800 Subject: [PATCH] Fix h2 buffer too large --- h2mux.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/h2mux.go b/h2mux.go index 2ba0b4a..c4fc986 100644 --- a/h2mux.go +++ b/h2mux.go @@ -37,7 +37,8 @@ func newH2MuxServer(conn net.Conn) *h2MuxServerSession { inbound: make(chan net.Conn), done: make(chan struct{}), server: http2.Server{ - IdleTimeout: idleTimeout, + IdleTimeout: idleTimeout, + MaxReadFrameSize: buf.BufferSize, }, } go func() { @@ -168,7 +169,8 @@ func newH2MuxClient(conn net.Conn) (*h2MuxClientSession, error) { DialTLSContext: func(ctx context.Context, network, addr string, cfg *tls.Config) (net.Conn, error) { return conn, nil }, - ReadIdleTimeout: idleTimeout, + ReadIdleTimeout: idleTimeout, + MaxReadFrameSize: buf.BufferSize, }, done: make(chan struct{}), }