Populate callInfo.peer object for streaming RPCs (#1356)

This commit is contained in:
Cesar Ghali 2017-07-11 13:56:13 -07:00 committed by mmukhi
parent d69dedd8b7
commit 86ec6baad9
1 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import (
"golang.org/x/net/trace"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/peer"
"google.golang.org/grpc/stats"
"google.golang.org/grpc/status"
"google.golang.org/grpc/transport"
@ -221,6 +222,10 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth
}
break
}
// Set callInfo.peer object from stream's context.
if peer, ok := peer.FromContext(s.Context()); ok {
c.peer = peer
}
cs := &clientStream{
opts: opts,
c: c,