relocate response log

This commit is contained in:
yangzhouhan
2015-07-24 15:39:25 -07:00
parent 3b4ecfaa42
commit be4cb2a81a

View File

@ -191,6 +191,14 @@ func (cs *clientStream) SendMsg(m interface{}) (err error) {
}
func (cs *clientStream) RecvMsg(m interface{}) (err error) {
err = recv(cs.p, cs.codec, m)
defer func() {
// err != nil indicates the termination of the stream.
if err != nil {
cs.finish(err)
}
}()
if err == nil {
if cs.tracing {
cs.mu.Lock()
if cs.traceInfo.tr != nil {
@ -204,14 +212,6 @@ func (cs *clientStream) RecvMsg(m interface{}) (err error) {
}
cs.mu.Unlock()
}
err = recv(cs.p, cs.codec, m)
defer func() {
// err != nil indicates the termination of the stream.
if err != nil {
cs.finish(err)
}
}()
if err == nil {
if !cs.desc.ClientStreams || cs.desc.ServerStreams {
return
}