diff options
| author | tv <tv@krebsco.de> | 2026-10-25 22:45:35 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-25 22:45:35 +0100 |
| commit | 6febc8176fd2e18e1e8503d3eeaa1a9b5ca74797 (patch) | |
| tree | df4015fcc54010db949f2a581cc64b05de278300 /src/state.rs | |
| parent | 0c8e2565b4c80c09f0ba5076b1e27762f2b16eeb (diff) | |
MYCELIUM_DELIVERY_LIMIT -> Timing::delivery_limit
Diffstat (limited to 'src/state.rs')
| -rw-r--r-- | src/state.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/state.rs b/src/state.rs index e6054ad..5ec1c5a 100644 --- a/src/state.rs +++ b/src/state.rs @@ -224,6 +224,8 @@ const SYNC_REPLY_TIMEOUT: Duration = Duration::from_secs(10); /// Upper bound, as a multiple of the first wait: 5 minutes (Mycelium gives up on a /// message after five minutes). const SYNC_REPLY_TIMEOUT_MAX_FACTOR: u32 = 30; +/// How long Mycelium tries to deliver a message before dropping it. +const MYCELIUM_DELIVERY_LIMIT: Duration = Duration::from_secs(300); impl SyncSession { /// `reply_backoff`: waits for sync answers (`Timing::sync_reply_backoff`). @@ -533,6 +535,9 @@ pub(crate) struct Timing { /// First wait for an answer to a sync message before sending again; doubles while /// answers stay out (`SyncSession::reply_backoff`). pub(crate) sync_reply_timeout: Duration, + /// How long the transport tries to deliver a message before dropping it (Mycelium: + /// five minutes): a peer silent for longer has nothing on the way to us any more. + pub(crate) delivery_limit: Duration, } impl Timing { @@ -567,6 +572,7 @@ impl Timing { // Only the source gets these, and only while catching up. catch_up_probe: (keepalive / 30).clamp(Duration::from_secs(1), Duration::from_secs(5)), sync_reply_timeout, + delivery_limit: MYCELIUM_DELIVERY_LIMIT, } } |
