Skip to content

Commit

Permalink
fix: remove derp route on peergone
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed May 1, 2023
1 parent 295d4cf commit cefc8ba
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/hp/magicsock/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,8 @@ impl Actor {

let derp_client = self.connect(region_id, Some(&peer)).await;
for content in contents {
info!("[UDP] -> {} ({}b)", region_id, content.len());

match derp_client.send(peer.clone(), content).await {
Ok(_) => {
// TODO:
Expand Down Expand Up @@ -2882,9 +2884,14 @@ impl ReaderState {
// health.SetDERPRegionHealth(regionID, m.Problem);
(self, ReadResult::Continue, ReadAction::None)
}
derp::ReceivedMessage::PeerGone(_key) => {
// self.remove_derp_peer_route(key, region_id, &dc).await;
(self, ReadResult::Continue, ReadAction::None)
derp::ReceivedMessage::PeerGone(key) => {
let read_action = ReadAction::RemovePeerRoute {
peers: vec![key],
region: self.region,
derp_client: self.derp_client.clone(),
};

(self, ReadResult::Continue, read_action)
}
_ => {
// Ignore.
Expand Down

0 comments on commit cefc8ba

Please sign in to comment.