Commit 6c7942f1 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 76f1d42d
...@@ -336,9 +336,23 @@ func (nl *NodeLink) serveRecv() { ...@@ -336,9 +336,23 @@ func (nl *NodeLink) serveRecv() {
if nl.acceptq != nil { if nl.acceptq != nil {
// we are accepting new incoming connection // we are accepting new incoming connection
conn = nl.newConn(connId) conn = nl.newConn(connId)
// XXX what if Accept exited because of just recently close(nl.down)?
// -> check nl.down here too ? select {
nl.acceptq <- conn case <-nl.down:
// Accept and loop calling it can exit if shutdown was requested
// if so we are also exiting
nl.connMu.Unlock()
// make sure not to leave rx error as nil
nl.errMu.Lock()
nl.errRecv = ErrLinkDown
nl.errMu.Unlock()
return
case nl.acceptq <- conn:
// ok
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment