mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
grpc: add initial_windows_size option
This commit is contained in:
parent
3057a7c999
commit
63da3a5481
4 changed files with 29 additions and 6 deletions
|
@ -12,6 +12,7 @@ type GRPCConfig struct {
|
|||
IdleTimeout int32 `json:"idle_timeout"`
|
||||
HealthCheckTimeout int32 `json:"health_check_timeout"`
|
||||
PermitWithoutStream bool `json:"permit_without_stream"`
|
||||
InitialWindowsSize int32 `json:"initial_windows_size"`
|
||||
}
|
||||
|
||||
func (g *GRPCConfig) Build() (proto.Message, error) {
|
||||
|
@ -21,11 +22,17 @@ func (g *GRPCConfig) Build() (proto.Message, error) {
|
|||
if g.HealthCheckTimeout <= 0 {
|
||||
g.HealthCheckTimeout = 0
|
||||
}
|
||||
if g.InitialWindowsSize < 0 {
|
||||
// default window size of gRPC-go
|
||||
g.InitialWindowsSize = 0
|
||||
}
|
||||
|
||||
return &grpc.Config{
|
||||
ServiceName: g.ServiceName,
|
||||
MultiMode: g.MultiMode,
|
||||
IdleTimeout: g.IdleTimeout,
|
||||
HealthCheckTimeout: g.HealthCheckTimeout,
|
||||
PermitWithoutStream: g.PermitWithoutStream,
|
||||
InitialWindowsSize: g.InitialWindowsSize,
|
||||
}, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue