From ec20835c45b98adb5e5ffe1d36b9db1f79ec69b0 Mon Sep 17 00:00:00 2001 From: tutman96 <11356668+tutman96@users.noreply.github.com> Date: Thu, 30 Jan 2025 21:23:39 +0000 Subject: [PATCH] Fix jsonrpc references --- internal/jsonrpc/router.go | 2 ++ internal/plugin/rpc.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/jsonrpc/router.go b/internal/jsonrpc/router.go index fda698b..0534432 100644 --- a/internal/jsonrpc/router.go +++ b/internal/jsonrpc/router.go @@ -26,6 +26,8 @@ func NewJSONRPCRouter(writer io.Writer, handlers map[string]*RPCHandler) *JSONRP return &JSONRPCRouter{ writer: writer, handlers: handlers, + + responseChannels: make(map[int64]chan JSONRPCResponse), } } diff --git a/internal/plugin/rpc.go b/internal/plugin/rpc.go index ff31472..dacb1d8 100644 --- a/internal/plugin/rpc.go +++ b/internal/plugin/rpc.go @@ -96,7 +96,7 @@ func (s *PluginRpcServer) SocketPath() string { } func (s *PluginRpcServer) handleConnection(conn net.Conn) { - rpcserver := jsonrpc.NewJSONRPCServer(conn, map[string]*jsonrpc.RPCHandler{}) + rpcserver := jsonrpc.NewJSONRPCRouter(conn, map[string]*jsonrpc.RPCHandler{}) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -129,7 +129,7 @@ func (s *PluginRpcServer) handleConnection(conn net.Conn) { } } -func (s *PluginRpcServer) handleRpcStatus(ctx context.Context, rpcserver *jsonrpc.JSONRPCServer) { +func (s *PluginRpcServer) handleRpcStatus(ctx context.Context, rpcserver *jsonrpc.JSONRPCRouter) { s.status = PluginRpcStatusUnknown log.Printf("Plugin rpc server started. Getting supported methods...")