aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-transport.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-01-16 09:53:34 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-01-16 09:53:34 +0000
commitd1ee58bf994791f6b0020029db0959ec831b927d (patch)
tree85d7a4060ea2ebc65758a6e2b20a0570b30c4456 /src/transport/gnunet-transport.c
parent23a5ebdcbcffd87533bccd48efb99942eb60cdd7 (diff)
downloadgnunet-d1ee58bf994791f6b0020029db0959ec831b927d.tar.gz
gnunet-d1ee58bf994791f6b0020029db0959ec831b927d.zip
fixes for reconnecting and message handling
Diffstat (limited to 'src/transport/gnunet-transport.c')
-rw-r--r--src/transport/gnunet-transport.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c
index 8311c1d72..56df0fbf6 100644
--- a/src/transport/gnunet-transport.c
+++ b/src/transport/gnunet-transport.c
@@ -114,6 +114,11 @@ static int monitor_connects;
114static int monitor_connections; 114static int monitor_connections;
115 115
116/** 116/**
117 * Option -f.
118 */
119static int monitor_validation;
120
121/**
117 * Option -C. 122 * Option -C.
118 */ 123 */
119static int try_connect; 124static int try_connect;
@@ -498,8 +503,9 @@ process_validation_string (void *cls, const char *address)
498 s_next = GNUNET_strdup(GNUNET_STRINGS_absolute_time_to_string (vc->next_validation)); 503 s_next = GNUNET_strdup(GNUNET_STRINGS_absolute_time_to_string (vc->next_validation));
499 504
500 FPRINTF (stdout, 505 FPRINTF (stdout,
501 _("Peer `%s' %s `%s'\n\t%s%s\n\t%s%s\n\t%s%s\n"), 506 _("Peer `%s' %s %s\n\t%s%s\n\t%s%s\n\t%s%s\n"),
502 GNUNET_i2s (&vc->id), address, GNUNET_TRANSPORT_vs2s (vc->state), 507 GNUNET_i2s (&vc->id), address,
508 (monitor_validation) ? GNUNET_TRANSPORT_vs2s (vc->state) : "",
503 "Valid until : ", s_valid, 509 "Valid until : ", s_valid,
504 "Last validation: ",s_last, 510 "Last validation: ",s_last,
505 "Next validation: ", s_next); 511 "Next validation: ", s_next);
@@ -1135,7 +1141,8 @@ testservice_task (void *cls, int result)
1135 } 1141 }
1136 1142
1137 counter = benchmark_send + benchmark_receive + iterate_connections 1143 counter = benchmark_send + benchmark_receive + iterate_connections
1138 + monitor_connections + monitor_connects + try_connect + iterate_validation; 1144 + monitor_connections + monitor_connects + try_connect
1145 + iterate_validation + monitor_validation;
1139 1146
1140 if (1 < counter) 1147 if (1 < counter)
1141 { 1148 {
@@ -1246,9 +1253,16 @@ testservice_task (void *cls, int result)
1246 } 1253 }
1247 else if (iterate_validation) /* -d: Print information about validations */ 1254 else if (iterate_validation) /* -d: Print information about validations */
1248 { 1255 {
1249 vic = GNUNET_TRANSPORT_monitor_validation_entries (cfg, (NULL == cpid) ? NULL : &pid, 1256 vic = GNUNET_TRANSPORT_monitor_validation_entries (cfg,
1257 (NULL == cpid) ? NULL : &pid,
1250 GNUNET_YES, TIMEOUT, &process_validation_cb, (void *) cfg); 1258 GNUNET_YES, TIMEOUT, &process_validation_cb, (void *) cfg);
1251 } 1259 }
1260 else if (monitor_validation) /* -f: Print information about validations continuously */
1261 {
1262 vic = GNUNET_TRANSPORT_monitor_validation_entries (cfg,
1263 (NULL == cpid) ? NULL : &pid,
1264 GNUNET_NO, TIMEOUT, &process_validation_cb, (void *) cfg);
1265 }
1252 else if (monitor_connects) /* -e : Monitor (dis)connect events continuously */ 1266 else if (monitor_connects) /* -e : Monitor (dis)connect events continuously */
1253 { 1267 {
1254 monitor_connect_counter = 0; 1268 monitor_connect_counter = 0;
@@ -1312,6 +1326,9 @@ main (int argc, char * const *argv)
1312 { 'd', "validation", NULL, 1326 { 'd', "validation", NULL,
1313 gettext_noop ("print information for all pending validations "), 1327 gettext_noop ("print information for all pending validations "),
1314 0, &GNUNET_GETOPT_set_one, &iterate_validation }, 1328 0, &GNUNET_GETOPT_set_one, &iterate_validation },
1329 { 'f', "monitorvalidation", NULL,
1330 gettext_noop ("print information for all pending validations continously"),
1331 0, &GNUNET_GETOPT_set_one, &monitor_validation },
1315 { 'i', "information", NULL, 1332 { 'i', "information", NULL,
1316 gettext_noop ("provide information about all current connections (once)"), 1333 gettext_noop ("provide information about all current connections (once)"),
1317 0, &GNUNET_GETOPT_set_one, &iterate_connections }, 1334 0, &GNUNET_GETOPT_set_one, &iterate_connections },