diff options
author | Julius Bünger <buenger@mytum.de> | 2015-03-10 12:20:29 +0000 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2015-03-10 12:20:29 +0000 |
commit | f1dd87281c36abbbe6a5e133637fe563b8c5a926 (patch) | |
tree | d2144e0d64bbbf88ebcda4fc818a7901c65c4495 /src/rps | |
parent | 3efc6e72f366db33404c895fca0e00d8cbcdf24c (diff) | |
download | gnunet-f1dd87281c36abbbe6a5e133637fe563b8c5a926.tar.gz gnunet-f1dd87281c36abbbe6a5e133637fe563b8c5a926.zip |
- renaming
Diffstat (limited to 'src/rps')
-rw-r--r-- | src/rps/rps_api.c | 20 |
1 files 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, | |||
317 | 317 | ||
318 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 318 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
319 | "Client turns malicious with %" PRIX32 " other peers:\n", | 319 | "Client turns malicious with %" PRIX32 " other peers:\n", |
320 | n); | 320 | num_peers); |
321 | for (i = 0 ; i < n ; i++) | 321 | for (i = 0 ; i < num_peers ; i++) |
322 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 322 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
323 | "%u. peer: %s\n", | 323 | "%u. peer: %s\n", |
324 | i, | 324 | i, |
@@ -326,7 +326,7 @@ GNUNET_RPS_act_malicious (struct GNUNET_RPS_Handle *h, | |||
326 | 326 | ||
327 | /* The actual size the message occupies */ | 327 | /* The actual size the message occupies */ |
328 | size_needed = sizeof (struct GNUNET_RPS_CS_SeedMessage) + | 328 | size_needed = sizeof (struct GNUNET_RPS_CS_SeedMessage) + |
329 | n * sizeof (struct GNUNET_PeerIdentity); | 329 | num_peers * sizeof (struct GNUNET_PeerIdentity); |
330 | /* The number of peers that fits in one message together with | 330 | /* The number of peers that fits in one message together with |
331 | * the respective header */ | 331 | * the respective header */ |
332 | num_peers_max = (GNUNET_SERVER_MAX_MESSAGE_SIZE - | 332 | num_peers_max = (GNUNET_SERVER_MAX_MESSAGE_SIZE - |
@@ -339,24 +339,24 @@ GNUNET_RPS_act_malicious (struct GNUNET_RPS_Handle *h, | |||
339 | ev = GNUNET_MQ_msg_extra (msg, | 339 | ev = GNUNET_MQ_msg_extra (msg, |
340 | num_peers_max * sizeof (struct GNUNET_PeerIdentity), | 340 | num_peers_max * sizeof (struct GNUNET_PeerIdentity), |
341 | GNUNET_MESSAGE_TYPE_RPS_ACT_MALICIOUS); | 341 | GNUNET_MESSAGE_TYPE_RPS_ACT_MALICIOUS); |
342 | msg->type = ntohl (type); | 342 | msg->type = htonl (type); |
343 | msg->num_peers = ntohl (num_peers_max); | 343 | msg->num_peers = htonl (num_peers_max); |
344 | memcpy (&msg[1], tmp_peer_pointer, num_peers_max * sizeof (struct GNUNET_PeerIdentity)); | 344 | memcpy (&msg[1], tmp_peer_pointer, num_peers_max * sizeof (struct GNUNET_PeerIdentity)); |
345 | GNUNET_MQ_send (h->mq, ev); | 345 | GNUNET_MQ_send (h->mq, ev); |
346 | 346 | ||
347 | n -= num_peers_max; | 347 | num_peers -= num_peers_max; |
348 | size_needed = sizeof (struct GNUNET_RPS_CS_SeedMessage) + | 348 | size_needed = sizeof (struct GNUNET_RPS_CS_SeedMessage) + |
349 | n * sizeof (struct GNUNET_PeerIdentity); | 349 | num_peers * sizeof (struct GNUNET_PeerIdentity); |
350 | /* Set pointer to beginning of next block of num_peers_max peers */ | 350 | /* Set pointer to beginning of next block of num_peers_max peers */ |
351 | tmp_peer_pointer = &ids[num_peers_max]; | 351 | tmp_peer_pointer = &ids[num_peers_max]; |
352 | } | 352 | } |
353 | 353 | ||
354 | ev = GNUNET_MQ_msg_extra (msg, | 354 | ev = GNUNET_MQ_msg_extra (msg, |
355 | n * sizeof (struct GNUNET_PeerIdentity), | 355 | num_peers * sizeof (struct GNUNET_PeerIdentity), |
356 | GNUNET_MESSAGE_TYPE_RPS_ACT_MALICIOUS); | 356 | GNUNET_MESSAGE_TYPE_RPS_ACT_MALICIOUS); |
357 | msg->type = htonl (type); | 357 | msg->type = htonl (type); |
358 | msg->num_peers = htonl (n); | 358 | msg->num_peers = htonl (num_peers); |
359 | memcpy (&msg[1], tmp_peer_pointer, n * sizeof (struct GNUNET_PeerIdentity)); | 359 | memcpy (&msg[1], tmp_peer_pointer, num_peers * sizeof (struct GNUNET_PeerIdentity)); |
360 | 360 | ||
361 | GNUNET_MQ_send (h->mq, ev); | 361 | GNUNET_MQ_send (h->mq, ev); |
362 | 362 | ||