diff options
Diffstat (limited to 'src/state')
| -rw-r--r-- | src/state/peer.rs | 2 | ||||
| -rw-r--r-- | src/state/session.rs | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/state/peer.rs b/src/state/peer.rs index 92329b2..8086f63 100644 --- a/src/state/peer.rs +++ b/src/state/peer.rs @@ -191,7 +191,7 @@ impl PeerState { } /// Start Automerge sync with this peer from scratch. A message still being handed to - /// Mycelium was generated against the old state; its outcome is then ignored. + /// the transport was generated against the old state; its outcome is then ignored. pub(crate) fn reset_sync(&mut self) { // The same waits for answers, from the start. let mut reply_backoff = self.sync.reply_backoff; diff --git a/src/state/session.rs b/src/state/session.rs index 6efe538..cd1ab30 100644 --- a/src/state/session.rs +++ b/src/state/session.rs @@ -17,7 +17,8 @@ use tracing::debug; use crate::backoff::Backoff; use crate::swarm::throughput::SyncBytes; -/// A sync message on its way to our Mycelium (the HTTP request is in progress). +/// A sync message being handed to our transport (for Mycelium: the HTTP request is in +/// progress). #[derive(Clone)] pub(crate) struct Sending { /// Changes it carries for the first time; taken back if the send fails. @@ -30,7 +31,7 @@ pub(crate) struct Sending { /// Session IDs, unique within the process. static NEXT_SESSION: AtomicU64 = AtomicU64::new(1); -/// First wait before generating again after our Mycelium refused a message; doubles +/// First wait before generating again after our transport refused a message; doubles /// while it keeps refusing. const SEND_RETRY: Duration = Duration::from_millis(500); const SEND_RETRY_MAX: Duration = Duration::from_secs(30); @@ -43,10 +44,10 @@ pub(crate) struct SyncSession { id: u64, state: sync::State, - /// A message being handed to our Mycelium. + /// A message being handed to our transport. pub(crate) sending: Option<Sending>, - /// After our Mycelium refused a message: no new one before this. The refused one is + /// After our transport refused a message: no new one before this. The refused one is /// not kept; the next one is generated afresh and carries everything pending. pub(crate) retry_at: Option<Instant>, /// The wait after the next refusal. @@ -233,7 +234,7 @@ impl SyncSession { self.id } - /// Our Mycelium took the message generated from session `session`. Returns whether + /// Our transport took the message generated from session `session`. Returns whether /// to generate again: a pass was requested while it was handed over, or a reset /// replaced the session meanwhile (any pass requested then was lost with the old /// session, and the new one hasn't necessarily opened yet). @@ -248,7 +249,7 @@ impl SyncSession { .is_some_and(|sending| sending.regenerate) } - /// Our Mycelium refused the message: as far as the peer is concerned, it was never + /// Our transport refused the message: as far as the peer is concerned, it was never /// sent. Takes back its changes (they go out with the next message), clears /// `in_flight`, and returns how long to wait before generating again. None if a reset /// already discarded what was being sent (the message came from another `session`). |
