Leave loop running
This commit is contained in:
parent
78ad28d70f
commit
a1b0f072f7
1 changed files with 3 additions and 3 deletions
6
peer.go
6
peer.go
|
@ -137,7 +137,6 @@ func (p *peer) handle(ctx context.Context) error {
|
||||||
log.Printf("Open-Rsp error code from peer %v: %d", p.raddr.IP, pkt.RateOrErrCode)
|
log.Printf("Open-Rsp error code from peer %v: %d", p.raddr.IP, pkt.RateOrErrCode)
|
||||||
// Close the connection
|
// Close the connection
|
||||||
rstate = receiverStateUnconnected
|
rstate = receiverStateUnconnected
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Make other requests
|
// TODO: Make other requests
|
||||||
|
@ -157,13 +156,14 @@ func (p *peer) handle(ctx context.Context) error {
|
||||||
// TODO: Integrate info into route table
|
// TODO: Integrate info into route table
|
||||||
|
|
||||||
case *aurp.RDPacket:
|
case *aurp.RDPacket:
|
||||||
// TODO: Remove router from tables
|
// TODO: Remove router from route tables
|
||||||
// TODO: Close connection
|
|
||||||
log.Printf("Router Down: error code %d %s", pkt.ErrorCode, pkt.ErrorCode)
|
log.Printf("Router Down: error code %d %s", pkt.ErrorCode, pkt.ErrorCode)
|
||||||
// Respond with RI-Ack
|
// Respond with RI-Ack
|
||||||
if _, err := p.send(p.tr.NewRIAckPacket(pkt.ConnectionID, pkt.Sequence, 0)); err != nil {
|
if _, err := p.send(p.tr.NewRIAckPacket(pkt.ConnectionID, pkt.Sequence, 0)); err != nil {
|
||||||
log.Printf("Couldn't send RI-Ack: %v", err)
|
log.Printf("Couldn't send RI-Ack: %v", err)
|
||||||
}
|
}
|
||||||
|
// Connection closed
|
||||||
rstate = receiverStateUnconnected
|
rstate = receiverStateUnconnected
|
||||||
|
|
||||||
case *aurp.ZIReqPacket:
|
case *aurp.ZIReqPacket:
|
||||||
|
|
Loading…
Reference in a new issue