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()
|
ccrn := retainClientCodecResponseOrNotify()
|
||||||
|
|
||||||
if res, err := newClientCodecResponse(raw, dec); nil != err {
|
if res, err := newClientCodecResponse(raw); nil != err {
|
||||||
notify, err := newClientCodecNotify(raw, dec)
|
notify, err := newClientCodecNotify(raw)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
releaseClientCodecResponseOrNotify(ccrn)
|
releaseClientCodecResponseOrNotify(ccrn)
|
||||||
return nil, fmt.Errorf("Is not response or notification [%v]", raw)
|
return nil, fmt.Errorf("Is not response or notification [%v]", raw)
|
||||||
|
|
|
@ -13,10 +13,10 @@ import (
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// newCodecRequest returns a new ClientCodecNotify.
|
// 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.
|
// Decode the request body and check if RPC method is valid.
|
||||||
ccn := retainClientCodecNotify()
|
ccn := retainClientCodecNotify()
|
||||||
err := decoder.Decode(&ccn.notify)
|
err := json.Unmarshal(raw, &ccn.notify)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
releaseClientCodecNotify(ccn)
|
releaseClientCodecNotify(ccn)
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -13,10 +13,10 @@ import (
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// newClientCodecResponse returns a new ClientCodecResponse.
|
// 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.
|
// Decode the request body and check if RPC method is valid.
|
||||||
ccr := retainClientCodecResponse()
|
ccr := retainClientCodecResponse()
|
||||||
err := decoder.Decode(&ccr.response)
|
err := json.Unmarshal(raw, &ccr.response)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
releaseClientCodecResponse(ccr)
|
releaseClientCodecResponse(ccr)
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue
Block a user