Преглед на файлове

Merge pull request #2968 from yichengq/fix-stream-reader-init

rafthttp: always init streamReader before return from newPeer
Yicheng Qin преди 11 години
родител
ревизия
219d304291
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      rafthttp/peer.go

+ 2 - 2
rafthttp/peer.go

@@ -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: