mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
rafthttp: always init streamReader before return from newPeer
Or etcd will panic if someone calls `setTerm()`, which uses streamReader internally, before streamReader is inited.
This commit is contained in:
parent
ea3c7d1d31
commit
7ff1fa36f2
@ -143,10 +143,10 @@ func startPeer(tr http.RoundTripper, urls types.URLs, local, to, cid types.ID, r
|
||||
}
|
||||
}()
|
||||
|
||||
p.msgAppReader = startStreamReader(tr, picker, streamTypeMsgAppV2, local, to, cid, status, p.recvc, p.propc, errorc)
|
||||
reader := startStreamReader(tr, picker, streamTypeMessage, local, to, cid, status, p.recvc, p.propc, errorc)
|
||||
go func() {
|
||||
var paused bool
|
||||
p.msgAppReader = startStreamReader(tr, picker, streamTypeMsgAppV2, local, to, cid, status, p.recvc, p.propc, errorc)
|
||||
reader := startStreamReader(tr, picker, streamTypeMessage, local, to, cid, status, p.recvc, p.propc, errorc)
|
||||
for {
|
||||
select {
|
||||
case m := <-p.sendc:
|
||||
|
Loading…
x
Reference in New Issue
Block a user