aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2015-05-19 22:41:12 +0000
committerJulius Bünger <buenger@mytum.de>2015-05-19 22:41:12 +0000
commit7820b9d22ecb6409ddc14ed854228411012b6440 (patch)
treef529180860f0b3c10f20d5e66772fbbc7f3d3af2 /src
parentce36ab2f9463cf4d1100d240069fd2b2a4e54496 (diff)
downloadgnunet-7820b9d22ecb6409ddc14ed854228411012b6440.tar.gz
gnunet-7820b9d22ecb6409ddc14ed854228411012b6440.zip
-replaced own util fkt with GNUNET_ one
Diffstat (limited to 'src')
-rw-r--r--src/rps/gnunet-service-rps.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 34d4b5095..3e7111493 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -486,11 +486,6 @@ static uint32_t push_limit = 10000;
486#define unset_peer_flag(peer_ctx, mask) (peer_ctx->peer_flags &= (~mask)) 486#define unset_peer_flag(peer_ctx, mask) (peer_ctx->peer_flags &= (~mask))
487 487
488/** 488/**
489 * Compute the minimum of two ints
490 */
491#define min(x, y) ((x < y) ? x : y)
492
493/**
494 * Clean the send channel of a peer 489 * Clean the send channel of a peer
495 */ 490 */
496void 491void
@@ -1865,9 +1860,9 @@ do_mal_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1865 { /* Try to maximise representation */ 1860 { /* Try to maximise representation */
1866 1861
1867 /* The maximum of pushes we're going to send this round */ 1862 /* The maximum of pushes we're going to send this round */
1868 num_pushes = min (min (push_limit, 1863 num_pushes = GNUNET_MIN (GNUNET_MIN (push_limit,
1869 num_attacked_peers), 1864 num_attacked_peers),
1870 GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE); 1865 GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE);
1871 1866
1872 /* Send PUSHes to attacked peers */ 1867 /* Send PUSHes to attacked peers */
1873 for (i = 0 ; i < num_pushes ; i++) 1868 for (i = 0 ; i < num_pushes ; i++)
@@ -1907,9 +1902,9 @@ do_mal_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1907 { /* Combined attack */ 1902 { /* Combined attack */
1908 1903
1909 /* The maximum of pushes we're going to send this round */ 1904 /* The maximum of pushes we're going to send this round */
1910 num_pushes = min (min (push_limit, 1905 num_pushes = GNUNET_MIN (GNUNET_MIN (push_limit - 1,
1911 num_attacked_peers), 1906 num_attacked_peers),
1912 GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE) - 1; 1907 GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE);
1913 1908
1914 /* Send PUSHes to attacked peers */ 1909 /* Send PUSHes to attacked peers */
1915 send_push (&attacked_peer); 1910 send_push (&attacked_peer);