diff --git a/rpc/lux_rpc_client.go b/rpc/lux_rpc_client.go index d1e2d59..6ba164f 100644 --- a/rpc/lux_rpc_client.go +++ b/rpc/lux_rpc_client.go @@ -56,7 +56,7 @@ func (rpc *LuxRpcClient) Execute(request LuxRpcRequest) (LuxRpcResponse, LuxRpcE return rpcRes, rpcErr, err } - if def.Feed(part[n:]) { + if def.Feed(part[:n]) { // got full data, either its response or error if def.HasResponse() { xmlBytes := def.GetAndForget() diff --git a/rpc/lux_rpc_server.go b/rpc/lux_rpc_server.go index 03ccd75..d50391c 100644 --- a/rpc/lux_rpc_server.go +++ b/rpc/lux_rpc_server.go @@ -38,7 +38,11 @@ func (rpc *LuxRpcServer) HandleRequest(request LuxRpcRequest, rpcType LuxRpcType }, false } - return ctrl.Handle(request, rpcType) + rpcRes, rpcErr, err := ctrl.Handle(request, rpcType) + rpcRes.RequestID = request.RequestID + rpcErr.RequestID = request.RequestID + + return rpcRes, rpcErr, err } func (rpc *LuxRpcServer) AddEndpoint(network string, listenOn string, rpcType LuxRpcType) error { @@ -90,7 +94,7 @@ func (rpc *LuxRpcServer) AddEndpoint(network string, listenOn string, rpcType Lu var cmd LuxRpcRequest if err := xml.Unmarshal(xmlBytes, &cmd); err != nil { - log.Errorf("faield to parse rpc %v: %s", err, string(xmlBytes)) + log.Errorf("failed to parse rpc %v: %s", err, string(xmlBytes)) continue }