- renaming
authorJulius Bünger <buenger@mytum.de>
Tue, 10 Mar 2015 12:20:29 +0000 (12:20 +0000)
committerJulius Bünger <buenger@mytum.de>
Tue, 10 Mar 2015 12:20:29 +0000 (12:20 +0000)
src/rps/rps_api.c

index 91612c2f7ccffb04db50e088d49e004eec51e0be..e848f91515d2f13a811de880fe9efb5b5aeeaec8 100644 (file)
@@ -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);