ing
This commit is contained in:
parent
74ba963ea9
commit
5cad5b126d
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user