Skip to content

Commit

Permalink
Fix recvfd/senfd clients
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
  • Loading branch information
Vladimir Popov committed Oct 20, 2021
1 parent 107a789 commit d14a71d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/networkservice/common/mechanisms/recvfd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func NewClient() networkservice.NetworkServiceClient {
func (r *recvFDClient) Request(ctx context.Context, request *networkservice.NetworkServiceRequest, opts ...grpc.CallOption) (*networkservice.Connection, error) {
// Get the grpcfd.FDRecver
rpcCredentials := grpcfd.PerRPCCredentials(grpcfd.PerRPCCredentialsFromCallOptions(opts...))
opts = append(opts, grpc.PerRPCCredentials(rpcCredentials))
opts = append([]grpc.CallOption{grpc.PerRPCCredentials(rpcCredentials)}, opts...)
recv, _ := grpcfd.FromPerRPCCredentials(rpcCredentials)

// Call the next Client in the chain
Expand Down Expand Up @@ -76,7 +76,7 @@ func (r *recvFDClient) Request(ctx context.Context, request *networkservice.Netw
func (r *recvFDClient) Close(ctx context.Context, conn *networkservice.Connection, opts ...grpc.CallOption) (*empty.Empty, error) {
// Get the grpcfd.FDRecver
rpcCredentials := grpcfd.PerRPCCredentials(grpcfd.PerRPCCredentialsFromCallOptions(opts...))
opts = append(opts, grpc.PerRPCCredentials(rpcCredentials))
opts = append([]grpc.CallOption{grpc.PerRPCCredentials(rpcCredentials)}, opts...)
recv, _ := grpcfd.FromPerRPCCredentials(rpcCredentials)

// Get the fileMap
Expand Down
4 changes: 2 additions & 2 deletions pkg/networkservice/common/mechanisms/sendfd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func NewClient() networkservice.NetworkServiceClient {
func (s *sendFDClient) Request(ctx context.Context, request *networkservice.NetworkServiceRequest, opts ...grpc.CallOption) (*networkservice.Connection, error) {
// Get the grpcfd.FDSender
rpcCredentials := grpcfd.PerRPCCredentials(grpcfd.PerRPCCredentialsFromCallOptions(opts...))
opts = append(opts, grpc.PerRPCCredentials(rpcCredentials))
opts = append([]grpc.CallOption{grpc.PerRPCCredentials(rpcCredentials)}, opts...)
sender, _ := grpcfd.FromPerRPCCredentials(rpcCredentials)

// Iterate over mechanisms
Expand Down Expand Up @@ -68,7 +68,7 @@ func (s *sendFDClient) Request(ctx context.Context, request *networkservice.Netw

func (s *sendFDClient) Close(ctx context.Context, conn *networkservice.Connection, opts ...grpc.CallOption) (*empty.Empty, error) {
rpcCredentials := grpcfd.PerRPCCredentials(grpcfd.PerRPCCredentialsFromCallOptions(opts...))
opts = append(opts, grpc.PerRPCCredentials(rpcCredentials))
opts = append([]grpc.CallOption{grpc.PerRPCCredentials(rpcCredentials)}, opts...)
sender, _ := grpcfd.FromPerRPCCredentials(rpcCredentials)

// Send the FD and swap the FileURL for an InodeURL
Expand Down

0 comments on commit d14a71d

Please sign in to comment.