Skip to content

Commit

Permalink
Populate callInfo.peer object for streaming RPCs (#1356)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarghali authored and MakMukhi committed Jul 11, 2017
1 parent d69dedd commit 86ec6ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 86ec6ba

Please sign in to comment.