summaryrefslogtreecommitdiffstats
path: root/src/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/state.rs')
-rw-r--r--src/state.rs6
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,
}
}