This commit is contained in:
crusader 2017-11-01 17:13:23 +09:00
parent 74ba963ea9
commit 5cad5b126d
3 changed files with 6 additions and 6 deletions

View File

@ -110,8 +110,8 @@ func newClientCodecResponseOrNotify(r io.Reader, encoder encode.Encoder) (protoc
ccrn := retainClientCodecResponseOrNotify()
if res, err := newClientCodecResponse(raw, dec); nil != err {
notify, err := newClientCodecNotify(raw, dec)
if res, err := newClientCodecResponse(raw); nil != err {
notify, err := newClientCodecNotify(raw)
if nil != err {
releaseClientCodecResponseOrNotify(ccrn)
return nil, fmt.Errorf("Is not response or notification [%v]", raw)

View File

@ -13,10 +13,10 @@ import (
// ----------------------------------------------------------------------------
// newCodecRequest returns a new ClientCodecNotify.
func newClientCodecNotify(raw json.RawMessage, decoder *json.Decoder) (protocol.ClientCodecNotify, error) {
func newClientCodecNotify(raw json.RawMessage) (protocol.ClientCodecNotify, error) {
// Decode the request body and check if RPC method is valid.
ccn := retainClientCodecNotify()
err := decoder.Decode(&ccn.notify)
err := json.Unmarshal(raw, &ccn.notify)
if err != nil {
releaseClientCodecNotify(ccn)
return nil, err

View File

@ -13,10 +13,10 @@ import (
// ----------------------------------------------------------------------------
// newClientCodecResponse returns a new ClientCodecResponse.
func newClientCodecResponse(raw json.RawMessage, decoder *json.Decoder) (protocol.ClientCodecResponse, error) {
func newClientCodecResponse(raw json.RawMessage) (protocol.ClientCodecResponse, error) {
// Decode the request body and check if RPC method is valid.
ccr := retainClientCodecResponse()
err := decoder.Decode(&ccr.response)
err := json.Unmarshal(raw, &ccr.response)
if err != nil {
releaseClientCodecResponse(ccr)
return nil, err