Sfoglia il codice sorgente

Revert "channel: safely shutdown the channel when an error is triggered"

This reverts commit 8a01a59b063b3d0dca1eae3963a83dcb52427487.

This commit was wrong because the channel gets shutdown after the receive loop returns Error::ChannelStopped in handle_stop()
draoi 2 anni fa
parent
commit
e9e3bd41ca
1 ha cambiato i file con 0 aggiunte e 4 eliminazioni
  1. 0 4
      src/net/channel.rs

+ 0 - 4
src/net/channel.rs

@@ -281,8 +281,6 @@ impl Channel {
                         target: "net::channel::main_receive_loop()",
                         target: "net::channel::main_receive_loop()",
                         "Stopping channel {:?}", self
                         "Stopping channel {:?}", self
                     );
                     );
-                    self.stop().await;
-
                     return Err(Error::ChannelStopped)
                     return Err(Error::ChannelStopped)
                 }
                 }
             };
             };
@@ -303,8 +301,6 @@ impl Channel {
                     // We will reject further connections from this peer
                     // We will reject further connections from this peer
                     self.p2p().hosts().mark_rejected(self.address()).await;
                     self.p2p().hosts().mark_rejected(self.address()).await;
 
 
-                    self.stop().await;
-
                     return Err(Error::ChannelStopped)
                     return Err(Error::ChannelStopped)
                 }
                 }
                 Err(_) => unreachable!("You added a new error in notify()"),
                 Err(_) => unreachable!("You added a new error in notify()"),