diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-03-21 10:59:52 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-03-21 10:59:52 +0000 |
commit | 9b09dd77c43d13e5cc5003ece810ca081929760f (patch) | |
tree | 8718822385a9aa558775089b7e2d113dd663a8b3 /src/core/gnunet-service-core.c | |
parent | b4d3d971d12aa2dcbda5af9f8209bda2fe87e6cd (diff) | |
download | gnunet-9b09dd77c43d13e5cc5003ece810ca081929760f.tar.gz gnunet-9b09dd77c43d13e5cc5003ece810ca081929760f.zip |
cleanup
Diffstat (limited to 'src/core/gnunet-service-core.c')
-rw-r--r-- | src/core/gnunet-service-core.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index 298b5e277..81df377c5 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c | |||
@@ -1433,6 +1433,11 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client) | |||
1433 | 1433 | ||
1434 | /** | 1434 | /** |
1435 | * Helper function for handle_client_iterate_peers. | 1435 | * Helper function for handle_client_iterate_peers. |
1436 | * | ||
1437 | * @param cls the 'struct GNUNET_SERVER_TransmitContext' to queue replies | ||
1438 | * @param key identity of the connected peer | ||
1439 | * @param value the 'struct Neighbour' for the peer | ||
1440 | * @return GNUNET_OK (continue to iterate) | ||
1436 | */ | 1441 | */ |
1437 | static int | 1442 | static int |
1438 | queue_connect_message (void *cls, | 1443 | queue_connect_message (void *cls, |
@@ -1516,7 +1521,7 @@ handle_client_iterate_peers (void *cls, | |||
1516 | } | 1521 | } |
1517 | 1522 | ||
1518 | /** | 1523 | /** |
1519 | * Handle CORE_ITERATE_PEERS request. | 1524 | * Handle CORE_ITERATE_PEERS request. Notify client about existing neighbours. |
1520 | * | 1525 | * |
1521 | * @param cls unused | 1526 | * @param cls unused |
1522 | * @param client client sending the iteration request | 1527 | * @param client client sending the iteration request |
@@ -1531,15 +1536,13 @@ handle_client_have_peer (void *cls, | |||
1531 | struct GNUNET_MessageHeader done_msg; | 1536 | struct GNUNET_MessageHeader done_msg; |
1532 | struct GNUNET_SERVER_TransmitContext *tc; | 1537 | struct GNUNET_SERVER_TransmitContext *tc; |
1533 | struct GNUNET_PeerIdentity *peer; | 1538 | struct GNUNET_PeerIdentity *peer; |
1534 | int msize; | ||
1535 | /* notify new client about existing neighbours */ | ||
1536 | 1539 | ||
1537 | msize = ntohs(message->size); | ||
1538 | tc = GNUNET_SERVER_transmit_context_create (client); | 1540 | tc = GNUNET_SERVER_transmit_context_create (client); |
1539 | 1541 | peer = (struct GNUNET_PeerIdentity *) &message[1]; | |
1540 | peer = (struct GNUNET_PeerIdentity *)&message[1]; | 1542 | GNUNET_CONTAINER_multihashmap_get_multiple(neighbours, |
1541 | GNUNET_CONTAINER_multihashmap_get_multiple(neighbours, &peer->hashPubKey, &queue_connect_message, tc); | 1543 | &peer->hashPubKey, |
1542 | 1544 | &queue_connect_message, | |
1545 | tc); | ||
1543 | done_msg.size = htons (sizeof (struct GNUNET_MessageHeader)); | 1546 | done_msg.size = htons (sizeof (struct GNUNET_MessageHeader)); |
1544 | done_msg.type = htons (GNUNET_MESSAGE_TYPE_CORE_ITERATE_PEERS_END); | 1547 | done_msg.type = htons (GNUNET_MESSAGE_TYPE_CORE_ITERATE_PEERS_END); |
1545 | GNUNET_SERVER_transmit_context_append_message (tc, &done_msg); | 1548 | GNUNET_SERVER_transmit_context_append_message (tc, &done_msg); |
@@ -1550,6 +1553,10 @@ handle_client_have_peer (void *cls, | |||
1550 | 1553 | ||
1551 | /** | 1554 | /** |
1552 | * Handle REQUEST_INFO request. | 1555 | * Handle REQUEST_INFO request. |
1556 | * | ||
1557 | * @param cls unused | ||
1558 | * @param client client sending the request | ||
1559 | * @param message iteration request message | ||
1553 | */ | 1560 | */ |
1554 | static void | 1561 | static void |
1555 | handle_client_request_info (void *cls, | 1562 | handle_client_request_info (void *cls, |