mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #2026 from yichengq/272
rafthttp: fix stream.open call
This commit is contained in:
commit
1f8eef3b3b
@ -117,7 +117,7 @@ func (p *peer) Send(m raftpb.Message) error {
|
||||
p.mu.Lock()
|
||||
u := p.u
|
||||
p.mu.Unlock()
|
||||
p.stream.open(p.id, types.ID(m.To), p.cid, m.Term, p.tr, u, p.r)
|
||||
p.stream.open(types.ID(m.From), p.id, p.cid, m.Term, p.tr, u, p.r)
|
||||
p.batcher.Reset(time.Now())
|
||||
}
|
||||
|
||||
|
@ -49,12 +49,12 @@ type stream struct {
|
||||
client *streamClient
|
||||
}
|
||||
|
||||
func (s *stream) open(id, to, cid types.ID, term uint64, tr http.RoundTripper, u string, r Raft) error {
|
||||
func (s *stream) open(from, to, cid types.ID, term uint64, tr http.RoundTripper, u string, r Raft) error {
|
||||
if s.client != nil {
|
||||
panic("open: stream is open")
|
||||
}
|
||||
|
||||
c, err := newStreamClient(id, to, cid, term, tr, u, r)
|
||||
c, err := newStreamClient(from, to, cid, term, tr, u, r)
|
||||
if err != nil {
|
||||
log.Printf("stream: error opening stream: %v", err)
|
||||
return err
|
||||
|
Loading…
x
Reference in New Issue
Block a user