diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-12-30 22:42:04 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-12-30 22:42:04 +0000 |
commit | 416c2f5a713b93ba689a8cd1e038682a53e6bc17 (patch) | |
tree | 987f51d9edfddc02afe1524df5e1156b920c71d4 /src/fragmentation | |
parent | fceec98e767bce7ad2c24dde73cdcf8837e04013 (diff) | |
download | gnunet-416c2f5a713b93ba689a8cd1e038682a53e6bc17.tar.gz gnunet-416c2f5a713b93ba689a8cd1e038682a53e6bc17.zip |
-LRN: use FPRINTF -- #2051
Diffstat (limited to 'src/fragmentation')
-rw-r--r-- | src/fragmentation/test_fragmentation.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/fragmentation/test_fragmentation.c b/src/fragmentation/test_fragmentation.c index 1f7a1776a..cbfb8efe4 100644 --- a/src/fragmentation/test_fragmentation.c +++ b/src/fragmentation/test_fragmentation.c | |||
@@ -91,7 +91,7 @@ proc_msgs (void *cls, const struct GNUNET_MessageHeader *hdr) | |||
91 | const char *buf; | 91 | const char *buf; |
92 | 92 | ||
93 | #if DETAILS | 93 | #if DETAILS |
94 | fprintf (stderr, "!"); /* message complete, good! */ | 94 | FPRINTF (stderr, "%s", "!"); /* message complete, good! */ |
95 | #endif | 95 | #endif |
96 | buf = (const char *) hdr; | 96 | buf = (const char *) hdr; |
97 | for (i = sizeof (struct GNUNET_MessageHeader); i < ntohs (hdr->size); i++) | 97 | for (i = sizeof (struct GNUNET_MessageHeader); i < ntohs (hdr->size); i++) |
@@ -99,7 +99,7 @@ proc_msgs (void *cls, const struct GNUNET_MessageHeader *hdr) | |||
99 | total++; | 99 | total++; |
100 | #if ! DETAILS | 100 | #if ! DETAILS |
101 | if (0 == (total % (NUM_MSGS / 100))) | 101 | if (0 == (total % (NUM_MSGS / 100))) |
102 | fprintf (stderr, "."); | 102 | FPRINTF (stderr, "%s", "."); |
103 | #endif | 103 | #endif |
104 | /* tolerate 10% loss, i.e. due to duplicate fragment IDs */ | 104 | /* tolerate 10% loss, i.e. due to duplicate fragment IDs */ |
105 | if ((total >= NUM_MSGS - (NUM_MSGS / 10)) && (ret != 0)) | 105 | if ((total >= NUM_MSGS - (NUM_MSGS / 10)) && (ret != 0)) |
@@ -132,7 +132,7 @@ proc_acks (void *cls, uint32_t msg_id, const struct GNUNET_MessageHeader *hdr) | |||
132 | if (ret == GNUNET_OK) | 132 | if (ret == GNUNET_OK) |
133 | { | 133 | { |
134 | #if DETAILS | 134 | #if DETAILS |
135 | fprintf (stderr, "@"); /* good ACK */ | 135 | FPRINTF (stderr, "%s", "@"); /* good ACK */ |
136 | #endif | 136 | #endif |
137 | GNUNET_FRAGMENT_context_destroy (frags[i]); | 137 | GNUNET_FRAGMENT_context_destroy (frags[i]); |
138 | frags[i] = NULL; | 138 | frags[i] = NULL; |
@@ -142,14 +142,14 @@ proc_acks (void *cls, uint32_t msg_id, const struct GNUNET_MessageHeader *hdr) | |||
142 | if (ret == GNUNET_NO) | 142 | if (ret == GNUNET_NO) |
143 | { | 143 | { |
144 | #if DETAILS | 144 | #if DETAILS |
145 | fprintf (stderr, "@"); /* good ACK */ | 145 | FPRINTF (stderr, "%s", "@"); /* good ACK */ |
146 | #endif | 146 | #endif |
147 | acks++; | 147 | acks++; |
148 | return; | 148 | return; |
149 | } | 149 | } |
150 | } | 150 | } |
151 | #if DETAILS | 151 | #if DETAILS |
152 | fprintf (stderr, "_"); /* BAD: ack that nobody feels responsible for... */ | 152 | FPRINTF (stderr, "%s", "_"); /* BAD: ack that nobody feels responsible for... */ |
153 | #endif | 153 | #endif |
154 | } | 154 | } |
155 | 155 | ||
@@ -171,21 +171,21 @@ proc_frac (void *cls, const struct GNUNET_MessageHeader *hdr) | |||
171 | } | 171 | } |
172 | if (NULL == defrag) | 172 | if (NULL == defrag) |
173 | { | 173 | { |
174 | fprintf (stderr, "E"); /* Error: frag after shutdown!? */ | 174 | FPRINTF (stderr, "%s", "E"); /* Error: frag after shutdown!? */ |
175 | return; | 175 | return; |
176 | } | 176 | } |
177 | ret = GNUNET_DEFRAGMENT_process_fragment (defrag, hdr); | 177 | ret = GNUNET_DEFRAGMENT_process_fragment (defrag, hdr); |
178 | if (ret == GNUNET_NO) | 178 | if (ret == GNUNET_NO) |
179 | { | 179 | { |
180 | #if DETAILS | 180 | #if DETAILS |
181 | fprintf (stderr, "?"); /* duplicate fragment */ | 181 | FPRINTF (stderr, "%s", "?"); /* duplicate fragment */ |
182 | #endif | 182 | #endif |
183 | dups++; | 183 | dups++; |
184 | } | 184 | } |
185 | else if (ret == GNUNET_OK) | 185 | else if (ret == GNUNET_OK) |
186 | { | 186 | { |
187 | #if DETAILS | 187 | #if DETAILS |
188 | fprintf (stderr, "."); /* good fragment */ | 188 | FPRINTF (stderr, "%s", "."); /* good fragment */ |
189 | #endif | 189 | #endif |
190 | fragc++; | 190 | fragc++; |
191 | } | 191 | } |
@@ -254,7 +254,7 @@ main (int argc, char *argv[]) | |||
254 | 100); | 254 | 100); |
255 | GNUNET_PROGRAM_run (5, argv_prog, "test-fragmentation", "nohelp", options, | 255 | GNUNET_PROGRAM_run (5, argv_prog, "test-fragmentation", "nohelp", options, |
256 | &run, NULL); | 256 | &run, NULL); |
257 | fprintf (stderr, | 257 | FPRINTF (stderr, |
258 | "\nHad %u good fragments, %u duplicate fragments, %u acks and %u simulated drops of acks\n", | 258 | "\nHad %u good fragments, %u duplicate fragments, %u acks and %u simulated drops of acks\n", |
259 | fragc, dups, acks, ack_drops); | 259 | fragc, dups, acks, ack_drops); |
260 | return ret; | 260 | return ret; |