server: immediately return to caller when processing sendToPeer

This commit alters the logic of processing sendToPeer requests within
the server to immediately return to the caller after locating the
target peer.
This commit is contained in:
Olaoluwa Osuntokun
2017-02-02 16:57:20 -08:00
parent 3f6afa51b9
commit c1c1cabc4e

View File

@@ -640,11 +640,11 @@ out:
} }
s.peersMtx.RUnlock() s.peersMtx.RUnlock()
sMsg.errChan <- nil
for _, msg := range sMsg.msgs { for _, msg := range sMsg.msgs {
targetPeer.queueMsg(msg, nil) targetPeer.queueMsg(msg, nil)
} }
sMsg.errChan <- nil
}() }()
case query := <-s.queries: case query := <-s.queries:
switch msg := query.(type) { switch msg := query.(type) {