diff --git a/loxinet/dpbroker.go b/loxinet/dpbroker.go index 3524cc6c0..14b7162ba 100644 --- a/loxinet/dpbroker.go +++ b/loxinet/dpbroker.go @@ -465,7 +465,7 @@ func (dp *DpH) WaitXsyncReady(who string) { // DpXsyncRPC - Routine for syncing connection information with peers func (dp *DpH) DpXsyncRPC(op DpSyncOpT, arg interface{}) int { - var reply,ret int + var reply, ret int var err error dp.SyncMtx.Lock() @@ -578,7 +578,7 @@ func DpBrokerInit(dph DpHookInterface, rpcMode int) *DpH { nDp.RPC = new(XSync) nDp.RPC.RPCType = rpcMode - if (rpcMode == RPCTypeNetRPC) { + if rpcMode == RPCTypeNetRPC { nDp.RPC.RPCHooks = &netRPCClient{} } else { nDp.RPC.RPCHooks = &gRPCClient{} diff --git a/loxinet/xsync_client.go b/loxinet/xsync_client.go index 32d7cc8fd..48c7a9d50 100644 --- a/loxinet/xsync_client.go +++ b/loxinet/xsync_client.go @@ -21,14 +21,14 @@ import ( "context" "errors" "fmt" + tk "github.com/loxilb-io/loxilib" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "io" "net" "net/http" "net/rpc" "time" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" - tk "github.com/loxilb-io/loxilib" ) type netRPCClient struct { @@ -112,8 +112,8 @@ func (*netRPCClient) RPCClose(pe *DpPeer) int { func (*netRPCClient) RPCSend(pe *DpPeer, rpcCallStr string, args any) (int, error) { var reply int - client, _ := pe.Client.(*rpc.Client) - timeout := 2 * time.Second + client, _ := pe.Client.(*rpc.Client) + timeout := 2 * time.Second call := client.Go(rpcCallStr, args, &reply, make(chan *rpc.Call, 1)) select { case <-time.After(timeout): @@ -122,7 +122,7 @@ func (*netRPCClient) RPCSend(pe *DpPeer, rpcCallStr string, args any) (int, erro pe.Client.(*rpc.Client).Close() } pe.Client = nil - + return reply, errors.New("netrpc call timeout") case resp := <-call.Done: if resp != nil && resp.Error != nil { @@ -259,5 +259,5 @@ func (*gRPCClient) RPCSend(pe *DpPeer, rpcCallStr string, args any) (int, error) var reply int err := callGRPC(pe.Client.(gRPCClient).xclient, rpcCallStr, args, &reply) - return reply,err + return reply, err } diff --git a/loxinet/xsync_server.go b/loxinet/xsync_server.go index d71e607a6..3661994c2 100644 --- a/loxinet/xsync_server.go +++ b/loxinet/xsync_server.go @@ -26,9 +26,9 @@ import ( "net/rpc" "runtime/debug" - "google.golang.org/grpc" opts "github.com/loxilb-io/loxilb/options" tk "github.com/loxilb-io/loxilib" + "google.golang.org/grpc" ) // DpWorkOnBlockCtAdd - Add block CT entries from remote goRPC client