Skip to content

Commit

Permalink
remove ID it's not needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukedirtwalker committed Nov 13, 2019
1 parent 637a903 commit 67ef558
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
1 change: 0 additions & 1 deletion go/lib/sciond/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ go_library(
"//go/lib/infra/disp:go_default_library",
"//go/lib/log:go_default_library",
"//go/lib/sciond/internal/metrics:go_default_library",
"//go/lib/scrypto:go_default_library",
"//go/lib/serrors:go_default_library",
"//go/lib/sock/reliable:go_default_library",
"//go/lib/util:go_default_library",
Expand Down
16 changes: 0 additions & 16 deletions go/lib/sciond/sciond.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ package sciond
import (
"context"
"fmt"
"sync/atomic"
"time"

"github.com/scionproto/scion/go/lib/addr"
Expand All @@ -39,7 +38,6 @@ import (
"github.com/scionproto/scion/go/lib/infra/disp"
"github.com/scionproto/scion/go/lib/log"
"github.com/scionproto/scion/go/lib/sciond/internal/metrics"
"github.com/scionproto/scion/go/lib/scrypto"
"github.com/scionproto/scion/go/lib/serrors"
"github.com/scionproto/scion/go/lib/sock/reliable"
"github.com/scionproto/scion/go/proto"
Expand All @@ -50,10 +48,6 @@ var (
ErrUnableToConnect = serrors.New("unable to connect to SCIOND")
)

var (
requestID = scrypto.RandUint64()
)

const (
// DefaultSCIONDPath contains the system default for a SCIOND socket.
DefaultSCIONDPath = "/run/shm/sciond/default.sock"
Expand Down Expand Up @@ -185,7 +179,6 @@ func (c *conn) Paths(ctx context.Context, dst, src addr.IA, max uint16,
reply, err := roundTripper.Request(
ctx,
&Pld{
Id: nextID(),
Which: proto.SCIONDMsg_Which_pathReq,
PathReq: &PathReq{
Dst: dst.IAInt(),
Expand Down Expand Up @@ -214,7 +207,6 @@ func (c *conn) ASInfo(ctx context.Context, ia addr.IA) (*ASInfoReply, error) {
pld, err := roundTripper.Request(
ctx,
&Pld{
Id: nextID(),
Which: proto.SCIONDMsg_Which_asInfoReq,
AsInfoReq: &ASInfoReq{
Isdas: ia.IAInt(),
Expand All @@ -240,7 +232,6 @@ func (c *conn) IFInfo(ctx context.Context, ifs []common.IFIDType) (*IFInfoReply,
pld, err := roundTripper.Request(
ctx,
&Pld{
Id: nextID(),
Which: proto.SCIONDMsg_Which_ifInfoRequest,
IfInfoRequest: &IFInfoRequest{
IfIDs: ifs,
Expand Down Expand Up @@ -268,7 +259,6 @@ func (c *conn) SVCInfo(ctx context.Context,
pld, err := roundTripper.Request(
ctx,
&Pld{
Id: nextID(),
Which: proto.SCIONDMsg_Which_serviceInfoRequest,
ServiceInfoRequest: &ServiceInfoRequest{
ServiceTypes: svcTypes,
Expand Down Expand Up @@ -305,7 +295,6 @@ func (c *conn) RevNotification(ctx context.Context,
reply, err := roundTripper.Request(
ctx,
&Pld{
Id: nextID(),
Which: proto.SCIONDMsg_Which_revNotification,
RevNotification: &RevNotification{
SRevInfo: sRevInfo,
Expand All @@ -325,11 +314,6 @@ func (c *conn) Close(_ context.Context) error {
return nil
}

// nextID returns a unique value for identifiying SCIOND requests.
func nextID() uint64 {
return atomic.AddUint64(&requestID, 1)
}

func connectTimeout(socketName string, timeout time.Duration) (*disp.Dispatcher, error) {
rConn, err := reliable.DialTimeout(socketName, timeout)
if err != nil {
Expand Down

0 comments on commit 67ef558

Please sign in to comment.