This commit is contained in:
crusader 2017-11-03 15:35:43 +09:00
parent b8600ca9a4
commit d061f15efb
4 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@ func (ccn *ClientCodecNotify) Method() string {
return ccn.notify.Method return ccn.notify.Method
} }
func (ccn *ClientCodecNotify) ReadParams(args *[]interface{}) error { func (ccn *ClientCodecNotify) ReadParams(args []interface{}) error {
if ccn.err == nil && ccn.notify.Params != nil { if ccn.err == nil && ccn.notify.Params != nil {
// Note: if scr.request.Params is nil it's not an error, it's an optional member. // Note: if scr.request.Params is nil it's not an error, it's an optional member.
// JSON params structured object. Unmarshal to the args object. // JSON params structured object. Unmarshal to the args object.

View File

@ -160,7 +160,7 @@ func (scr *ServerCodecRequest) Method() string {
// absence of expected names MAY result in an error being // absence of expected names MAY result in an error being
// generated. The names MUST match exactly, including // generated. The names MUST match exactly, including
// case, to the method's expected parameters. // case, to the method's expected parameters.
func (scr *ServerCodecRequest) ReadParams(args *[]interface{}) error { func (scr *ServerCodecRequest) ReadParams(args []interface{}) error {
if scr.err == nil && scr.request.Params != nil { if scr.err == nil && scr.request.Params != nil {
// Note: if scr.request.Params is nil it's not an error, it's an optional member. // Note: if scr.request.Params is nil it's not an error, it's an optional member.
// JSON params structured object. Unmarshal to the args object. // JSON params structured object. Unmarshal to the args object.

View File

@ -8,6 +8,6 @@ type RegistryCodec interface {
// Reads the request and returns the RPC method name. // Reads the request and returns the RPC method name.
Method() string Method() string
// Reads the request filling the RPC method args. // Reads the request filling the RPC method args.
ReadParams(args *[]interface{}) error ReadParams(args []interface{}) error
Complete() Complete()
} }

View File

@ -80,7 +80,7 @@ func (rr *rpcRegistry) Invoke(codec protocol.RegistryCodec) (result interface{},
pValues, pInstances := methodSpec.getParamValues() pValues, pInstances := methodSpec.getParamValues()
if nil != pInstances && 0 < len(pInstances) { if nil != pInstances && 0 < len(pInstances) {
if errRead := codec.ReadParams(&pInstances); errRead != nil { if errRead := codec.ReadParams(pInstances); errRead != nil {
return nil, errRead return nil, errRead
} }
pCount := len(pInstances) pCount := len(pInstances)