From af7b7c14bda15de1849b51a2221bee1c9085a624 Mon Sep 17 00:00:00 2001 From: crusader Date: Thu, 23 Nov 2017 18:28:18 +0900 Subject: [PATCH] ing --- protocol/json/client.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/protocol/json/client.go b/protocol/json/client.go index e5fe5de..0a0adea 100644 --- a/protocol/json/client.go +++ b/protocol/json/client.go @@ -110,28 +110,28 @@ func newClientCodecResponseOrNotify(r io.Reader, encoder encode.Encoder) (protoc ccrn := retainClientCodecResponseOrNotify() - // if notify, err := newClientCodecNotify(raw); nil != err { - // res, err := newClientCodecResponse(raw) - // if nil != err { - // releaseClientCodecResponseOrNotify(ccrn) - // return nil, fmt.Errorf("Is not response or notification [%v]", raw) - // } - // ccrn.response = res - // } else { - // ccrn.notify = notify - // } - - if res, err := newClientCodecResponse(raw); nil != err { - notify, err := newClientCodecNotify(raw) + if notify, err := newClientCodecNotify(raw); nil != err { + res, err := newClientCodecResponse(raw) if nil != err { releaseClientCodecResponseOrNotify(ccrn) return nil, fmt.Errorf("Is not response or notification [%v]", raw) } - ccrn.notify = notify - } else { ccrn.response = res + } else { + ccrn.notify = notify } + // 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) + // } + // ccrn.notify = notify + // } else { + // ccrn.response = res + // } + return ccrn, nil }