From: Julius Bünger Date: Mon, 25 Feb 2019 19:36:44 +0000 (+0100) Subject: RPS sampler: An id might be removed while a request is still pending X-Git-Tag: v0.11.0~37^2~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=adbb529b74ba2cc63880c11522c09b50fef34823;p=oweals%2Fgnunet.git RPS sampler: An id might be removed while a request is still pending --- 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, for (i = 0; i < num_peers; i++) { int inserted; + if (GNUNET_YES != check_peer_known (sub->peer_map, &ids[i])) + { + LOG (GNUNET_ERROR_TYPE_WARNING, + "Peer in history update not known!\n"); + continue; + } inserted = insert_in_view (sub, &ids[i]); if (GNUNET_OK == inserted) { @@ -4369,7 +4375,6 @@ do_round (void *cls) } } // TODO independent of that also get some peers from CADET_get_peers()? - // TODO log/stat expected pushes/difference to received pushes if (CustomPeerMap_size (sub->push_map) < HISTOGRAM_FILE_SLOTS) { 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, * * Used to get rid of a PeerID. * + * FIXME: This should also consider currently pending requests + * (Pending requests already collect peerids. As long as not all + * requested IDs have been collected, they are kept. + * Ideally, the @p id should be removed from all pending requests. This + * seems quite complicated.) + * * @param sampler the sampler to reinitialise a sampler in. * @param id the id of the samplers to update. */ 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, * * Used to get rid of a PeerID. * + * FIXME: This should also consider currently pending requests + * (Pending requests already collect peerids. As long as not all + * requested IDs have been collected, they are kept. + * Ideally, the @p id should be removed from all pending requests. This + * seems quite complicated.) + * * @param sampler the sampler to reinitialise a sampler element in. * @param id the id of the sampler elements to update. */