aboutsummaryrefslogtreecommitdiff
path: root/src/fragmentation/test_fragmentation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-07-13 11:07:19 +0000
committerChristian Grothoff <christian@grothoff.org>2011-07-13 11:07:19 +0000
commitc94be01c832866f9c0169963c658e36dd3329cc2 (patch)
tree6032e13b5c7016f460d4e04e568cb397f28716ca /src/fragmentation/test_fragmentation.c
parentc584d8950bda4b27ccc2fa03de2cee23a8ae56d2 (diff)
downloadgnunet-c94be01c832866f9c0169963c658e36dd3329cc2.tar.gz
gnunet-c94be01c832866f9c0169963c658e36dd3329cc2.zip
revised fragmentation API for blocking writes
Diffstat (limited to 'src/fragmentation/test_fragmentation.c')
-rw-r--r--src/fragmentation/test_fragmentation.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/fragmentation/test_fragmentation.c b/src/fragmentation/test_fragmentation.c
index 8a9af04e7..1a231bbb4 100644
--- a/src/fragmentation/test_fragmentation.c
+++ b/src/fragmentation/test_fragmentation.c
@@ -42,7 +42,7 @@
42/** 42/**
43 * Simulate dropping of 1 out of how many messages? (must be > 1) 43 * Simulate dropping of 1 out of how many messages? (must be > 1)
44 */ 44 */
45#define DROPRATE 2 45#define DROPRATE 10
46 46
47static int ret = 1; 47static int ret = 1;
48 48
@@ -102,6 +102,7 @@ proc_msgs (void *cls,
102 */ 102 */
103static void 103static void
104proc_acks (void *cls, 104proc_acks (void *cls,
105 uint32_t msg_id,
105 const struct GNUNET_MessageHeader *hdr) 106 const struct GNUNET_MessageHeader *hdr)
106{ 107{
107 unsigned int i; 108 unsigned int i;
@@ -150,8 +151,10 @@ static void
150proc_frac (void *cls, 151proc_frac (void *cls,
151 const struct GNUNET_MessageHeader *hdr) 152 const struct GNUNET_MessageHeader *hdr)
152{ 153{
154 struct GNUNET_FRAGMENT_Context **fc = cls;
153 int ret; 155 int ret;
154 156
157 GNUNET_FRAGMENT_context_transmission_done (*fc);
155 if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, DROPRATE)) 158 if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, DROPRATE))
156 { 159 {
157 frag_drops++; 160 frag_drops++;
@@ -211,7 +214,7 @@ run (void *cls,
211 GNUNET_TIME_UNIT_SECONDS, 214 GNUNET_TIME_UNIT_SECONDS,
212 msg, 215 msg,
213 &proc_frac, 216 &proc_frac,
214 NULL); 217 &frags[i]);
215 } 218 }
216} 219}
217 220