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/gnunet-service-transport_clients.c | |
parent | c4bcbfbe216ca485637452f9060f439098e67ab9 (diff) | |
download | gnunet-fb1487e62d1c659c45e2997f80b76f7c7b8c824c.tar.gz gnunet-fb1487e62d1c659c45e2997f80b76f7c7b8c824c.zip |
Diffstat (limited to 'src/transport/gnunet-service-transport_clients.c')
-rw-r--r-- | src/transport/gnunet-service-transport_clients.c | 38 |
1 files changed, 25 insertions, 13 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 | ||