mirror of https://github.com/grpc/grpc-go.git
Populate callInfo.peer object for streaming RPCs (#1356)
This commit is contained in:
parent
d69dedd8b7
commit
86ec6baad9
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue