调整RPC通讯的最大消息尺寸

This commit is contained in:
GoEdgeLab
2021-01-16 17:31:10 +08:00
parent eeba63954c
commit 9a6620d80b

View File

@@ -309,11 +309,11 @@ func (this *RPCClient) init() error {
}
var conn *grpc.ClientConn
if u.Scheme == "http" {
conn, err = grpc.Dial(u.Host, grpc.WithInsecure())
conn, err = grpc.Dial(u.Host, grpc.WithInsecure(), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(128*1024*1024)))
} else if u.Scheme == "https" {
conn, err = grpc.Dial(u.Host, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{
InsecureSkipVerify: true,
})))
})), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(128*1024*1024)))
} else {
return errors.New("parse endpoint failed: invalid scheme '" + u.Scheme + "'")
}