Merge branch 'master' of https://github.com/grpc/grpc-go
This commit is contained in:
@ -42,6 +42,7 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
"golang.org/x/net/trace"
|
"golang.org/x/net/trace"
|
||||||
@ -290,6 +291,9 @@ func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport.
|
|||||||
defer traceInfo.tr.Finish()
|
defer traceInfo.tr.Finish()
|
||||||
traceInfo.firstLine.client = false
|
traceInfo.firstLine.client = false
|
||||||
traceInfo.firstLine.remoteAddr = t.RemoteAddr()
|
traceInfo.firstLine.remoteAddr = t.RemoteAddr()
|
||||||
|
if dl, ok := ctx.Deadline(); ok {
|
||||||
|
traceInfo.firstLine.deadline = dl.Sub(time.Now())
|
||||||
|
}
|
||||||
traceInfo.tr.LazyLog(&traceInfo.firstLine, false)
|
traceInfo.tr.LazyLog(&traceInfo.firstLine, false)
|
||||||
defer func() {
|
defer func() {
|
||||||
if err != nil && err != io.EOF {
|
if err != nil && err != io.EOF {
|
||||||
@ -395,6 +399,9 @@ func (s *Server) processStreamingRPC(t transport.ServerTransport, stream *transp
|
|||||||
ss.traceInfo.tr = stream.Trace()
|
ss.traceInfo.tr = stream.Trace()
|
||||||
ss.traceInfo.firstLine.client = false
|
ss.traceInfo.firstLine.client = false
|
||||||
ss.traceInfo.firstLine.remoteAddr = t.RemoteAddr()
|
ss.traceInfo.firstLine.remoteAddr = t.RemoteAddr()
|
||||||
|
if dl, ok := ctx.Deadline(); ok {
|
||||||
|
ss.traceInfo.firstLine.deadline = dl.Sub(time.Now())
|
||||||
|
}
|
||||||
ss.traceInfo.tr.LazyLog(&ss.traceInfo.firstLine, false)
|
ss.traceInfo.tr.LazyLog(&ss.traceInfo.firstLine, false)
|
||||||
ss.ctx = trace.NewContext(ss.ctx, ss.traceInfo.tr)
|
ss.ctx = trace.NewContext(ss.ctx, ss.traceInfo.tr)
|
||||||
defer func() {
|
defer func() {
|
||||||
|
Reference in New Issue
Block a user