mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-13 18:11:22 +00:00
Add ProtocolsHandler::InboundOpenInfo
. (#1714)
* Add `ProtocolsHandler::InboundOpenInfo`. * Update swarm/src/protocols_handler/multi.rs Co-authored-by: Roman Borschel <romanb@users.noreply.github.com> * Update CHANGELOGs and versions. Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
This commit is contained in:
@ -93,14 +93,16 @@ impl ProtocolsHandler for IdentifyHandler {
|
||||
type InboundProtocol = IdentifyProtocolConfig;
|
||||
type OutboundProtocol = IdentifyProtocolConfig;
|
||||
type OutboundOpenInfo = ();
|
||||
type InboundOpenInfo = ();
|
||||
|
||||
fn listen_protocol(&self) -> SubstreamProtocol<Self::InboundProtocol> {
|
||||
SubstreamProtocol::new(self.config.clone())
|
||||
fn listen_protocol(&self) -> SubstreamProtocol<Self::InboundProtocol, Self::InboundOpenInfo> {
|
||||
SubstreamProtocol::new(self.config.clone(), ())
|
||||
}
|
||||
|
||||
fn inject_fully_negotiated_inbound(
|
||||
&mut self,
|
||||
protocol: <Self::InboundProtocol as InboundUpgrade<NegotiatedSubstream>>::Output
|
||||
protocol: <Self::InboundProtocol as InboundUpgrade<NegotiatedSubstream>>::Output,
|
||||
_info: Self::InboundOpenInfo
|
||||
) {
|
||||
self.events.push(IdentifyHandlerEvent::Identify(protocol))
|
||||
}
|
||||
@ -152,8 +154,7 @@ impl ProtocolsHandler for IdentifyHandler {
|
||||
Poll::Ready(Ok(())) => {
|
||||
self.next_id.reset(DELAY_TO_NEXT_ID);
|
||||
let ev = ProtocolsHandlerEvent::OutboundSubstreamRequest {
|
||||
protocol: SubstreamProtocol::new(self.config.clone()),
|
||||
info: (),
|
||||
protocol: SubstreamProtocol::new(self.config.clone(), ())
|
||||
};
|
||||
Poll::Ready(ev)
|
||||
}
|
||||
|
Reference in New Issue
Block a user