diff --git a/pkg/wshrpc/wshclient/wshclientutil.go b/pkg/wshrpc/wshclient/wshclientutil.go index 52d311c0a..ac8d7e259 100644 --- a/pkg/wshrpc/wshclient/wshclientutil.go +++ b/pkg/wshrpc/wshclient/wshclientutil.go @@ -63,8 +63,8 @@ func sendRpcRequestResponseStreamHelper[T any](w *wshutil.WshRpc, command string rtnErr(respChan, err) return respChan } - opts.StreamCancelFn = func(ctx context.Context) error { - return reqHandler.SendCancel(ctx) + opts.StreamCancelFn = func() { + reqHandler.SendCancel(context.Background()) } go func() { defer func() { diff --git a/pkg/wshrpc/wshrpctypes.go b/pkg/wshrpc/wshrpctypes.go index 14ffb1477..fe8956dfa 100644 --- a/pkg/wshrpc/wshrpctypes.go +++ b/pkg/wshrpc/wshrpctypes.go @@ -373,7 +373,7 @@ type RpcOpts struct { NoResponse bool `json:"noresponse,omitempty"` Route string `json:"route,omitempty"` - StreamCancelFn func() `json:"-"` // this is an *output* parameter, set by the handler + StreamCancelFn func(context.Context) error `json:"-"` // this is an *output* parameter, set by the handler } const (