Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions swarm/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,17 @@ where
}

let new_protocols = gather_supported_protocols(handler);
let changes = ProtocolsChange::from_full_sets(supported_protocols, &new_protocols);

for change in ProtocolsChange::from_full_sets(supported_protocols, &new_protocols) {
handler.on_connection_event(ConnectionEvent::LocalProtocolsChange(change));
}
if !changes.is_empty() {
for change in changes {
handler.on_connection_event(ConnectionEvent::LocalProtocolsChange(change));
}

*supported_protocols = new_protocols;
*supported_protocols = new_protocols;

continue; // Go back to the top, handler can potentially make progress again.
}

return Poll::Pending; // Nothing can make progress, return `Pending`.
}
Expand Down