update protocol/psrpc (#1643)

* update protocol/psrpc

* metadata references
This commit is contained in:
David Colburn
2023-04-21 12:43:20 -07:00
committed by GitHub
parent 70041f004f
commit ab6c994db4
5 changed files with 16 additions and 20 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ import (
"github.com/livekit/protocol/rpc"
"github.com/livekit/protocol/utils"
"github.com/livekit/psrpc"
"github.com/livekit/psrpc/middleware"
"github.com/livekit/psrpc/pkg/middleware"
)
var ErrSignalWriteFailed = errors.New("signal write failed")
+3 -2
View File
@@ -13,7 +13,8 @@ import (
"github.com/livekit/protocol/logger"
"github.com/livekit/protocol/rpc"
"github.com/livekit/psrpc"
"github.com/livekit/psrpc/middleware"
"github.com/livekit/psrpc/pkg/metadata"
"github.com/livekit/psrpc/pkg/middleware"
)
type SessionHandler func(
@@ -101,7 +102,7 @@ func (r *signalService) RelaySignal(stream psrpc.ServerStream[*rpc.RelaySignalRe
// copy the context to prevent a race between the session handler closing
// and the delivery of any parting messages from the client. take care to
// copy the incoming rpc headers to avoid dropping any session vars.
ctx, cancel := context.WithCancel(psrpc.NewContextWithIncomingHeader(context.Background(), psrpc.IncomingHeader(stream.Context())))
ctx, cancel := context.WithCancel(metadata.NewContextWithIncomingHeader(context.Background(), metadata.IncomingHeader(stream.Context())))
defer cancel()
req, ok := <-stream.Channel()
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"github.com/livekit/protocol/livekit"
"github.com/livekit/psrpc"
"github.com/livekit/psrpc/middleware"
"github.com/livekit/psrpc/pkg/middleware"
)
var (