diff options
author | Julius Bünger <buenger@mytum.de> | 2016-09-06 13:22:34 +0000 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2016-09-06 13:22:34 +0000 |
commit | 0793cc21dc77fd47cf1cedca3bc85f331ffe0bd0 (patch) | |
tree | f6e44433ca136b399dc3b121cf7c37fea9354d7b /src/rps | |
parent | 9c5041fa94abdd9dc959c4898ca4bc8cdaed772f (diff) | |
download | gnunet-0793cc21dc77fd47cf1cedca3bc85f331ffe0bd0.tar.gz gnunet-0793cc21dc77fd47cf1cedca3bc85f331ffe0bd0.zip |
-rps sampler: remove useless code
Diffstat (limited to 'src/rps')
-rw-r--r-- | src/rps/gnunet-service-rps_sampler.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/rps/gnunet-service-rps_sampler.c b/src/rps/gnunet-service-rps_sampler.c index a3e33e5c8..95aabc21a 100644 --- a/src/rps/gnunet-service-rps_sampler.c +++ b/src/rps/gnunet-service-rps_sampler.c | |||
@@ -504,16 +504,14 @@ RPS_sampler_reinitialise_by_value (struct RPS_Sampler *sampler, | |||
504 | const struct GNUNET_PeerIdentity *id) | 504 | const struct GNUNET_PeerIdentity *id) |
505 | { | 505 | { |
506 | uint32_t i; | 506 | uint32_t i; |
507 | struct RPS_SamplerElement *trash_entry; | ||
508 | 507 | ||
509 | for ( i = 0 ; i < sampler->sampler_size ; i++ ) | 508 | for (i = 0; i < sampler->sampler_size; i++) |
510 | { | 509 | { |
511 | if ( 0 == GNUNET_CRYPTO_cmp_peer_identity(id, &(sampler->sampler_elements[i]->peer_id)) ) | 510 | if (0 == GNUNET_CRYPTO_cmp_peer_identity(id, |
511 | &(sampler->sampler_elements[i]->peer_id)) ) | ||
512 | { | 512 | { |
513 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Reinitialising sampler\n"); | 513 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Reinitialising sampler\n"); |
514 | trash_entry = GNUNET_new (struct RPS_SamplerElement); | 514 | to_file (sampler->sampler_elements[i]->file_name, |
515 | *trash_entry = *(sampler->sampler_elements[i]); | ||
516 | to_file (trash_entry->file_name, | ||
517 | "--- non-active"); | 515 | "--- non-active"); |
518 | RPS_sampler_elem_reinit (sampler->sampler_elements[i]); | 516 | RPS_sampler_elem_reinit (sampler->sampler_elements[i]); |
519 | } | 517 | } |
@@ -724,7 +722,9 @@ RPS_sampler_request_cancel (struct RPS_SamplerRequestHandle *req_handle) | |||
724 | req_handle->gpc_tail, | 722 | req_handle->gpc_tail, |
725 | i); | 723 | i); |
726 | if (NULL != i->get_peer_task) | 724 | if (NULL != i->get_peer_task) |
725 | { | ||
727 | GNUNET_SCHEDULER_cancel (i->get_peer_task); | 726 | GNUNET_SCHEDULER_cancel (i->get_peer_task); |
727 | } | ||
728 | GNUNET_free (i); | 728 | GNUNET_free (i); |
729 | } | 729 | } |
730 | GNUNET_CONTAINER_DLL_remove (req_handle->sampler->req_handle_head, | 730 | GNUNET_CONTAINER_DLL_remove (req_handle->sampler->req_handle_head, |
@@ -771,7 +771,9 @@ RPS_sampler_destroy (struct RPS_Sampler *sampler) | |||
771 | LOG (GNUNET_ERROR_TYPE_WARNING, | 771 | LOG (GNUNET_ERROR_TYPE_WARNING, |
772 | "There are still pending requests. Going to remove them.\n"); | 772 | "There are still pending requests. Going to remove them.\n"); |
773 | while (NULL != sampler->req_handle_head) | 773 | while (NULL != sampler->req_handle_head) |
774 | { | ||
774 | RPS_sampler_request_cancel (sampler->req_handle_head); | 775 | RPS_sampler_request_cancel (sampler->req_handle_head); |
776 | } | ||
775 | } | 777 | } |
776 | sampler_empty (sampler); | 778 | sampler_empty (sampler); |
777 | GNUNET_free (sampler); | 779 | GNUNET_free (sampler); |