diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-03-02 20:38:01 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-03-02 20:38:01 +0000 |
commit | fb1487e62d1c659c45e2997f80b76f7c7b8c824c (patch) | |
tree | eaa6811d751dc4060f04c7284e0fa47d4b8975fc /src/transport | |
parent | c4bcbfbe216ca485637452f9060f439098e67ab9 (diff) | |
download | gnunet-fb1487e62d1c659c45e2997f80b76f7c7b8c824c.tar.gz gnunet-fb1487e62d1c659c45e2997f80b76f7c7b8c824c.zip |
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport_clients.c | 38 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_plugins.c | 10 | ||||
-rw-r--r-- | src/transport/plugin_transport_udp.c | 8 |
3 files changed, 36 insertions, 20 deletions
diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c index 0700aef0d..e8c85c6d3 100644 --- a/src/transport/gnunet-service-transport_clients.c +++ b/src/transport/gnunet-service-transport_clients.c | |||
@@ -1259,7 +1259,8 @@ clients_handle_monitor_peers (void *cls, | |||
1259 | client)) ) | 1259 | client)) ) |
1260 | { | 1260 | { |
1261 | GNUNET_break (0); | 1261 | GNUNET_break (0); |
1262 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 1262 | GNUNET_SERVER_receive_done (client, |
1263 | GNUNET_SYSERR); | ||
1263 | return; | 1264 | return; |
1264 | } | 1265 | } |
1265 | GNUNET_SERVER_disable_receive_done_warning (client); | 1266 | GNUNET_SERVER_disable_receive_done_warning (client); |
@@ -1281,19 +1282,23 @@ clients_handle_monitor_peers (void *cls, | |||
1281 | pc.all = GNUNET_NO; | 1282 | pc.all = GNUNET_NO; |
1282 | pc.id = msg->peer; | 1283 | pc.id = msg->peer; |
1283 | } | 1284 | } |
1284 | GST_neighbours_iterate (&send_peer_information, &pc); | 1285 | GST_neighbours_iterate (&send_peer_information, |
1286 | &pc); | ||
1285 | 1287 | ||
1286 | if (GNUNET_YES != ntohl (msg->one_shot)) | 1288 | if (GNUNET_YES != ntohl (msg->one_shot)) |
1287 | { | 1289 | { |
1288 | setup_peer_monitoring_client (client, &msg->peer); | 1290 | setup_peer_monitoring_client (client, |
1291 | &msg->peer); | ||
1289 | } | 1292 | } |
1290 | else | 1293 | else |
1291 | { | 1294 | { |
1292 | GNUNET_SERVER_transmit_context_append_data (tc, NULL, 0, | 1295 | GNUNET_SERVER_transmit_context_append_data (tc, |
1293 | GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PEER_RESPONSE); | 1296 | NULL, |
1297 | 0, | ||
1298 | GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PEER_RESPONSE); | ||
1294 | } | 1299 | } |
1295 | 1300 | GNUNET_SERVER_transmit_context_run (tc, | |
1296 | GNUNET_SERVER_transmit_context_run (tc, GNUNET_TIME_UNIT_FOREVER_REL); | 1301 | GNUNET_TIME_UNIT_FOREVER_REL); |
1297 | } | 1302 | } |
1298 | 1303 | ||
1299 | 1304 | ||
@@ -1396,8 +1401,8 @@ plugin_session_info_cb (void *cls, | |||
1396 | 1401 | ||
1397 | if (0 == GNUNET_SERVER_notification_context_get_size (plugin_nc)) | 1402 | if (0 == GNUNET_SERVER_notification_context_get_size (plugin_nc)) |
1398 | { | 1403 | { |
1399 | fprintf (stderr, "UNSUB!\n"); | 1404 | GST_plugins_monitor_subscribe (NULL, |
1400 | GST_plugins_monitor_subscribe (NULL, NULL); | 1405 | NULL); |
1401 | return; | 1406 | return; |
1402 | } | 1407 | } |
1403 | if ( (NULL == info) && | 1408 | if ( (NULL == info) && |
@@ -1443,9 +1448,13 @@ plugin_session_info_cb (void *cls, | |||
1443 | msg->plugin_name_len = htons (slen); | 1448 | msg->plugin_name_len = htons (slen); |
1444 | msg->plugin_address_len = htons (alen); | 1449 | msg->plugin_address_len = htons (alen); |
1445 | name = (char *) &msg[1]; | 1450 | name = (char *) &msg[1]; |
1446 | memcpy (name, info->address->transport_name, slen); | 1451 | memcpy (name, |
1452 | info->address->transport_name, | ||
1453 | slen); | ||
1447 | addr = &name[slen]; | 1454 | addr = &name[slen]; |
1448 | memcpy (addr, info->address->address, alen); | 1455 | memcpy (addr, |
1456 | info->address->address, | ||
1457 | alen); | ||
1449 | if (NULL != sync_client) | 1458 | if (NULL != sync_client) |
1450 | GNUNET_SERVER_notification_context_unicast (plugin_nc, | 1459 | GNUNET_SERVER_notification_context_unicast (plugin_nc, |
1451 | sync_client, | 1460 | sync_client, |
@@ -1473,9 +1482,12 @@ clients_handle_monitor_plugins (void *cls, | |||
1473 | { | 1482 | { |
1474 | GNUNET_SERVER_client_mark_monitor (client); | 1483 | GNUNET_SERVER_client_mark_monitor (client); |
1475 | GNUNET_SERVER_disable_receive_done_warning (client); | 1484 | GNUNET_SERVER_disable_receive_done_warning (client); |
1476 | GNUNET_SERVER_notification_context_add (plugin_nc, client); | 1485 | GNUNET_SERVER_notification_context_add (plugin_nc, |
1486 | client); | ||
1487 | GNUNET_assert (NULL == sync_client); | ||
1477 | sync_client = client; | 1488 | sync_client = client; |
1478 | GST_plugins_monitor_subscribe (&plugin_session_info_cb, NULL); | 1489 | GST_plugins_monitor_subscribe (&plugin_session_info_cb, |
1490 | NULL); | ||
1479 | } | 1491 | } |
1480 | 1492 | ||
1481 | 1493 | ||
diff --git a/src/transport/gnunet-service-transport_plugins.c b/src/transport/gnunet-service-transport_plugins.c index 5cdc55518..db2bbd19f 100644 --- a/src/transport/gnunet-service-transport_plugins.c +++ b/src/transport/gnunet-service-transport_plugins.c | |||
@@ -412,14 +412,18 @@ GST_plugins_a2s (const struct GNUNET_HELLO_Address *address) | |||
412 | return "<plugin unknown>"; | 412 | return "<plugin unknown>"; |
413 | if (0 == address->address_length) | 413 | if (0 == address->address_length) |
414 | { | 414 | { |
415 | GNUNET_snprintf (unable_to_show, sizeof (unable_to_show), | 415 | GNUNET_snprintf (unable_to_show, |
416 | sizeof (unable_to_show), | ||
416 | "<unable to stringify %u-byte long address of %s transport>", | 417 | "<unable to stringify %u-byte long address of %s transport>", |
417 | (unsigned int) address->address_length, | 418 | (unsigned int) address->address_length, |
418 | address->transport_name); | 419 | address->transport_name); |
419 | return unable_to_show; | 420 | return unable_to_show; |
420 | } | 421 | } |
421 | return (NULL != (s = api->address_to_string (NULL, address->address, | 422 | return (NULL != (s = api->address_to_string (NULL, |
422 | address->address_length)) ? s : "<invalid>"); | 423 | address->address, |
424 | address->address_length)) | ||
425 | ? s | ||
426 | : "<invalid>"); | ||
423 | } | 427 | } |
424 | 428 | ||
425 | 429 | ||
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index a84f3e749..c5542d200 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -2397,6 +2397,9 @@ udp_plugin_create_session (void *cls, | |||
2397 | "# UDP sessions active", | 2397 | "# UDP sessions active", |
2398 | GNUNET_CONTAINER_multipeermap_size (plugin->sessions), | 2398 | GNUNET_CONTAINER_multipeermap_size (plugin->sessions), |
2399 | GNUNET_NO); | 2399 | GNUNET_NO); |
2400 | notify_session_monitor (plugin, | ||
2401 | s, | ||
2402 | GNUNET_TRANSPORT_SS_INIT); | ||
2400 | return s; | 2403 | return s; |
2401 | } | 2404 | } |
2402 | 2405 | ||
@@ -2522,10 +2525,7 @@ process_udp_message (struct Plugin *plugin, | |||
2522 | address, | 2525 | address, |
2523 | s, | 2526 | s, |
2524 | s->scope); | 2527 | s->scope); |
2525 | notify_session_monitor (s->plugin, | 2528 | notify_session_monitor (plugin, |
2526 | s, | ||
2527 | GNUNET_TRANSPORT_SS_INIT); | ||
2528 | notify_session_monitor (s->plugin, | ||
2529 | s, | 2529 | s, |
2530 | GNUNET_TRANSPORT_SS_UP); | 2530 | GNUNET_TRANSPORT_SS_UP); |
2531 | } | 2531 | } |