From fde8a76ec5d8e697d9b13470cd15ed324bae3d00 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 27 Oct 2026 00:36:40 +0100 Subject: talk about "transport" unless mycelium is meant --- src/state/session.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/state/session.rs') 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, - /// 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, /// 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`). -- cgit v1.3.1