diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-05-12 22:21:16 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-05-12 22:21:16 +0000 |
commit | bb0f1a9c37476ebe08b2de7b6fb7f8b2ed0514b5 (patch) | |
tree | 091423fbd715fc8c8ed0bd8107ae6b9cde4bf8c9 /src/mesh/gnunet-service-mesh.c | |
parent | 33b69c82ed1aed813b58aa076fbbed72a8e834b4 (diff) | |
download | gnunet-bb0f1a9c37476ebe08b2de7b6fb7f8b2ed0514b5.tar.gz gnunet-bb0f1a9c37476ebe08b2de7b6fb7f8b2ed0514b5.zip |
WiP
Diffstat (limited to 'src/mesh/gnunet-service-mesh.c')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index d3b857c6a..2080a375f 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -657,8 +657,7 @@ dht_get_response_handler(void *cls, | |||
657 | + (p->length | 657 | + (p->length |
658 | * sizeof (struct GNUNET_PeerIdentity)), | 658 | * sizeof (struct GNUNET_PeerIdentity)), |
659 | &send_core_create_path_for_peer, | 659 | &send_core_create_path_for_peer, |
660 | peer_info | 660 | peer_info); |
661 | ); | ||
662 | return; | 661 | return; |
663 | } | 662 | } |
664 | 663 | ||
@@ -676,9 +675,13 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client) | |||
676 | struct MeshClient *c, *next; | 675 | struct MeshClient *c, *next; |
677 | struct MESH_tunnel *t; | 676 | struct MESH_tunnel *t; |
678 | 677 | ||
678 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | ||
679 | "MESH: client disconnected\n"); | ||
679 | c = clients_head; | 680 | c = clients_head; |
680 | while (NULL != c) { | 681 | while (NULL != c) { |
681 | if (c->handle == client) { | 682 | if (c->handle == client) { |
683 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | ||
684 | "MESH: cleaning client structures\n"); | ||
682 | GNUNET_CONTAINER_DLL_remove (clients_head, clients_tail, c); | 685 | GNUNET_CONTAINER_DLL_remove (clients_head, clients_tail, c); |
683 | while (NULL != (t = c->tunnels_head)) { | 686 | while (NULL != (t = c->tunnels_head)) { |
684 | destroy_tunnel(c, t); | 687 | destroy_tunnel(c, t); |
@@ -710,8 +713,10 @@ handle_local_new_client (void *cls, | |||
710 | struct MeshClient *c; | 713 | struct MeshClient *c; |
711 | unsigned int payload_size; | 714 | unsigned int payload_size; |
712 | 715 | ||
716 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | ||
717 | "MESH: new client connected\n"); | ||
713 | /* Check data sanity */ | 718 | /* Check data sanity */ |
714 | payload_size = message->size - sizeof(struct GNUNET_MessageHeader); | 719 | payload_size = ntohs(message->size) - sizeof(struct GNUNET_MessageHeader); |
715 | if (0 != payload_size % sizeof(GNUNET_MESH_ApplicationType)) { | 720 | if (0 != payload_size % sizeof(GNUNET_MESH_ApplicationType)) { |
716 | GNUNET_break(0); | 721 | GNUNET_break(0); |
717 | GNUNET_SERVER_receive_done(client, GNUNET_SYSERR); | 722 | GNUNET_SERVER_receive_done(client, GNUNET_SYSERR); |
@@ -728,6 +733,8 @@ handle_local_new_client (void *cls, | |||
728 | c->messages_subscribed = NULL; | 733 | c->messages_subscribed = NULL; |
729 | } | 734 | } |
730 | c->subscription_counter = payload_size/sizeof(GNUNET_MESH_ApplicationType); | 735 | c->subscription_counter = payload_size/sizeof(GNUNET_MESH_ApplicationType); |
736 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | ||
737 | "MESH: client has %u subscriptions\n", c->subscription_counter); | ||
731 | 738 | ||
732 | /* Insert new client in DLL */ | 739 | /* Insert new client in DLL */ |
733 | GNUNET_CONTAINER_DLL_insert (clients_head, clients_tail, c); | 740 | GNUNET_CONTAINER_DLL_insert (clients_head, clients_tail, c); |