From 1681abd620379023ec60f14c3ba98eb7ffcd1f88 Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Mon, 4 Nov 2013 12:12:58 +1030 Subject: [PATCH] Increase default mdp timeout & make it configurable --- conf_schema.h | 1 + rhizome_fetch.c | 2 +- tests/rhizomeprotocol | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/conf_schema.h b/conf_schema.h index db680364..fad38f39 100644 --- a/conf_schema.h +++ b/conf_schema.h @@ -430,6 +430,7 @@ ATOM(bool_t, external_blobs, 0, boolean,, "Store rhizome bundles ATOM(uint64_t, rhizome_mdp_block_size, 512, uint64_scaled,, "Rhizome MDP block size.") ATOM(uint64_t, idle_timeout, RHIZOME_IDLE_TIMEOUT, uint64_scaled,, "Rhizome transfer timeout if no data received.") +ATOM(uint64_t, mdp_stall_timeout, 1000, uint64_scaled,, "Timeout to request more data via mdp.") ATOM(uint32_t, fetch_delay_ms, 50, uint32_nonzero,, "Delay from receiving first bundle advert to initiating fetch") SUB_STRUCT(rhizome_direct, direct,) SUB_STRUCT(rhizome_api, api,) diff --git a/rhizome_fetch.c b/rhizome_fetch.c index 56071a02..08452e4f 100644 --- a/rhizome_fetch.c +++ b/rhizome_fetch.c @@ -1065,7 +1065,7 @@ static int rhizome_fetch_mdp_touch_timeout(struct rhizome_fetch_slot *slot) // For now, we will just make the timeout 1 second from the time of the last // received block. unschedule(&slot->alarm); - slot->alarm.alarm=gettime_ms()+1000; + slot->alarm.alarm=gettime_ms()+config.rhizome.mdp_stall_timeout; slot->alarm.deadline=slot->alarm.alarm+500; schedule(&slot->alarm); return 0; diff --git a/tests/rhizomeprotocol b/tests/rhizomeprotocol index 761f1952..265dc926 100755 --- a/tests/rhizomeprotocol +++ b/tests/rhizomeprotocol @@ -704,7 +704,7 @@ start_radio_instance() { set debug.throttling on \ set debug.radio_link on \ set rhizome.advertise.interval 5000 \ - set rhizome.rhizome_mdp_block_size 350 \ + set rhizome.rhizome_mdp_block_size 375 \ set log.console.level debug \ set log.console.show_pid on \ set log.console.show_time on \