Skip to content

Commit 3969aeb

Browse files
committed
update grpc options field and docs
1 parent 87f3bd0 commit 3969aeb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

client.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,10 @@ type ClientConfig struct {
205205
// You cannot Reattach to a server with this option enabled.
206206
AutoMTLS bool
207207

208-
// DialOptions allows plugin users to pass custom grpc.DialOption
209-
// to create connections
210-
DialOptions []grpc.DialOption
208+
// GRPCDialOptions allows plugin users to pass custom grpc.DialOption
209+
// to create gRPC connections. This only affects plugins using the gRPC
210+
// protocol.
211+
GRPCDialOptions []grpc.DialOption
211212
}
212213

213214
// ReattachConfig is used to configure a client to reattach to an

grpc_client.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func dialGRPCConn(tls *tls.Config, dialer func(string, time.Duration) (net.Conn,
3737
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(math.MaxInt32)),
3838
grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(math.MaxInt32)))
3939

40+
// Add our custom options if we have any
4041
opts = append(opts, dialOpts...)
4142

4243
// Connect. Note the first parameter is unused because we use a custom
@@ -52,7 +53,7 @@ func dialGRPCConn(tls *tls.Config, dialer func(string, time.Duration) (net.Conn,
5253
// newGRPCClient creates a new GRPCClient. The Client argument is expected
5354
// to be successfully started already with a lock held.
5455
func newGRPCClient(doneCtx context.Context, c *Client) (*GRPCClient, error) {
55-
conn, err := dialGRPCConn(c.config.TLSConfig, c.dialer, c.config.DialOptions...)
56+
conn, err := dialGRPCConn(c.config.TLSConfig, c.dialer, c.config.GRPCDialOptions...)
5657
if err != nil {
5758
return nil, err
5859
}

0 commit comments

Comments
 (0)