aboutsummaryrefslogtreecommitdiff
path: root/src/rps
diff options
context:
space:
mode:
Diffstat (limited to 'src/rps')
-rw-r--r--src/rps/gnunet-service-rps.c4
-rw-r--r--src/rps/rps_api.c8
-rw-r--r--src/rps/test_rps.c6
3 files changed, 9 insertions, 9 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 4a2f96123..0a4543b30 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -1026,7 +1026,7 @@ client_respond (void *cls,
1026 size_needed = sizeof (struct GNUNET_RPS_CS_ReplyMessage) + 1026 size_needed = sizeof (struct GNUNET_RPS_CS_ReplyMessage) +
1027 num_peers * sizeof (struct GNUNET_PeerIdentity); 1027 num_peers * sizeof (struct GNUNET_PeerIdentity);
1028 1028
1029 GNUNET_assert (GNUNET_SERVER_MAX_MESSAGE_SIZE >= size_needed); 1029 GNUNET_assert (GNUNET_MAX_MESSAGE_SIZE >= size_needed);
1030 1030
1031 ev = GNUNET_MQ_msg_extra (out_msg, 1031 ev = GNUNET_MQ_msg_extra (out_msg,
1032 num_peers * sizeof (struct GNUNET_PeerIdentity), 1032 num_peers * sizeof (struct GNUNET_PeerIdentity),
@@ -1067,7 +1067,7 @@ handle_client_request (void *cls,
1067 size_needed = sizeof (struct GNUNET_RPS_CS_RequestMessage) + 1067 size_needed = sizeof (struct GNUNET_RPS_CS_RequestMessage) +
1068 num_peers * sizeof (struct GNUNET_PeerIdentity); 1068 num_peers * sizeof (struct GNUNET_PeerIdentity);
1069 1069
1070 if (GNUNET_SERVER_MAX_MESSAGE_SIZE < size_needed) 1070 if (GNUNET_MAX_MESSAGE_SIZE < size_needed)
1071 { 1071 {
1072 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1072 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1073 "Message received from client has size larger than expected\n"); 1073 "Message received from client has size larger than expected\n");
diff --git a/src/rps/rps_api.c b/src/rps/rps_api.c
index 504f28b92..ccd480086 100644
--- a/src/rps/rps_api.c
+++ b/src/rps/rps_api.c
@@ -389,12 +389,12 @@ GNUNET_RPS_seed_ids (struct GNUNET_RPS_Handle *h,
389 n * sizeof (struct GNUNET_PeerIdentity); 389 n * sizeof (struct GNUNET_PeerIdentity);
390 /* The number of peers that fits in one message together with 390 /* The number of peers that fits in one message together with
391 * the respective header */ 391 * the respective header */
392 num_peers_max = (GNUNET_SERVER_MAX_MESSAGE_SIZE - 392 num_peers_max = (GNUNET_MAX_MESSAGE_SIZE -
393 sizeof (struct GNUNET_RPS_CS_SeedMessage)) / 393 sizeof (struct GNUNET_RPS_CS_SeedMessage)) /
394 sizeof (struct GNUNET_PeerIdentity); 394 sizeof (struct GNUNET_PeerIdentity);
395 tmp_peer_pointer = ids; 395 tmp_peer_pointer = ids;
396 396
397 while (GNUNET_SERVER_MAX_MESSAGE_SIZE < size_needed) 397 while (GNUNET_MAX_MESSAGE_SIZE < size_needed)
398 { 398 {
399 ev = GNUNET_MQ_msg_extra (msg, num_peers_max * sizeof (struct GNUNET_PeerIdentity), 399 ev = GNUNET_MQ_msg_extra (msg, num_peers_max * sizeof (struct GNUNET_PeerIdentity),
400 GNUNET_MESSAGE_TYPE_RPS_CS_SEED); 400 GNUNET_MESSAGE_TYPE_RPS_CS_SEED);
@@ -463,12 +463,12 @@ GNUNET_RPS_act_malicious (struct GNUNET_RPS_Handle *h,
463 num_peers * sizeof (struct GNUNET_PeerIdentity); 463 num_peers * sizeof (struct GNUNET_PeerIdentity);
464 /* The number of peers that fit in one message together with 464 /* The number of peers that fit in one message together with
465 * the respective header */ 465 * the respective header */
466 num_peers_max = (GNUNET_SERVER_MAX_MESSAGE_SIZE - 466 num_peers_max = (GNUNET_MAX_MESSAGE_SIZE -
467 sizeof (struct GNUNET_RPS_CS_SeedMessage)) / 467 sizeof (struct GNUNET_RPS_CS_SeedMessage)) /
468 sizeof (struct GNUNET_PeerIdentity); 468 sizeof (struct GNUNET_PeerIdentity);
469 tmp_peer_pointer = peer_ids; 469 tmp_peer_pointer = peer_ids;
470 470
471 while (GNUNET_SERVER_MAX_MESSAGE_SIZE < size_needed) 471 while (GNUNET_MAX_MESSAGE_SIZE < size_needed)
472 { 472 {
473 LOG (GNUNET_ERROR_TYPE_DEBUG, 473 LOG (GNUNET_ERROR_TYPE_DEBUG,
474 "Too many peers to send at once, sending %" PRIu32 " (all we can so far)\n", 474 "Too many peers to send at once, sending %" PRIu32 " (all we can so far)\n",
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c
index 1ce174454..acd3a165d 100644
--- a/src/rps/test_rps.c
+++ b/src/rps/test_rps.c
@@ -546,7 +546,7 @@ seed_peers_big (void *cls)
546 unsigned int i; 546 unsigned int i;
547 547
548 seed_msg_size = 8; /* sizeof (struct GNUNET_RPS_CS_SeedMessage) */ 548 seed_msg_size = 8; /* sizeof (struct GNUNET_RPS_CS_SeedMessage) */
549 num_peers_max = (GNUNET_SERVER_MAX_MESSAGE_SIZE - seed_msg_size) / 549 num_peers_max = (GNUNET_MAX_MESSAGE_SIZE - seed_msg_size) /
550 sizeof (struct GNUNET_PeerIdentity); 550 sizeof (struct GNUNET_PeerIdentity);
551 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 551 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
552 "Peers that fit in one seed msg; %u\n", 552 "Peers that fit in one seed msg; %u\n",
@@ -980,7 +980,7 @@ seed_cb (struct RPSPeer *rps_peer)
980static void 980static void
981seed_big_cb (struct RPSPeer *rps_peer) 981seed_big_cb (struct RPSPeer *rps_peer)
982{ 982{
983 // TODO test seeding > GNUNET_SERVER_MAX_MESSAGE_SIZE peers 983 // TODO test seeding > GNUNET_MAX_MESSAGE_SIZE peers
984 GNUNET_SCHEDULER_add_delayed ( 984 GNUNET_SCHEDULER_add_delayed (
985 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2), 985 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2),
986 seed_peers_big, rps_peer); 986 seed_peers_big, rps_peer);
@@ -1457,7 +1457,7 @@ main (int argc, char *argv[])
1457 1457
1458 else if (strstr (argv[0], "_seed_big") != NULL) 1458 else if (strstr (argv[0], "_seed_big") != NULL)
1459 { 1459 {
1460 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test seeding (num_peers > GNUNET_SERVER_MAX_MESSAGE_SIZE)\n"); 1460 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test seeding (num_peers > GNUNET_MAX_MESSAGE_SIZE)\n");
1461 num_peers = 1; 1461 num_peers = 1;
1462 cur_test_run.name = "test-rps-seed-big"; 1462 cur_test_run.name = "test-rps-seed-big";
1463 cur_test_run.main_test = seed_big_cb; 1463 cur_test_run.main_test = seed_big_cb;