projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0ea0ba9
)
- fixed conflicting int sizes
author
Julius Bünger
<buenger@mytum.de>
Tue, 17 Feb 2015 14:04:50 +0000
(14:04 +0000)
committer
Julius Bünger
<buenger@mytum.de>
Tue, 17 Feb 2015 14:04:50 +0000
(14:04 +0000)
src/rps/rps_api.c
patch
|
blob
|
history
diff --git
a/src/rps/rps_api.c
b/src/rps/rps_api.c
index 2784fcdabd3ce99889de98dd606ac8dfca3091c3..4879fd6e91a57109f66d6edbea56eb1a59292ac7 100644
(file)
--- a/
src/rps/rps_api.c
+++ b/
src/rps/rps_api.c
@@
-28,6
+28,10
@@
#include "rps.h"
#include "gnunet_rps_service.h"
#include "rps.h"
#include "gnunet_rps_service.h"
+#include <inttypes.h>
+
+#define LOG(kind,...) GNUNET_log_from (kind, "rps-api",__VA_ARGS__)
+
/**
* Handler to handle requests from a client.
*/
/**
* Handler to handle requests from a client.
*/
@@
-231,8
+235,8
@@
GNUNET_RPS_request_peers (struct GNUNET_RPS_Handle *h, uint32_t n,
* @param ids the ids of the peers seeded
*/
void
* @param ids the ids of the peers seeded
*/
void
-GNUNET_RPS_seed_ids (struct GNUNET_RPS_Handle *h, uint
64
_t n,
- const struct GNUNET_PeerIdentity *
ids)
+GNUNET_RPS_seed_ids (struct GNUNET_RPS_Handle *h, uint
32
_t n,
+ const struct GNUNET_PeerIdentity *ids)
{
uint32_t size_needed;
uint32_t num_peers_max;
{
uint32_t size_needed;
uint32_t num_peers_max;
@@
-240,6
+244,17
@@
GNUNET_RPS_seed_ids (struct GNUNET_RPS_Handle *h, uint64_t n,
struct GNUNET_MQ_Envelope *ev;
struct GNUNET_RPS_CS_SeedMessage *msg;
struct GNUNET_MQ_Envelope *ev;
struct GNUNET_RPS_CS_SeedMessage *msg;
+ unsigned int i;
+
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Client wants to seed %" PRIX32 " peers:\n",
+ n);
+ for (i = 0 ; i < n ; i++)
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "%u. peer: %s\n",
+ i,
+ GNUNET_i2s (&ids[i]));
+
/* The actual size the message occupies */
size_needed = sizeof (struct GNUNET_RPS_CS_SeedMessage) +
n * sizeof (struct GNUNET_PeerIdentity);
/* The actual size the message occupies */
size_needed = sizeof (struct GNUNET_RPS_CS_SeedMessage) +
n * sizeof (struct GNUNET_PeerIdentity);
@@
-267,8
+282,9
@@
GNUNET_RPS_seed_ids (struct GNUNET_RPS_Handle *h, uint64_t n,
ev = GNUNET_MQ_msg_extra (msg, n * sizeof (struct GNUNET_PeerIdentity),
GNUNET_MESSAGE_TYPE_RPS_CS_SEED);
ev = GNUNET_MQ_msg_extra (msg, n * sizeof (struct GNUNET_PeerIdentity),
GNUNET_MESSAGE_TYPE_RPS_CS_SEED);
- msg->num_peers =
GNUNET_htonl
l (n);
+ msg->num_peers =
hton
l (n);
memcpy (&msg[1], tmp_peer_pointer, n * sizeof (struct GNUNET_PeerIdentity));
memcpy (&msg[1], tmp_peer_pointer, n * sizeof (struct GNUNET_PeerIdentity));
+
GNUNET_MQ_send (h->mq, ev);
}
GNUNET_MQ_send (h->mq, ev);
}