diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-10-31 13:03:48 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-10-31 13:03:48 +0100 |
commit | 7e3cf5f461eb4fbb7581672bf0835da07c378136 (patch) | |
tree | bdc3874b7894242b095b892f1ed3e81a4d4f06c0 /src/cadet | |
parent | 01b480d6d026e0c537dc284a7e7df2c0320a3528 (diff) | |
download | gnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.tar.gz gnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.zip |
tighten formatting rules
Diffstat (limited to 'src/cadet')
-rw-r--r-- | src/cadet/cadet_api.c | 1 | ||||
-rw-r--r-- | src/cadet/cadet_api_get_channel.c | 1 | ||||
-rw-r--r-- | src/cadet/cadet_api_list_peers.c | 1 | ||||
-rw-r--r-- | src/cadet/cadet_test_lib.c | 1 | ||||
-rw-r--r-- | src/cadet/gnunet-cadet-profiler.c | 11 | ||||
-rw-r--r-- | src/cadet/gnunet-cadet.c | 4 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet.c | 4 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_channel.c | 6 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_channel.h | 1 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_connection.c | 1 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_core.c | 1 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_dht.c | 1 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_hello.c | 1 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_paths.c | 1 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_peer.c | 3 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_tunnels.c | 8 | ||||
-rw-r--r-- | src/cadet/test_cadet.c | 37 | ||||
-rw-r--r-- | src/cadet/test_cadet_flow.c | 15 | ||||
-rw-r--r-- | src/cadet/test_cadet_local_mq.c | 3 |
19 files changed, 55 insertions, 46 deletions
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c index 9aeedb616..68bd4c290 100644 --- a/src/cadet/cadet_api.c +++ b/src/cadet/cadet_api.c | |||
@@ -1121,4 +1121,5 @@ GNUNET_CADET_get_mq (const struct GNUNET_CADET_Channel *channel) | |||
1121 | return channel->mq; | 1121 | return channel->mq; |
1122 | } | 1122 | } |
1123 | 1123 | ||
1124 | |||
1124 | /* end of cadet_api.c */ | 1125 | /* end of cadet_api.c */ |
diff --git a/src/cadet/cadet_api_get_channel.c b/src/cadet/cadet_api_get_channel.c index 6d86e8e81..05e2a8383 100644 --- a/src/cadet/cadet_api_get_channel.c +++ b/src/cadet/cadet_api_get_channel.c | |||
@@ -256,4 +256,5 @@ GNUNET_CADET_get_channel_cancel (struct GNUNET_CADET_ChannelMonitor *cm) | |||
256 | return ret; | 256 | return ret; |
257 | } | 257 | } |
258 | 258 | ||
259 | |||
259 | /* end of cadet_api_get_channel.c */ | 260 | /* end of cadet_api_get_channel.c */ |
diff --git a/src/cadet/cadet_api_list_peers.c b/src/cadet/cadet_api_list_peers.c index 8865b6f57..52f59cc74 100644 --- a/src/cadet/cadet_api_list_peers.c +++ b/src/cadet/cadet_api_list_peers.c | |||
@@ -234,4 +234,5 @@ GNUNET_CADET_list_peers_cancel (struct GNUNET_CADET_PeersLister *pl) | |||
234 | return ret; | 234 | return ret; |
235 | } | 235 | } |
236 | 236 | ||
237 | |||
237 | /* end of cadet_api_list_peers.c */ | 238 | /* end of cadet_api_list_peers.c */ |
diff --git a/src/cadet/cadet_test_lib.c b/src/cadet/cadet_test_lib.c index 490e6539b..9c7b9063d 100644 --- a/src/cadet/cadet_test_lib.c +++ b/src/cadet/cadet_test_lib.c | |||
@@ -372,4 +372,5 @@ GNUNET_CADET_TEST_ruN (const char *testname, | |||
372 | ctx); | 372 | ctx); |
373 | } | 373 | } |
374 | 374 | ||
375 | |||
375 | /* end of cadet_test_lib.c */ | 376 | /* end of cadet_test_lib.c */ |
diff --git a/src/cadet/gnunet-cadet-profiler.c b/src/cadet/gnunet-cadet-profiler.c index e66761e1e..c3a19a399 100644 --- a/src/cadet/gnunet-cadet-profiler.c +++ b/src/cadet/gnunet-cadet-profiler.c | |||
@@ -407,6 +407,7 @@ abort_test (long line) | |||
407 | } | 407 | } |
408 | } | 408 | } |
409 | 409 | ||
410 | |||
410 | /** | 411 | /** |
411 | * Stats callback. Finish the stats testbed operation and when all stats have | 412 | * Stats callback. Finish the stats testbed operation and when all stats have |
412 | * been iterated, shutdown the test. | 413 | * been iterated, shutdown the test. |
@@ -615,7 +616,7 @@ tmt_rdy_pong (void *cls, size_t size, void *buf) | |||
615 | struct CadetPingMessage *ping = cls; | 616 | struct CadetPingMessage *ping = cls; |
616 | struct CadetPingMessage *pong; | 617 | struct CadetPingMessage *pong; |
617 | 618 | ||
618 | if ((0 == size)||(NULL == buf)) | 619 | if ((0 == size) || (NULL == buf)) |
619 | { | 620 | { |
620 | GNUNET_free (ping); | 621 | GNUNET_free (ping); |
621 | return 0; | 622 | return 0; |
@@ -654,6 +655,7 @@ ping (void *cls) | |||
654 | &tmt_rdy_ping, peer); | 655 | &tmt_rdy_ping, peer); |
655 | } | 656 | } |
656 | 657 | ||
658 | |||
657 | /** | 659 | /** |
658 | * @brief Reply with a pong to origin. | 660 | * @brief Reply with a pong to origin. |
659 | * | 661 | * |
@@ -691,7 +693,7 @@ tmt_rdy_ping (void *cls, size_t size, void *buf) | |||
691 | peer->ping_ntr = NULL; | 693 | peer->ping_ntr = NULL; |
692 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 694 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
693 | "tmt_rdy called, filling buffer\n"); | 695 | "tmt_rdy called, filling buffer\n"); |
694 | if ((size < sizeof(struct CadetPingMessage))||(NULL == buf)) | 696 | if ((size < sizeof(struct CadetPingMessage)) || (NULL == buf)) |
695 | { | 697 | { |
696 | GNUNET_break (GNUNET_YES == test_finished); | 698 | GNUNET_break (GNUNET_YES == test_finished); |
697 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 699 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -857,6 +859,7 @@ incoming_channel (void *cls, struct GNUNET_CADET_Channel *channel, | |||
857 | return NULL; | 859 | return NULL; |
858 | } | 860 | } |
859 | 861 | ||
862 | |||
860 | /** | 863 | /** |
861 | * Function called whenever an inbound channel is destroyed. Should clean up | 864 | * Function called whenever an inbound channel is destroyed. Should clean up |
862 | * any associated state. | 865 | * any associated state. |
@@ -903,6 +906,7 @@ select_random_peer (struct CadetPeer *peer) | |||
903 | return &peers[r]; | 906 | return &peers[r]; |
904 | } | 907 | } |
905 | 908 | ||
909 | |||
906 | /** | 910 | /** |
907 | * START THE TEST ITSELF, AS WE ARE CONNECTED TO THE CADET SERVICES. | 911 | * START THE TEST ITSELF, AS WE ARE CONNECTED TO THE CADET SERVICES. |
908 | * | 912 | * |
@@ -999,7 +1003,7 @@ peer_id_cb (void *cls, | |||
999 | { | 1003 | { |
1000 | long n = (long) cls; | 1004 | long n = (long) cls; |
1001 | 1005 | ||
1002 | if ((NULL == pinfo)||(NULL != emsg)) | 1006 | if ((NULL == pinfo) || (NULL != emsg)) |
1003 | { | 1007 | { |
1004 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "pi_cb: %s\n", emsg); | 1008 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "pi_cb: %s\n", emsg); |
1005 | abort_test (__LINE__); | 1009 | abort_test (__LINE__); |
@@ -1151,4 +1155,5 @@ main (int argc, char *argv[]) | |||
1151 | return 0; | 1155 | return 0; |
1152 | } | 1156 | } |
1153 | 1157 | ||
1158 | |||
1154 | /* end of gnunet-cadet-profiler.c */ | 1159 | /* end of gnunet-cadet-profiler.c */ |
diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c index d85a3c6ba..f3ccd9883 100644 --- a/src/cadet/gnunet-cadet.c +++ b/src/cadet/gnunet-cadet.c | |||
@@ -265,6 +265,7 @@ shutdown_task (void *cls) | |||
265 | } | 265 | } |
266 | } | 266 | } |
267 | 267 | ||
268 | |||
268 | void | 269 | void |
269 | mq_cb (void *cls) | 270 | mq_cb (void *cls) |
270 | { | 271 | { |
@@ -676,7 +677,7 @@ run (void *cls, | |||
676 | if (target_id && args[1]) | 677 | if (target_id && args[1]) |
677 | target_port = args[1]; | 678 | target_port = args[1]; |
678 | 679 | ||
679 | if (((0 != (request_peers | request_tunnels))||(NULL != conn_id)|| | 680 | if (((0 != (request_peers | request_tunnels)) || (NULL != conn_id) || |
680 | (NULL != channel_id) ) && | 681 | (NULL != channel_id) ) && |
681 | (target_id != NULL) ) | 682 | (target_id != NULL) ) |
682 | { | 683 | { |
@@ -846,4 +847,5 @@ main (int argc, char *const *argv) | |||
846 | return 1; | 847 | return 1; |
847 | } | 848 | } |
848 | 849 | ||
850 | |||
849 | /* end of gnunet-cadet.c */ | 851 | /* end of gnunet-cadet.c */ |
diff --git a/src/cadet/gnunet-service-cadet.c b/src/cadet/gnunet-service-cadet.c index c64da33e2..ba83fe0fc 100644 --- a/src/cadet/gnunet-service-cadet.c +++ b/src/cadet/gnunet-service-cadet.c | |||
@@ -688,9 +688,7 @@ check_local_data (void *cls, | |||
688 | ONE payload item or multiple? Seems current cadet_api | 688 | ONE payload item or multiple? Seems current cadet_api |
689 | at least in theory allows more than one. Next-gen | 689 | at least in theory allows more than one. Next-gen |
690 | cadet_api will likely no more, so we could then | 690 | cadet_api will likely no more, so we could then |
691 | simplify this mess again. */ | 691 | simplify this mess again. *//* Sanity check for message size */payload_size = ntohs (msg->header.size) - sizeof(*msg); |
692 | /* Sanity check for message size */ | ||
693 | payload_size = ntohs (msg->header.size) - sizeof(*msg); | ||
694 | buf = (const char *) &msg[1]; | 692 | buf = (const char *) &msg[1]; |
695 | while (payload_size >= sizeof(struct GNUNET_MessageHeader)) | 693 | while (payload_size >= sizeof(struct GNUNET_MessageHeader)) |
696 | { | 694 | { |
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c index 0a261039c..a2c710cbc 100644 --- a/src/cadet/gnunet-service-cadet_channel.c +++ b/src/cadet/gnunet-service-cadet_channel.c | |||
@@ -1238,8 +1238,7 @@ GCCH_handle_channel_plaintext_data ( | |||
1238 | * - The channel is out-of-order | 1238 | * - The channel is out-of-order |
1239 | * - The channel is reliable and MID matches next expected MID | 1239 | * - The channel is reliable and MID matches next expected MID |
1240 | * - The channel is unreliable and MID is before lowest seen MID | 1240 | * - The channel is unreliable and MID is before lowest seen MID |
1241 | */ | 1241 | */if ((GNUNET_YES == ch->out_of_order) || |
1242 | if ((GNUNET_YES == ch->out_of_order) || | ||
1243 | ((msg->mid.mid == ch->mid_recv.mid) && (GNUNET_YES == ch->reliable)) || | 1242 | ((msg->mid.mid == ch->mid_recv.mid) && (GNUNET_YES == ch->reliable)) || |
1244 | ((GNUNET_NO == ch->reliable) && | 1243 | ((GNUNET_NO == ch->reliable) && |
1245 | (ntohl (msg->mid.mid) >= ntohl (ch->mid_recv.mid)) && | 1244 | (ntohl (msg->mid.mid) >= ntohl (ch->mid_recv.mid)) && |
@@ -1415,8 +1414,7 @@ GCCH_handle_channel_plaintext_data ( | |||
1415 | the case above if "delta" >= 64, which could be the case if | 1414 | the case above if "delta" >= 64, which could be the case if |
1416 | max_pending_messages is also >= 64 or if our client is unready | 1415 | max_pending_messages is also >= 64 or if our client is unready |
1417 | and we are seeing retransmissions of the message our client is | 1416 | and we are seeing retransmissions of the message our client is |
1418 | blocked on. */ | 1417 | blocked on. */LOG (GNUNET_ERROR_TYPE_DEBUG, |
1419 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
1420 | "Duplicate payload of %u bytes on %s (mid %u) dropped\n", | 1418 | "Duplicate payload of %u bytes on %s (mid %u) dropped\n", |
1421 | (unsigned int) payload_size, | 1419 | (unsigned int) payload_size, |
1422 | GCCH_2s (ch), | 1420 | GCCH_2s (ch), |
diff --git a/src/cadet/gnunet-service-cadet_channel.h b/src/cadet/gnunet-service-cadet_channel.h index 181c6e88b..0a6c97329 100644 --- a/src/cadet/gnunet-service-cadet_channel.h +++ b/src/cadet/gnunet-service-cadet_channel.h | |||
@@ -183,7 +183,6 @@ GCCH_handle_duplicate_open (struct CadetChannel *ch, | |||
183 | GNUNET_CADET_ConnectionTunnelIdentifier *cti); | 183 | GNUNET_CADET_ConnectionTunnelIdentifier *cti); |
184 | 184 | ||
185 | 185 | ||
186 | |||
187 | /** | 186 | /** |
188 | * We got payload data for a channel. Pass it on to the client. | 187 | * We got payload data for a channel. Pass it on to the client. |
189 | * | 188 | * |
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index 66dc20481..c07339ebc 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c | |||
@@ -1053,4 +1053,5 @@ GCC_debug (struct CadetConnection *cc, enum GNUNET_ErrorType level) | |||
1053 | #endif | 1053 | #endif |
1054 | } | 1054 | } |
1055 | 1055 | ||
1056 | |||
1056 | /* end of gnunet-service-cadet_connection.c */ | 1057 | /* end of gnunet-service-cadet_connection.c */ |
diff --git a/src/cadet/gnunet-service-cadet_core.c b/src/cadet/gnunet-service-cadet_core.c index 7d1791f3c..d54022896 100644 --- a/src/cadet/gnunet-service-cadet_core.c +++ b/src/cadet/gnunet-service-cadet_core.c | |||
@@ -1333,4 +1333,5 @@ GCO_shutdown () | |||
1333 | } | 1333 | } |
1334 | } | 1334 | } |
1335 | 1335 | ||
1336 | |||
1336 | /* end of gnunet-cadet-service_core.c */ | 1337 | /* end of gnunet-cadet-service_core.c */ |
diff --git a/src/cadet/gnunet-service-cadet_dht.c b/src/cadet/gnunet-service-cadet_dht.c index 3bb86cae4..4e8ccbb08 100644 --- a/src/cadet/gnunet-service-cadet_dht.c +++ b/src/cadet/gnunet-service-cadet_dht.c | |||
@@ -349,4 +349,5 @@ GCD_search_stop (struct GCD_search_handle *h) | |||
349 | GNUNET_free (h); | 349 | GNUNET_free (h); |
350 | } | 350 | } |
351 | 351 | ||
352 | |||
352 | /* end of gnunet-service-cadet_dht.c */ | 353 | /* end of gnunet-service-cadet_dht.c */ |
diff --git a/src/cadet/gnunet-service-cadet_hello.c b/src/cadet/gnunet-service-cadet_hello.c index bbe947ad1..21870a454 100644 --- a/src/cadet/gnunet-service-cadet_hello.c +++ b/src/cadet/gnunet-service-cadet_hello.c | |||
@@ -146,4 +146,5 @@ GCH_get_mine (void) | |||
146 | return mine; | 146 | return mine; |
147 | } | 147 | } |
148 | 148 | ||
149 | |||
149 | /* end of gnunet-service-cadet-new_hello.c */ | 150 | /* end of gnunet-service-cadet-new_hello.c */ |
diff --git a/src/cadet/gnunet-service-cadet_paths.c b/src/cadet/gnunet-service-cadet_paths.c index e4a8dc789..087515a5e 100644 --- a/src/cadet/gnunet-service-cadet_paths.c +++ b/src/cadet/gnunet-service-cadet_paths.c | |||
@@ -156,7 +156,6 @@ GCPP_add_connection (struct CadetPeerPath *path, | |||
156 | } | 156 | } |
157 | 157 | ||
158 | 158 | ||
159 | |||
160 | /** | 159 | /** |
161 | * Notify @a path that it is no longer used for connection @a cc which | 160 | * Notify @a path that it is no longer used for connection @a cc which |
162 | * ended at the path's offset @a off. | 161 | * ended at the path's offset @a off. |
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c index 52a0c2bd3..8258881d0 100644 --- a/src/cadet/gnunet-service-cadet_peer.c +++ b/src/cadet/gnunet-service-cadet_peer.c | |||
@@ -1250,6 +1250,7 @@ GCP_iterate_paths (struct CadetPeer *cp, | |||
1250 | return ret; | 1250 | return ret; |
1251 | } | 1251 | } |
1252 | 1252 | ||
1253 | |||
1253 | /** | 1254 | /** |
1254 | * Iterate over the paths to a peer without direct link. | 1255 | * Iterate over the paths to a peer without direct link. |
1255 | * | 1256 | * |
@@ -1552,6 +1553,4 @@ GCP_send_ooo (struct CadetPeer *cp, | |||
1552 | } | 1553 | } |
1553 | 1554 | ||
1554 | 1555 | ||
1555 | |||
1556 | |||
1557 | /* end of gnunet-service-cadet-new_peer.c */ | 1556 | /* end of gnunet-service-cadet-new_peer.c */ |
diff --git a/src/cadet/gnunet-service-cadet_tunnels.c b/src/cadet/gnunet-service-cadet_tunnels.c index 6f2dd1d8d..d7c7f278e 100644 --- a/src/cadet/gnunet-service-cadet_tunnels.c +++ b/src/cadet/gnunet-service-cadet_tunnels.c | |||
@@ -1922,6 +1922,7 @@ test_crypto_bug (const struct GNUNET_CRYPTO_EcdhePrivateKey *e1, | |||
1922 | check_ed (e2, d1); | 1922 | check_ed (e2, d1); |
1923 | } | 1923 | } |
1924 | 1924 | ||
1925 | |||
1925 | #endif | 1926 | #endif |
1926 | 1927 | ||
1927 | 1928 | ||
@@ -2064,7 +2065,6 @@ GCT_handle_kx_auth (struct CadetTConnection *ct, | |||
2064 | } | 2065 | } |
2065 | 2066 | ||
2066 | 2067 | ||
2067 | |||
2068 | /* ************************************** end core crypto ***************************** */ | 2068 | /* ************************************** end core crypto ***************************** */ |
2069 | 2069 | ||
2070 | 2070 | ||
@@ -2828,8 +2828,7 @@ maintain_connections_cb (void *cls) | |||
2828 | restarted after that happens). | 2828 | restarted after that happens). |
2829 | Furthermore, if the paths we do know are in a reasonably narrow | 2829 | Furthermore, if the paths we do know are in a reasonably narrow |
2830 | quality band and are plentyful, we might also consider us stabilized | 2830 | quality band and are plentyful, we might also consider us stabilized |
2831 | and then reduce the frequency accordingly. */ | 2831 | and then reduce the frequency accordingly. */delay = GNUNET_TIME_UNIT_MINUTES; |
2832 | delay = GNUNET_TIME_UNIT_MINUTES; | ||
2833 | t->maintain_connections_task | 2832 | t->maintain_connections_task |
2834 | = GNUNET_SCHEDULER_add_delayed (delay, | 2833 | = GNUNET_SCHEDULER_add_delayed (delay, |
2835 | &maintain_connections_cb, | 2834 | &maintain_connections_cb, |
@@ -3398,8 +3397,7 @@ GCT_handle_encrypted (struct CadetTConnection *ct, | |||
3398 | this increment if we successfully decrypted with the old KX | 3397 | this increment if we successfully decrypted with the old KX |
3399 | material and thus didn't even both with the new one. This is | 3398 | material and thus didn't even both with the new one. This is |
3400 | the ideal case, as a malicious injection of bogus KX data | 3399 | the ideal case, as a malicious injection of bogus KX data |
3401 | basically only causes us to increment a counter a few times. */ | 3400 | basically only causes us to increment a counter a few times. */t->unverified_attempts++; |
3402 | t->unverified_attempts++; | ||
3403 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 3401 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
3404 | "Failed to decrypt message with unverified KX data %u times\n", | 3402 | "Failed to decrypt message with unverified KX data %u times\n", |
3405 | t->unverified_attempts); | 3403 | t->unverified_attempts); |
diff --git a/src/cadet/test_cadet.c b/src/cadet/test_cadet.c index 354593c4b..25713709c 100644 --- a/src/cadet/test_cadet.c +++ b/src/cadet/test_cadet.c | |||
@@ -263,7 +263,7 @@ static unsigned int msg_dropped; | |||
263 | static struct GNUNET_CADET_Channel * | 263 | static struct GNUNET_CADET_Channel * |
264 | get_target_channel () | 264 | get_target_channel () |
265 | { | 265 | { |
266 | if ((SPEED == test)&&(GNUNET_YES == test_backwards)) | 266 | if ((SPEED == test) && (GNUNET_YES == test_backwards)) |
267 | return outgoing_ch; | 267 | return outgoing_ch; |
268 | else | 268 | else |
269 | return incoming_ch; | 269 | return incoming_ch; |
@@ -383,7 +383,7 @@ stats_cont (void *cls, | |||
383 | "KA sent: %u, KA received: %u\n", | 383 | "KA sent: %u, KA received: %u\n", |
384 | ka_sent, | 384 | ka_sent, |
385 | ka_received); | 385 | ka_received); |
386 | if (((KEEPALIVE == test)||(REOPEN == test)) && | 386 | if (((KEEPALIVE == test) || (REOPEN == test)) && |
387 | ((ka_sent < 2) || (ka_sent > ka_received + 1))) | 387 | ((ka_sent < 2) || (ka_sent > ka_received + 1))) |
388 | { | 388 | { |
389 | GNUNET_break (0); | 389 | GNUNET_break (0); |
@@ -426,10 +426,10 @@ stats_iterator (void *cls, | |||
426 | i = GNUNET_TESTBED_get_index (peer); | 426 | i = GNUNET_TESTBED_get_index (peer); |
427 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "STATS PEER %u - %s [%s]: %llu\n", i, | 427 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "STATS PEER %u - %s [%s]: %llu\n", i, |
428 | subsystem, name, (unsigned long long) value); | 428 | subsystem, name, (unsigned long long) value); |
429 | if ((0 == strncmp (s_sent, name, strlen (s_sent)))&&(0 == i)) | 429 | if ((0 == strncmp (s_sent, name, strlen (s_sent))) && (0 == i)) |
430 | ka_sent = value; | 430 | ka_sent = value; |
431 | if ((0 == strncmp (s_recv, name, strlen (s_recv)))&&(peers_requested - 1 == | 431 | if ((0 == strncmp (s_recv, name, strlen (s_recv))) && (peers_requested - 1 == |
432 | i) ) | 432 | i) ) |
433 | ka_received = value; | 433 | ka_received = value; |
434 | if (0 == strncmp (rdrops, name, strlen (rdrops))) | 434 | if (0 == strncmp (rdrops, name, strlen (rdrops))) |
435 | msg_dropped += value; | 435 | msg_dropped += value; |
@@ -556,6 +556,7 @@ reconnect_op (void *cls) | |||
556 | send_test_message (outgoing_ch); | 556 | send_test_message (outgoing_ch); |
557 | } | 557 | } |
558 | 558 | ||
559 | |||
559 | /** | 560 | /** |
560 | * Function called whenever an MQ-channel is destroyed, unless the destruction | 561 | * Function called whenever an MQ-channel is destroyed, unless the destruction |
561 | * was requested by #GNUNET_CADET_channel_destroy. | 562 | * was requested by #GNUNET_CADET_channel_destroy. |
@@ -594,14 +595,14 @@ disconnect_handler (void *cls, | |||
594 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 595 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
595 | "Unknown channel! %p\n", | 596 | "Unknown channel! %p\n", |
596 | channel); | 597 | channel); |
597 | if ((NULL != disconnect_task)&&(REOPEN != test)) | 598 | if ((NULL != disconnect_task) && (REOPEN != test)) |
598 | { | 599 | { |
599 | GNUNET_SCHEDULER_cancel (disconnect_task); | 600 | GNUNET_SCHEDULER_cancel (disconnect_task); |
600 | disconnect_task = | 601 | disconnect_task = |
601 | GNUNET_SCHEDULER_add_now (&gather_stats_and_exit, | 602 | GNUNET_SCHEDULER_add_now (&gather_stats_and_exit, |
602 | (void *) __LINE__); | 603 | (void *) __LINE__); |
603 | } | 604 | } |
604 | else if ((NULL != reconnect_task)&&(REOPEN == test)) | 605 | else if ((NULL != reconnect_task) && (REOPEN == test)) |
605 | { | 606 | { |
606 | GNUNET_SCHEDULER_cancel (reconnect_task); | 607 | GNUNET_SCHEDULER_cancel (reconnect_task); |
607 | reconnect_task = | 608 | reconnect_task = |
@@ -661,7 +662,7 @@ send_test_message (struct GNUNET_CADET_Channel *channel) | |||
661 | if (SPEED_ACK == test) // FIXME unify SPEED_ACK with an initializer | 662 | if (SPEED_ACK == test) // FIXME unify SPEED_ACK with an initializer |
662 | data_sent++; | 663 | data_sent++; |
663 | } | 664 | } |
664 | else if ((SPEED == test)||(SPEED_ACK == test)) | 665 | else if ((SPEED == test) || (SPEED_ACK == test)) |
665 | { | 666 | { |
666 | if (get_target_channel () == channel) | 667 | if (get_target_channel () == channel) |
667 | { | 668 | { |
@@ -860,7 +861,7 @@ handle_data (void *cls, | |||
860 | if (get_target_channel () == channel) /* Got "data" */ | 861 | if (get_target_channel () == channel) /* Got "data" */ |
861 | { | 862 | { |
862 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received data %u\n", data_received); | 863 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received data %u\n", data_received); |
863 | if ((SPEED != test) ||( (ok_goal - 2) == ok) ) | 864 | if ((SPEED != test) || ( (ok_goal - 2) == ok) ) |
864 | { | 865 | { |
865 | /* Send ACK */ | 866 | /* Send ACK */ |
866 | send_test_message (channel); | 867 | send_test_message (channel); |
@@ -874,14 +875,14 @@ handle_data (void *cls, | |||
874 | } | 875 | } |
875 | else /* Got "ack" */ | 876 | else /* Got "ack" */ |
876 | { | 877 | { |
877 | if ((SPEED_ACK == test) ||(SPEED == test) ) | 878 | if ((SPEED_ACK == test) || (SPEED == test) ) |
878 | { | 879 | { |
879 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received ack %u\n", ack_received); | 880 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received ack %u\n", ack_received); |
880 | /* Send more data */ | 881 | /* Send more data */ |
881 | send_test_message (channel); | 882 | send_test_message (channel); |
882 | if ((ack_received < total_packets) &&(SPEED != test) ) | 883 | if ((ack_received < total_packets) && (SPEED != test) ) |
883 | return; | 884 | return; |
884 | if ((ok == 2) &&(SPEED == test) ) | 885 | if ((ok == 2) && (SPEED == test) ) |
885 | return; | 886 | return; |
886 | show_end_data (); | 887 | show_end_data (); |
887 | } | 888 | } |
@@ -946,7 +947,7 @@ connect_handler (void *cls, | |||
946 | (long) cls); | 947 | (long) cls); |
947 | GNUNET_assert (0); | 948 | GNUNET_assert (0); |
948 | } | 949 | } |
949 | if ((NULL != disconnect_task)&&(REOPEN != test)) | 950 | if ((NULL != disconnect_task) && (REOPEN != test)) |
950 | { | 951 | { |
951 | GNUNET_SCHEDULER_cancel (disconnect_task); | 952 | GNUNET_SCHEDULER_cancel (disconnect_task); |
952 | disconnect_task = GNUNET_SCHEDULER_add_delayed (short_time, | 953 | disconnect_task = GNUNET_SCHEDULER_add_delayed (short_time, |
@@ -1223,8 +1224,7 @@ main (int argc, char *argv[]) | |||
1223 | * total_packets received data packet (@dest) | 1224 | * total_packets received data packet (@dest) |
1224 | * total_packets received data packet (@orig) | 1225 | * total_packets received data packet (@orig) |
1225 | * 1 received channel destroy (@dest) FIXME #5818 | 1226 | * 1 received channel destroy (@dest) FIXME #5818 |
1226 | */ | 1227 | */ok_goal = total_packets * 2 + 2; |
1227 | ok_goal = total_packets * 2 + 2; | ||
1228 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED_ACK\n"); | 1228 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED_ACK\n"); |
1229 | test = SPEED_ACK; | 1229 | test = SPEED_ACK; |
1230 | test_name = "speed ack"; | 1230 | test_name = "speed ack"; |
@@ -1237,8 +1237,7 @@ main (int argc, char *argv[]) | |||
1237 | * total_packets received data packet (@dest) | 1237 | * total_packets received data packet (@dest) |
1238 | * 1 received data packet (@orig) | 1238 | * 1 received data packet (@orig) |
1239 | * 1 received channel destroy (@dest) FIXME #5818 | 1239 | * 1 received channel destroy (@dest) FIXME #5818 |
1240 | */ | 1240 | */ok_goal = total_packets + 4; |
1241 | ok_goal = total_packets + 4; | ||
1242 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED\n"); | 1241 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED\n"); |
1243 | if (strstr (argv[0], "_reliable") != NULL) | 1242 | if (strstr (argv[0], "_reliable") != NULL) |
1244 | { | 1243 | { |
@@ -1260,8 +1259,7 @@ main (int argc, char *argv[]) | |||
1260 | * 1 incoming channel (@dest) | 1259 | * 1 incoming channel (@dest) |
1261 | * [wait] | 1260 | * [wait] |
1262 | * 1 received channel destroy (@dest) FIXME #5818 | 1261 | * 1 received channel destroy (@dest) FIXME #5818 |
1263 | */ | 1262 | */ok_goal = 1; |
1264 | ok_goal = 1; | ||
1265 | } | 1263 | } |
1266 | else if (strstr (argv[0], "_reopen") != NULL) | 1264 | else if (strstr (argv[0], "_reopen") != NULL) |
1267 | { | 1265 | { |
@@ -1313,4 +1311,5 @@ main (int argc, char *argv[]) | |||
1313 | return 0; | 1311 | return 0; |
1314 | } | 1312 | } |
1315 | 1313 | ||
1314 | |||
1316 | /* end of test_cadet.c */ | 1315 | /* end of test_cadet.c */ |
diff --git a/src/cadet/test_cadet_flow.c b/src/cadet/test_cadet_flow.c index 94e1f1c85..2fbdd8d50 100644 --- a/src/cadet/test_cadet_flow.c +++ b/src/cadet/test_cadet_flow.c | |||
@@ -333,10 +333,10 @@ stats_iterator (void *cls, | |||
333 | i = GNUNET_TESTBED_get_index (peer); | 333 | i = GNUNET_TESTBED_get_index (peer); |
334 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "STATS PEER %u - %s [%s]: %llu\n", i, | 334 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "STATS PEER %u - %s [%s]: %llu\n", i, |
335 | subsystem, name, (unsigned long long) value); | 335 | subsystem, name, (unsigned long long) value); |
336 | if ((0 == strncmp (s_sent, name, strlen (s_sent)))&&(0 == i)) | 336 | if ((0 == strncmp (s_sent, name, strlen (s_sent))) && (0 == i)) |
337 | ka_sent = value; | 337 | ka_sent = value; |
338 | if ((0 == strncmp (s_recv, name, strlen (s_recv)))&&(peers_requested - 1 == | 338 | if ((0 == strncmp (s_recv, name, strlen (s_recv))) && (peers_requested - 1 == |
339 | i) ) | 339 | i) ) |
340 | ka_received = value; | 340 | ka_received = value; |
341 | if (0 == strncmp (rdrops, name, strlen (rdrops))) | 341 | if (0 == strncmp (rdrops, name, strlen (rdrops))) |
342 | msg_dropped += value; | 342 | msg_dropped += value; |
@@ -425,7 +425,7 @@ send_test_message (struct GNUNET_CADET_Channel *channel) | |||
425 | if (SPEED_ACK == test) // FIXME unify SPEED_ACK with an initializer | 425 | if (SPEED_ACK == test) // FIXME unify SPEED_ACK with an initializer |
426 | data_sent++; | 426 | data_sent++; |
427 | } | 427 | } |
428 | else if ((SPEED == test)||(SPEED_ACK == test)) | 428 | else if ((SPEED == test) || (SPEED_ACK == test)) |
429 | { | 429 | { |
430 | if (get_target_channel () == channel) | 430 | if (get_target_channel () == channel) |
431 | { | 431 | { |
@@ -577,14 +577,14 @@ handle_data (void *cls, | |||
577 | } | 577 | } |
578 | else /* Got "ack" */ | 578 | else /* Got "ack" */ |
579 | { | 579 | { |
580 | if ((SPEED_ACK == test) ||(SPEED == test) ) | 580 | if ((SPEED_ACK == test) || (SPEED == test) ) |
581 | { | 581 | { |
582 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received ack %u\n", ack_received); | 582 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, " received ack %u\n", ack_received); |
583 | /* Send more data */ | 583 | /* Send more data */ |
584 | send_test_message (channel); | 584 | send_test_message (channel); |
585 | if ((ack_received < total_packets) &&(SPEED != test) ) | 585 | if ((ack_received < total_packets) && (SPEED != test) ) |
586 | return; | 586 | return; |
587 | if ((ok == 2) &&(SPEED == test) ) | 587 | if ((ok == 2) && (SPEED == test) ) |
588 | return; | 588 | return; |
589 | show_end_data (); | 589 | show_end_data (); |
590 | } | 590 | } |
@@ -887,4 +887,5 @@ main (int argc, | |||
887 | return 0; | 887 | return 0; |
888 | } | 888 | } |
889 | 889 | ||
890 | |||
890 | /* end of test_cadet_flow.c */ | 891 | /* end of test_cadet_flow.c */ |
diff --git a/src/cadet/test_cadet_local_mq.c b/src/cadet/test_cadet_local_mq.c index c56b510ae..6f75dfd1f 100644 --- a/src/cadet/test_cadet_local_mq.c +++ b/src/cadet/test_cadet_local_mq.c | |||
@@ -131,6 +131,7 @@ do_abort (void *cls) | |||
131 | GNUNET_SCHEDULER_shutdown (); | 131 | GNUNET_SCHEDULER_shutdown (); |
132 | } | 132 | } |
133 | 133 | ||
134 | |||
134 | /** | 135 | /** |
135 | * Method called whenever a peer connects to a port in MQ-based CADET. | 136 | * Method called whenever a peer connects to a port in MQ-based CADET. |
136 | * | 137 | * |
@@ -155,6 +156,7 @@ connected (void *cls, | |||
155 | return channel; | 156 | return channel; |
156 | } | 157 | } |
157 | 158 | ||
159 | |||
158 | /** | 160 | /** |
159 | * Function called whenever an MQ-channel is destroyed, even if the destruction | 161 | * Function called whenever an MQ-channel is destroyed, even if the destruction |
160 | * was requested by #GNUNET_CADET_channel_destroy. | 162 | * was requested by #GNUNET_CADET_channel_destroy. |
@@ -332,4 +334,5 @@ main (int argc, char *argv[]) | |||
332 | return (result == GNUNET_OK) ? 0 : 1; | 334 | return (result == GNUNET_OK) ? 0 : 1; |
333 | } | 335 | } |
334 | 336 | ||
337 | |||
335 | /* end of test_cadet_local_1.c */ | 338 | /* end of test_cadet_local_1.c */ |