From 0e42bae0a0561372f5bc07fb5db8be74a433471a Mon Sep 17 00:00:00 2001 From: iamqizhao Date: Tue, 31 Mar 2015 18:15:37 -0700 Subject: [PATCH] send an empty settings frame instead of a default --- transport/http2_client.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/transport/http2_client.go b/transport/http2_client.go index 87467cbb..28caf6c4 100644 --- a/transport/http2_client.go +++ b/transport/http2_client.go @@ -137,11 +137,12 @@ func newHTTP2Client(addr string, opts *DialOptions) (_ ClientTransport, err erro return nil, ConnectionErrorf("transport: preface mismatch, wrote %d bytes; want %d", n, len(clientPreface)) } framer := newFramer(conn) - var setting http2.Setting if initialWindowSize != defaultWindowSize { - setting = http2.Setting{http2.SettingInitialWindowSize, uint32(initialWindowSize)} + err = framer.writeSettings(true, http2.Setting{http2.SettingInitialWindowSize, uint32(initialWindowSize)}) + } else { + err = framer.writeSettings(true) } - if err := framer.writeSettings(true, setting); err != nil { + if err != nil { return nil, ConnectionErrorf("transport: %v", err) } // Adjust the connection flow control window if needed.