diff options
author | Julius Bünger <buenger@mytum.de> | 2018-11-28 00:01:16 +0100 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2018-11-28 00:01:16 +0100 |
commit | a3b65a1c9b2665c877ed0b066994693b94e941cf (patch) | |
tree | b759c27a3667076b0851be6086a64f150e12ad49 /src/rps | |
parent | 3cb06d8896196df2238c2b6dda59ba871af8b276 (diff) | |
download | gnunet-a3b65a1c9b2665c877ed0b066994693b94e941cf.tar.gz gnunet-a3b65a1c9b2665c877ed0b066994693b94e941cf.zip |
RPS sampler: Fix creation of sampler
Diffstat (limited to 'src/rps')
-rw-r--r-- | src/rps/gnunet-service-rps_sampler.c | 1 | ||||
-rw-r--r-- | src/rps/rps-sampler_client.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/rps/gnunet-service-rps_sampler.c b/src/rps/gnunet-service-rps_sampler.c index 9629a29a1..dcfef19c6 100644 --- a/src/rps/gnunet-service-rps_sampler.c +++ b/src/rps/gnunet-service-rps_sampler.c | |||
@@ -204,6 +204,7 @@ RPS_sampler_init (size_t init_size, | |||
204 | 204 | ||
205 | #ifdef TO_FILE | 205 | #ifdef TO_FILE |
206 | sampler->file_name = create_file ("sampler-"); | 206 | sampler->file_name = create_file ("sampler-"); |
207 | GNUNET_assert (NULL != sampler->file_name); | ||
207 | 208 | ||
208 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 209 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
209 | "Initialised sampler %s\n", | 210 | "Initialised sampler %s\n", |
diff --git a/src/rps/rps-sampler_client.c b/src/rps/rps-sampler_client.c index 4904b9d43..fea824cf3 100644 --- a/src/rps/rps-sampler_client.c +++ b/src/rps/rps-sampler_client.c | |||
@@ -205,7 +205,6 @@ RPS_sampler_mod_init (size_t init_size, | |||
205 | sampler->get_peers = sampler_mod_get_rand_peer; | 205 | sampler->get_peers = sampler_mod_get_rand_peer; |
206 | //sampler->sampler_elements = GNUNET_new_array(init_size, struct GNUNET_PeerIdentity); | 206 | //sampler->sampler_elements = GNUNET_new_array(init_size, struct GNUNET_PeerIdentity); |
207 | //GNUNET_array_grow (sampler->sampler_elements, sampler->sampler_size, min_size); | 207 | //GNUNET_array_grow (sampler->sampler_elements, sampler->sampler_size, min_size); |
208 | RPS_sampler_resize (sampler, init_size); | ||
209 | 208 | ||
210 | client_get_index = 0; | 209 | client_get_index = 0; |
211 | 210 | ||
@@ -220,6 +219,7 @@ RPS_sampler_mod_init (size_t init_size, | |||
220 | to_file (sampler->file_name, | 219 | to_file (sampler->file_name, |
221 | "This is a modified sampler"); | 220 | "This is a modified sampler"); |
222 | #endif /* TO_FILE */ | 221 | #endif /* TO_FILE */ |
222 | RPS_sampler_resize (sampler, init_size); | ||
223 | 223 | ||
224 | return sampler; | 224 | return sampler; |
225 | } | 225 | } |