Stop sending messages on legacy substream altogether (#6975)

* Stop sending messages on legacy substream altogether

* Ensure that handshake is sent back even in case of back-pressure

* Update client/network/src/protocol/generic_proto/handler/group.rs

Co-authored-by: Max Inden <mail@max-inden.de>

* Also process OpenRequest and Closed

* Also process OpenRequest and Closed

* Fix bad merge

* God I'm so lost with all these merges

* Immediately return Closed

* Add warning for sending on non-registered protocol

* Register GrandPa protocol in tests

* Update client/network/src/protocol/generic_proto/handler/group.rs

Co-authored-by: Max Inden <mail@max-inden.de>

Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
Pierre Krieger
2020-09-02 17:28:03 +02:00
committed by GitHub
parent 1d10db3184
commit 34980ec88a
9 changed files with 71 additions and 434 deletions
@@ -123,15 +123,6 @@ impl<TSubstream> RegisteredProtocolSubstream<TSubstream> {
self.is_closing = true;
self.send_queue.clear();
}
/// Sends a message to the substream.
pub fn send_message(&mut self, data: Vec<u8>) {
if self.is_closing {
return
}
self.send_queue.push_back(From::from(&data[..]));
}
}
/// Event produced by the `RegisteredProtocolSubstream`.