diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-11-23 20:37:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-11-23 20:37:14 +0000 |
commit | 7e60f24441ae84fe5aa965a09805e25996423886 (patch) | |
tree | 07bc7f0efd53a08db93082a85011a6a0c7bcac56 /src/transport/gnunet-service-transport_clients.c | |
parent | 353a1b1b3d482863aec041449ec4eea6f8a97885 (diff) | |
download | gnunet-7e60f24441ae84fe5aa965a09805e25996423886.tar.gz gnunet-7e60f24441ae84fe5aa965a09805e25996423886.zip |
-fix docs, fix shutdown
Diffstat (limited to 'src/transport/gnunet-service-transport_clients.c')
-rw-r--r-- | src/transport/gnunet-service-transport_clients.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c index d0aba723d..91833af23 100644 --- a/src/transport/gnunet-service-transport_clients.c +++ b/src/transport/gnunet-service-transport_clients.c | |||
@@ -227,6 +227,12 @@ static struct GNUNET_SERVER_NotificationContext *val_nc; | |||
227 | */ | 227 | */ |
228 | static struct GNUNET_SERVER_NotificationContext *plugin_nc; | 228 | static struct GNUNET_SERVER_NotificationContext *plugin_nc; |
229 | 229 | ||
230 | /** | ||
231 | * Plugin monitoring client we are currently syncing, NULL if all | ||
232 | * monitoring clients are in sync. | ||
233 | */ | ||
234 | static struct GNUNET_SERVER_Client *sync_client; | ||
235 | |||
230 | 236 | ||
231 | /** | 237 | /** |
232 | * Find the internal handle associated with the given client handle | 238 | * Find the internal handle associated with the given client handle |
@@ -1406,11 +1412,16 @@ plugin_session_info_cb (void *cls, | |||
1406 | (NULL == session) ) | 1412 | (NULL == session) ) |
1407 | { | 1413 | { |
1408 | /* end of initial iteration */ | 1414 | /* end of initial iteration */ |
1409 | sync.size = htons (sizeof (struct GNUNET_MessageHeader)); | 1415 | if (NULL != sync_client) |
1410 | sync.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_SYNC); | 1416 | { |
1411 | GNUNET_SERVER_notification_context_broadcast (plugin_nc, | 1417 | sync.size = htons (sizeof (struct GNUNET_MessageHeader)); |
1418 | sync.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_SYNC); | ||
1419 | GNUNET_SERVER_notification_context_unicast (plugin_nc, | ||
1420 | sync_client, | ||
1412 | &sync, | 1421 | &sync, |
1413 | GNUNET_NO); | 1422 | GNUNET_NO); |
1423 | sync_client = NULL; | ||
1424 | } | ||
1414 | return; | 1425 | return; |
1415 | } | 1426 | } |
1416 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1427 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -1442,9 +1453,15 @@ plugin_session_info_cb (void *cls, | |||
1442 | memcpy (name, info->address->transport_name, slen); | 1453 | memcpy (name, info->address->transport_name, slen); |
1443 | addr = &name[slen + 1]; | 1454 | addr = &name[slen + 1]; |
1444 | memcpy (addr, info->address->address, alen); | 1455 | memcpy (addr, info->address->address, alen); |
1445 | GNUNET_SERVER_notification_context_broadcast (plugin_nc, | 1456 | if (NULL != sync_client) |
1446 | &msg->header, | 1457 | GNUNET_SERVER_notification_context_unicast (plugin_nc, |
1447 | GNUNET_NO); | 1458 | sync_client, |
1459 | &msg->header, | ||
1460 | GNUNET_NO); | ||
1461 | else | ||
1462 | GNUNET_SERVER_notification_context_broadcast (plugin_nc, | ||
1463 | &msg->header, | ||
1464 | GNUNET_NO); | ||
1448 | GNUNET_free (msg); | 1465 | GNUNET_free (msg); |
1449 | } | 1466 | } |
1450 | 1467 | ||
@@ -1464,8 +1481,8 @@ clients_handle_monitor_plugins (void *cls, | |||
1464 | GNUNET_SERVER_client_mark_monitor (client); | 1481 | GNUNET_SERVER_client_mark_monitor (client); |
1465 | GNUNET_SERVER_disable_receive_done_warning (client); | 1482 | GNUNET_SERVER_disable_receive_done_warning (client); |
1466 | GNUNET_SERVER_notification_context_add (plugin_nc, client); | 1483 | GNUNET_SERVER_notification_context_add (plugin_nc, client); |
1467 | if (1 == GNUNET_SERVER_notification_context_get_size (plugin_nc)) | 1484 | sync_client = client; |
1468 | GST_plugins_monitor_subscribe (&plugin_session_info_cb, NULL); | 1485 | GST_plugins_monitor_subscribe (&plugin_session_info_cb, NULL); |
1469 | } | 1486 | } |
1470 | 1487 | ||
1471 | 1488 | ||