put back forwarder channel nil check
since otherwise forward(...) can block indefinitely due to both the forwarder channel and finshed channel being nil
This commit is contained in:
1 parent
b6448fa196
commit
4eda7e361b
1 file changed
+4
@@ -87,6 +87,10 @@ func (conn *LocalConnection) Forward(df bool, frame *ForwardedFrame, dec *Ethern
|
|||||||
)
|
)
|
||||||
conn.RUnlock()
|
conn.RUnlock()
|
||||||
|
|
||||||
|
if forwardChan == nil || forwardChanDF == nil {
|
||||||
|
conn.Log("Cannot forward frame yet - awaiting contact")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
// We could use non-blocking channel sends here, i.e. drop frames
|
// We could use non-blocking channel sends here, i.e. drop frames
|
||||||
// on the floor when the forwarder is busy. This would allow our
|
// on the floor when the forwarder is busy. This would allow our
|
||||||
// caller - the capturing loop in the router - to read frames more
|
// caller - the capturing loop in the router - to read frames more
|
||||||
|
|||||||
Reference in new issue
Block a user