Browse Source

rafthttp: remove raftPrefix

Xiang Li 11 years ago
parent
commit
d2c7a7e5cb
1 changed files with 2 additions and 6 deletions
  1. 2 6
      rafthttp/transport.go

+ 2 - 6
rafthttp/transport.go

@@ -14,10 +14,6 @@ import (
 	"github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
 )
 
-const (
-	raftPrefix = "/raft"
-)
-
 type Raft interface {
 	Process(ctx context.Context, m raftpb.Message) error
 }
@@ -119,7 +115,7 @@ func (t *transport) AddPeer(id types.ID, urls []string) {
 	if err != nil {
 		log.Panicf("unexpect peer url %s", peerURL)
 	}
-	u.Path = path.Join(u.Path, raftPrefix)
+	u.Path = path.Join(u.Path, RaftPrefix)
 	fs := t.leaderStats.Follower(id.String())
 	t.peers[id] = NewPeer(t.roundTripper, u.String(), id, t.clusterID,
 		t.raft, fs, t.shouldstop)
@@ -144,7 +140,7 @@ func (t *transport) UpdatePeer(id types.ID, urls []string) {
 	if err != nil {
 		log.Panicf("unexpect peer url %s", peerURL)
 	}
-	u.Path = path.Join(u.Path, raftPrefix)
+	u.Path = path.Join(u.Path, RaftPrefix)
 	t.peers[id].Update(u.String())
 }