diff --git a/rpc/client.go b/rpc/client.go index 279cc1fd7575f..d335119527dca 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -254,7 +254,7 @@ func newClient(initctx context.Context, connect reconnectFunc) (*Client, error) return c, nil } -func initClient(conn ServerCodec, idgen func() ID, services *serviceRegistry) *Client { +func initClientWithBatchLimits(conn ServerCodec, idgen func() ID, services *serviceRegistry, limit int, size int) *Client { _, isHTTP := conn.(*httpConn) c := &Client{ isHTTP: isHTTP, @@ -277,6 +277,10 @@ func initClient(conn ServerCodec, idgen func() ID, services *serviceRegistry) *C return c } +func initClient(conn ServerCodec, idgen func() ID, services *serviceRegistry) *Client { + return initClientWithBatchLimits(conn, idgen, services, 0, 0) +} + // RegisterName creates a service for the given receiver type under the given name. When no // methods on the given receiver match the criteria to be either a RPC method or a // subscription an error is returned. Otherwise a new service is created and added to the diff --git a/rpc/server.go b/rpc/server.go index 74b01dda253a9..3949c5a417561 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -94,8 +94,7 @@ func (s *Server) ServeCodec(codec ServerCodec, options CodecOption) { } defer s.untrackCodec(codec) - c := initClient(codec, s.idgen, &s.services) - c.SetBatchLimits(s.batchRequestLimit, s.batchResponseMaxSize) + c := initClientWithBatchLimits(codec, s.idgen, &s.services, s.batchRequestLimit, s.batchResponseMaxSize) <-codec.closed() c.Close() }