1
0
Fork 0
mirror of https://github.com/sourcegraph/jsonrpc2.git synced 2026-08-16 10:08:12 +02:00

fix: don't apply nil CallOption and ConnOpt

This commit is contained in:
Ggicci 2019-01-07 01:47:28 +08:00
parent 549eb959f0
commit 3e2e814648
2 changed files with 13 additions and 4 deletions

View file

@ -409,12 +409,12 @@ func TestConn_Close_waitingForResponse(t *testing.T) {
<-done
}
func serve(ctx context.Context, lis net.Listener, h jsonrpc2.Handler, opt ...jsonrpc2.ConnOpt) error {
func serve(ctx context.Context, lis net.Listener, h jsonrpc2.Handler, opts ...jsonrpc2.ConnOpt) error {
for {
conn, err := lis.Accept()
if err != nil {
return err
}
jsonrpc2.NewConn(ctx, jsonrpc2.NewBufferedStream(conn, jsonrpc2.VarintObjectCodec{}), h, opt...)
jsonrpc2.NewConn(ctx, jsonrpc2.NewBufferedStream(conn, jsonrpc2.VarintObjectCodec{}), h, opts...)
}
}