From f1dd87281c36abbbe6a5e133637fe563b8c5a926 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20B=C3=BCnger?= Date: Tue, 10 Mar 2015 12:20:29 +0000 Subject: [PATCH] - renaming --- src/rps/rps_api.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/rps/rps_api.c b/src/rps/rps_api.c index 91612c2f7..e848f9151 100644 --- a/src/rps/rps_api.c +++ b/src/rps/rps_api.c @@ -317,8 +317,8 @@ GNUNET_RPS_act_malicious (struct GNUNET_RPS_Handle *h, LOG (GNUNET_ERROR_TYPE_DEBUG, "Client turns malicious with %" PRIX32 " other peers:\n", - n); - for (i = 0 ; i < n ; i++) + num_peers); + for (i = 0 ; i < num_peers ; i++) LOG (GNUNET_ERROR_TYPE_DEBUG, "%u. peer: %s\n", i, @@ -326,7 +326,7 @@ GNUNET_RPS_act_malicious (struct GNUNET_RPS_Handle *h, /* The actual size the message occupies */ size_needed = sizeof (struct GNUNET_RPS_CS_SeedMessage) + - n * sizeof (struct GNUNET_PeerIdentity); + num_peers * sizeof (struct GNUNET_PeerIdentity); /* The number of peers that fits in one message together with * the respective header */ num_peers_max = (GNUNET_SERVER_MAX_MESSAGE_SIZE - @@ -339,24 +339,24 @@ GNUNET_RPS_act_malicious (struct GNUNET_RPS_Handle *h, ev = GNUNET_MQ_msg_extra (msg, num_peers_max * sizeof (struct GNUNET_PeerIdentity), GNUNET_MESSAGE_TYPE_RPS_ACT_MALICIOUS); - msg->type = ntohl (type); - msg->num_peers = ntohl (num_peers_max); + msg->type = htonl (type); + msg->num_peers = htonl (num_peers_max); memcpy (&msg[1], tmp_peer_pointer, num_peers_max * sizeof (struct GNUNET_PeerIdentity)); GNUNET_MQ_send (h->mq, ev); - n -= num_peers_max; + num_peers -= num_peers_max; size_needed = sizeof (struct GNUNET_RPS_CS_SeedMessage) + - n * sizeof (struct GNUNET_PeerIdentity); + num_peers * sizeof (struct GNUNET_PeerIdentity); /* Set pointer to beginning of next block of num_peers_max peers */ tmp_peer_pointer = &ids[num_peers_max]; } ev = GNUNET_MQ_msg_extra (msg, - n * sizeof (struct GNUNET_PeerIdentity), + num_peers * sizeof (struct GNUNET_PeerIdentity), GNUNET_MESSAGE_TYPE_RPS_ACT_MALICIOUS); msg->type = htonl (type); - msg->num_peers = htonl (n); - memcpy (&msg[1], tmp_peer_pointer, n * sizeof (struct GNUNET_PeerIdentity)); + msg->num_peers = htonl (num_peers); + memcpy (&msg[1], tmp_peer_pointer, num_peers * sizeof (struct GNUNET_PeerIdentity)); GNUNET_MQ_send (h->mq, ev); -- 2.25.1