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,
/* 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 -
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);