From: Julius Bünger Date: Sun, 14 Dec 2014 21:48:15 +0000 (+0000) Subject: fixed errors X-Git-Tag: initial-import-from-subversion-38251~2944 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=21989205eb37eb349e168a46ef388d380f0366c4;p=oweals%2Fgnunet.git fixed errors Signed-off-by: Julius Bünger --- diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 811cb5bff..a5ba58bb2 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c @@ -300,12 +300,13 @@ SAMPLER_samplers_init(size_t init_size) SAMPLER_update_list(struct Samplers *samplers, const struct GNUNET_PeerIdentity *id, SAMPLER_deleteCB del_cb, void *cb_cls) { - struct Sampler *sampler; + struct Sampler *iter; - sampler = samplers->head; - while ( NULL != sampler->next ) + iter = samplers->head; + while ( NULL != iter->next ) { - SAMPLER_next(sampler, id, del_cb, cb_cls); + SAMPLER_next(iter, id, del_cb, cb_cls); + iter = iter->next; } } @@ -430,7 +431,8 @@ SAMPLER_samplers_grow (struct Samplers * samplers, size_t new_size) for ( i = 0 ; i < samplers->size - new_size ; i++) { // TODO call delCB on elem? - GNUNET_CONTAINER_DLL_remove(samplers->head, samplers->tail, samplers->tail); + sampler = samplers->tail; + GNUNET_CONTAINER_DLL_remove(samplers->head, samplers->tail, sampler); } GNUNET_array_grow(samplers->peer_ids, samplers->size, new_size); } @@ -829,7 +831,7 @@ handle_peer_push (void *cls, /* Add the sending peer to the push_list */ GNUNET_array_append(push_list, push_list_size, *peer); - //push_list_size ++; + push_list_size ++; return GNUNET_OK; } @@ -914,7 +916,7 @@ handle_peer_pull_reply (void *cls, peers = (struct GNUNET_PeerIdentity *) &msg[1]; for ( i = 0 ; i < GNUNET_ntohll(in_msg->num_peers) ; i++ ) { GNUNET_array_append(pull_list, pull_list_size, peers[i]); - //pull_list_size++; + pull_list_size++; } // TODO maybe a disconnect happens here diff --git a/src/rps/test_rps_multipeer.c b/src/rps/test_rps_multipeer.c index 5c90e393d..8941ecada 100644 --- a/src/rps/test_rps_multipeer.c +++ b/src/rps/test_rps_multipeer.c @@ -33,7 +33,7 @@ /** * How many peers do we start? */ -#define NUM_PEERS 10 +#define NUM_PEERS 3 /** * How long do we run the test?