diff options
author | Julius Bünger <buenger@mytum.de> | 2019-04-04 13:41:25 +0200 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2019-04-04 13:42:57 +0200 |
commit | 8c3d9fc59cd5617c4f5b7ea621971bdff25f5353 (patch) | |
tree | 910d8bdd653c13d47d943c69b405e2818aac2d14 /src/rps/gnunet-rps-profiler.c | |
parent | a6f561efa7359dae5af8bfd3763e4f16168030ab (diff) | |
download | gnunet-8c3d9fc59cd5617c4f5b7ea621971bdff25f5353.tar.gz gnunet-8c3d9fc59cd5617c4f5b7ea621971bdff25f5353.zip |
RPS: Return peers to client after many observed ids
Diffstat (limited to 'src/rps/gnunet-rps-profiler.c')
-rw-r--r-- | src/rps/gnunet-rps-profiler.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c index af27546f2..a852d94b1 100644 --- a/src/rps/gnunet-rps-profiler.c +++ b/src/rps/gnunet-rps-profiler.c | |||
@@ -1041,7 +1041,9 @@ cancel_request (struct PendingReply *pending_rep) | |||
1041 | "Cancelling rps get reply\n"); | 1041 | "Cancelling rps get reply\n"); |
1042 | GNUNET_assert (NULL != pending_rep->req_handle); | 1042 | GNUNET_assert (NULL != pending_rep->req_handle); |
1043 | GNUNET_RPS_request_cancel (pending_rep->req_handle); | 1043 | GNUNET_RPS_request_cancel (pending_rep->req_handle); |
1044 | pending_rep->req_handle = NULL; | ||
1044 | GNUNET_free (pending_rep); | 1045 | GNUNET_free (pending_rep); |
1046 | pending_rep = NULL; | ||
1045 | } | 1047 | } |
1046 | 1048 | ||
1047 | void | 1049 | void |
@@ -2061,29 +2063,8 @@ profiler_eval (void) | |||
2061 | return evaluate (); | 2063 | return evaluate (); |
2062 | } | 2064 | } |
2063 | 2065 | ||
2064 | static uint32_t fac (uint32_t x) | ||
2065 | { | ||
2066 | if (1 >= x) | ||
2067 | { | ||
2068 | return x; | ||
2069 | } | ||
2070 | return x * fac (x - 1); | ||
2071 | } | ||
2072 | 2066 | ||
2073 | static uint32_t binom (uint32_t n, uint32_t k) | 2067 | /** @brief is b in view of a? |
2074 | { | ||
2075 | //GNUNET_assert (n >= k); | ||
2076 | if (k > n) return 0; | ||
2077 | /* if (0 > n) return 0; - always false */ | ||
2078 | /* if (0 > k) return 0; - always false */ | ||
2079 | if (0 == k) return 1; | ||
2080 | return fac (n) | ||
2081 | / | ||
2082 | fac(k) * fac(n - k); | ||
2083 | } | ||
2084 | |||
2085 | /** | ||
2086 | * @brief is b in view of a? | ||
2087 | * | 2068 | * |
2088 | * @param a | 2069 | * @param a |
2089 | * @param b | 2070 | * @param b |