aboutsummaryrefslogtreecommitdiff
path: root/src/fragmentation/test_fragmentation_parallel.c
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-09-06 22:46:29 +0000
committerng0 <ng0@n0.is>2019-09-06 22:46:29 +0000
commit6e599264ad13e8fc105493d74d7c11d46f8739ed (patch)
tree169bef1ecbade5a659831fb169f3ae6943af127f /src/fragmentation/test_fragmentation_parallel.c
parent4f13bc15113021ebf71d5d81e99bc29f8a07fc9c (diff)
downloadgnunet-6e599264ad13e8fc105493d74d7c11d46f8739ed.tar.gz
gnunet-6e599264ad13e8fc105493d74d7c11d46f8739ed.zip
first step to remove plibc
Diffstat (limited to 'src/fragmentation/test_fragmentation_parallel.c')
-rw-r--r--src/fragmentation/test_fragmentation_parallel.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/fragmentation/test_fragmentation_parallel.c b/src/fragmentation/test_fragmentation_parallel.c
index 5cde75c0b..d8e598484 100644
--- a/src/fragmentation/test_fragmentation_parallel.c
+++ b/src/fragmentation/test_fragmentation_parallel.c
@@ -90,7 +90,7 @@ proc_msgs (void *cls, const struct GNUNET_MessageHeader *hdr)
90 const char *buf; 90 const char *buf;
91 91
92#if DETAILS 92#if DETAILS
93 FPRINTF (stderr, "%s", "!"); /* message complete, good! */ 93 fprintf (stderr, "%s", "!"); /* message complete, good! */
94#endif 94#endif
95 buf = (const char *) hdr; 95 buf = (const char *) hdr;
96 for (i = sizeof (struct GNUNET_MessageHeader); i < ntohs (hdr->size); i++) 96 for (i = sizeof (struct GNUNET_MessageHeader); i < ntohs (hdr->size); i++)
@@ -98,7 +98,7 @@ proc_msgs (void *cls, const struct GNUNET_MessageHeader *hdr)
98 total++; 98 total++;
99#if ! DETAILS 99#if ! DETAILS
100 if (0 == (total % (NUM_MSGS / 100))) 100 if (0 == (total % (NUM_MSGS / 100)))
101 FPRINTF (stderr, "%s", "."); 101 fprintf (stderr, "%s", ".");
102#endif 102#endif
103 /* tolerate 10% loss, i.e. due to duplicate fragment IDs */ 103 /* tolerate 10% loss, i.e. due to duplicate fragment IDs */
104 if ((total >= NUM_MSGS - (NUM_MSGS / 10)) && (ret != 0)) 104 if ((total >= NUM_MSGS - (NUM_MSGS / 10)) && (ret != 0))
@@ -131,7 +131,7 @@ proc_acks (void *cls, uint32_t msg_id, const struct GNUNET_MessageHeader *hdr)
131 if (ret == GNUNET_OK) 131 if (ret == GNUNET_OK)
132 { 132 {
133#if DETAILS 133#if DETAILS
134 FPRINTF (stderr, "%s", "@"); /* good ACK */ 134 fprintf (stderr, "%s", "@"); /* good ACK */
135#endif 135#endif
136 GNUNET_FRAGMENT_context_destroy (frags[i], NULL, NULL); 136 GNUNET_FRAGMENT_context_destroy (frags[i], NULL, NULL);
137 frags[i] = NULL; 137 frags[i] = NULL;
@@ -141,14 +141,14 @@ proc_acks (void *cls, uint32_t msg_id, const struct GNUNET_MessageHeader *hdr)
141 if (ret == GNUNET_NO) 141 if (ret == GNUNET_NO)
142 { 142 {
143#if DETAILS 143#if DETAILS
144 FPRINTF (stderr, "%s", "@"); /* good ACK */ 144 fprintf (stderr, "%s", "@"); /* good ACK */
145#endif 145#endif
146 acks++; 146 acks++;
147 return; 147 return;
148 } 148 }
149 } 149 }
150#if DETAILS 150#if DETAILS
151 FPRINTF (stderr, "%s", "_"); /* BAD: ack that nobody feels responsible for... */ 151 fprintf (stderr, "%s", "_"); /* BAD: ack that nobody feels responsible for... */
152#endif 152#endif
153} 153}
154 154
@@ -170,21 +170,21 @@ proc_frac (void *cls, const struct GNUNET_MessageHeader *hdr)
170 } 170 }
171 if (NULL == defrag) 171 if (NULL == defrag)
172 { 172 {
173 FPRINTF (stderr, "%s", "E"); /* Error: frag after shutdown!? */ 173 fprintf (stderr, "%s", "E"); /* Error: frag after shutdown!? */
174 return; 174 return;
175 } 175 }
176 ret = GNUNET_DEFRAGMENT_process_fragment (defrag, hdr); 176 ret = GNUNET_DEFRAGMENT_process_fragment (defrag, hdr);
177 if (ret == GNUNET_NO) 177 if (ret == GNUNET_NO)
178 { 178 {
179#if DETAILS 179#if DETAILS
180 FPRINTF (stderr, "%s", "?"); /* duplicate fragment */ 180 fprintf (stderr, "%s", "?"); /* duplicate fragment */
181#endif 181#endif
182 dups++; 182 dups++;
183 } 183 }
184 else if (ret == GNUNET_OK) 184 else if (ret == GNUNET_OK)
185 { 185 {
186#if DETAILS 186#if DETAILS
187 FPRINTF (stderr, "%s", "."); /* good fragment */ 187 fprintf (stderr, "%s", "."); /* good fragment */
188#endif 188#endif
189 fragc++; 189 fragc++;
190 } 190 }
@@ -247,7 +247,7 @@ main (int argc, char *argv[])
247 100); 247 100);
248 GNUNET_PROGRAM_run (5, argv_prog, "test-fragmentation", "nohelp", options, 248 GNUNET_PROGRAM_run (5, argv_prog, "test-fragmentation", "nohelp", options,
249 &run, NULL); 249 &run, NULL);
250 FPRINTF (stderr, 250 fprintf (stderr,
251 "\nHad %u good fragments, %u duplicate fragments, %u acks and %u simulated drops of acks\n", 251 "\nHad %u good fragments, %u duplicate fragments, %u acks and %u simulated drops of acks\n",
252 fragc, dups, acks, ack_drops); 252 fragc, dups, acks, ack_drops);
253 return ret; 253 return ret;