Skip to content

Commit

Permalink
Merge pull request #389 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
chore: gofmt related changes
  • Loading branch information
UltraInstinct14 authored Sep 7, 2023
2 parents a97c307 + 9b44465 commit 58a5658
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions loxinet/dpbroker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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{}
Expand Down
14 changes: 7 additions & 7 deletions loxinet/xsync_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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):
Expand All @@ -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 {
Expand Down Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion loxinet/xsync_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 58a5658

Please sign in to comment.