Skip to content

Commit

Permalink
fix: validate the grpc buffer size setting by option (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
SinnerA authored May 6, 2022
1 parent 5c30cb1 commit 021b894
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions pkg/remote/trans/nphttp2/grpc/http2_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,14 @@ func newHTTP2Client(ctx context.Context, conn net.Conn, opts ConnectOptions,
dynamicWindow = false
}

writeBufSize := opts.WriteBufferSize
readBufSize := opts.ReadBufferSize
writeBufSize := defaultWriteBufferSize
readBufSize := defaultReadBufferSize
if opts.WriteBufferSize > 0 {
writeBufSize = opts.WriteBufferSize
}
if opts.ReadBufferSize > 0 {
readBufSize = opts.ReadBufferSize
}
maxHeaderListSize := defaultClientMaxHeaderListSize
if opts.MaxHeaderListSize != nil {
maxHeaderListSize = *opts.MaxHeaderListSize
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ package kitex
// Name and Version info of this framework, used for statistics and debug
const (
Name = "Kitex"
Version = "v0.3.0"
Version = "v0.3.1"
)

0 comments on commit 021b894

Please sign in to comment.