summaryrefslogtreecommitdiff
path: root/src/rps
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2019-02-25 20:36:44 +0100
committerJulius Bünger <buenger@mytum.de>2019-02-25 20:36:44 +0100
commitadbb529b74ba2cc63880c11522c09b50fef34823 (patch)
tree7536ea2eef0c2c914d4d021a28dc82bb73977339 /src/rps
parent88aa8d7bb013d1b596a3da2c7162fa55e2fc03a4 (diff)
downloadgnunet-adbb529b74ba2cc63880c11522c09b50fef34823.tar.gz
gnunet-adbb529b74ba2cc63880c11522c09b50fef34823.zip
RPS sampler: An id might be removed while a request is still pending
Diffstat (limited to 'src/rps')
-rw-r--r--src/rps/gnunet-service-rps.c7
-rw-r--r--src/rps/gnunet-service-rps_sampler.h6
-rw-r--r--src/rps/rps-sampler_common.c6
3 files changed, 18 insertions, 1 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index a185645ef..098c71f93 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -2389,6 +2389,12 @@ hist_update (const struct GNUNET_PeerIdentity *ids,
2389 for (i = 0; i < num_peers; i++) 2389 for (i = 0; i < num_peers; i++)
2390 { 2390 {
2391 int inserted; 2391 int inserted;
2392 if (GNUNET_YES != check_peer_known (sub->peer_map, &ids[i]))
2393 {
2394 LOG (GNUNET_ERROR_TYPE_WARNING,
2395 "Peer in history update not known!\n");
2396 continue;
2397 }
2392 inserted = insert_in_view (sub, &ids[i]); 2398 inserted = insert_in_view (sub, &ids[i]);
2393 if (GNUNET_OK == inserted) 2399 if (GNUNET_OK == inserted)
2394 { 2400 {
@@ -4369,7 +4375,6 @@ do_round (void *cls)
4369 } 4375 }
4370 } 4376 }
4371 // TODO independent of that also get some peers from CADET_get_peers()? 4377 // TODO independent of that also get some peers from CADET_get_peers()?
4372 // TODO log/stat expected pushes/difference to received pushes
4373 if (CustomPeerMap_size (sub->push_map) < HISTOGRAM_FILE_SLOTS) 4378 if (CustomPeerMap_size (sub->push_map) < HISTOGRAM_FILE_SLOTS)
4374 { 4379 {
4375 sub->push_recv[CustomPeerMap_size (sub->push_map)]++; 4380 sub->push_recv[CustomPeerMap_size (sub->push_map)]++;
diff --git a/src/rps/gnunet-service-rps_sampler.h b/src/rps/gnunet-service-rps_sampler.h
index 9f60aa7c9..921570f7d 100644
--- a/src/rps/gnunet-service-rps_sampler.h
+++ b/src/rps/gnunet-service-rps_sampler.h
@@ -90,6 +90,12 @@ RPS_sampler_update (struct RPS_Sampler *sampler,
90 * 90 *
91 * Used to get rid of a PeerID. 91 * Used to get rid of a PeerID.
92 * 92 *
93 * FIXME: This should also consider currently pending requests
94 * (Pending requests already collect peerids. As long as not all
95 * requested IDs have been collected, they are kept.
96 * Ideally, the @p id should be removed from all pending requests. This
97 * seems quite complicated.)
98 *
93 * @param sampler the sampler to reinitialise a sampler in. 99 * @param sampler the sampler to reinitialise a sampler in.
94 * @param id the id of the samplers to update. 100 * @param id the id of the samplers to update.
95 */ 101 */
diff --git a/src/rps/rps-sampler_common.c b/src/rps/rps-sampler_common.c
index e34cdd67b..2b0569c61 100644
--- a/src/rps/rps-sampler_common.c
+++ b/src/rps/rps-sampler_common.c
@@ -215,6 +215,12 @@ RPS_sampler_update (struct RPS_Sampler *sampler,
215 * 215 *
216 * Used to get rid of a PeerID. 216 * Used to get rid of a PeerID.
217 * 217 *
218 * FIXME: This should also consider currently pending requests
219 * (Pending requests already collect peerids. As long as not all
220 * requested IDs have been collected, they are kept.
221 * Ideally, the @p id should be removed from all pending requests. This
222 * seems quite complicated.)
223 *
218 * @param sampler the sampler to reinitialise a sampler element in. 224 * @param sampler the sampler to reinitialise a sampler element in.
219 * @param id the id of the sampler elements to update. 225 * @param id the id of the sampler elements to update.
220 */ 226 */