From: Christian Grothoff Date: Mon, 25 Jul 2011 15:20:48 +0000 (+0000) Subject: exponential back-off X-Git-Tag: initial-import-from-subversion-38251~17662 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ab9c4e9d3795f07a12e86717f0a635080728ef81;p=oweals%2Fgnunet.git exponential back-off --- diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index b62c20005..b52e04712 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c @@ -159,10 +159,13 @@ plan (struct PeerPlan *pp, total_delay * 1000LL / plan_count, GNUNET_NO); prd = GSF_pending_request_get_data_ (rp->pr); - // FIXME: calculate 'rp->earliest_transmission'! - // FIXME: claculate 'rp->priority'! - delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, - rp->transmission_counter); + // FIXME: calculate 'rp->priority'! + if (rp->transmission_counter < 32) + delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, + 1LL << rp->transmission_counter); + else + delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, + UINT_MAX); rp->earliest_transmission = GNUNET_TIME_relative_to_absolute (delay); #if DEBUG_FS diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index fb4c7ec9e..37865d913 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c @@ -305,6 +305,10 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, GNUNET_h2s (query), type); #endif + GNUNET_STATISTICS_update (GSF_stats, + gettext_noop ("# Pending requests created"), + 1, + GNUNET_NO); pr = GNUNET_malloc (sizeof (struct GSF_PendingRequest)); pr->local_result_offset = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, UINT64_MAX); diff --git a/src/nse/test_nse.conf b/src/nse/test_nse.conf index d8440e904..475f87eaf 100644 --- a/src/nse/test_nse.conf +++ b/src/nse/test_nse.conf @@ -15,8 +15,8 @@ CONFIG = $DEFAULTCONFIG # Overriding network settings for faster testing (do NOT use # these values in production just because they are here) WORKDELAY = 1 -INTERVAL = 15000 -WORKBITS = 8 +INTERVAL = 120000 +WORKBITS = 1 HISTOGRAM = $SERVICEHOME/nse-histogram @@ -58,7 +58,7 @@ EXTERNAL_ADDRESS = 127.0.0.1 AUTOSTART = NO [testing] -NUM_PEERS = 50 +NUM_PEERS = 100 WEAKRANDOM = YES TOPOLOGY = NONE CONNECT_TOPOLOGY = SMALL_WORLD_RING diff --git a/src/nse/test_nse_multipeer.c b/src/nse/test_nse_multipeer.c index 97db91fd3..277f73b21 100644 --- a/src/nse/test_nse_multipeer.c +++ b/src/nse/test_nse_multipeer.c @@ -51,7 +51,7 @@ struct NSEPeer *peer_tail; /** * How long do we run the test? */ -#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 30) +#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 60) static int ok; @@ -270,6 +270,7 @@ check () return ok; } + int main (int argc, char *argv[]) {