Merge branch 'master' of https://github.com/grpc/grpc-go
diff --git a/server.go b/server.go
index d8605c1..be0564e 100644
--- a/server.go
+++ b/server.go
@@ -289,6 +289,7 @@
traceInfo.tr = stream.Trace()
defer traceInfo.tr.Finish()
traceInfo.firstLine.client = false
+ traceInfo.firstLine.remoteAddr = t.RemoteAddr()
traceInfo.tr.LazyLog(&traceInfo.firstLine, false)
defer func() {
if err != nil && err != io.EOF {
@@ -393,6 +394,7 @@
//ss.traceInfo.tr = trace.New("grpc.Recv."+methodFamily(stream.Method()), stream.Method())
ss.traceInfo.tr = stream.Trace()
ss.traceInfo.firstLine.client = false
+ ss.traceInfo.firstLine.remoteAddr = t.RemoteAddr()
ss.traceInfo.tr.LazyLog(&ss.traceInfo.firstLine, false)
ss.ctx = trace.NewContext(ss.ctx, ss.traceInfo.tr)
defer func() {
diff --git a/transport/http2_server.go b/transport/http2_server.go
index 172b475..b7cc536 100644
--- a/transport/http2_server.go
+++ b/transport/http2_server.go
@@ -696,3 +696,7 @@
// other goroutines.
s.cancel()
}
+
+func (t *http2Server) RemoteAddr() net.Addr {
+ return t.conn.RemoteAddr()
+}
diff --git a/transport/transport.go b/transport/transport.go
index b028797..7ea2a11 100644
--- a/transport/transport.go
+++ b/transport/transport.go
@@ -398,6 +398,8 @@
// should not be accessed any more. All the pending streams and their
// handlers will be terminated asynchronously.
Close() error
+ // RemoteAddr returns the remote network address.
+ RemoteAddr() net.Addr
}
// StreamErrorf creates an StreamError with the specified error code and description.