aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-08-05 14:02:23 +0000
committerBart Polot <bart@net.in.tum.de>2013-08-05 14:02:23 +0000
commitdaec1269dcb0eed66a0bda6d777272a5358514b7 (patch)
treed060271fe5d862ef17da4f97f9f28da2436a9b78 /src/mesh
parenteb9bed96fdffc5b38e3e8972d91066279efee8f5 (diff)
downloadgnunet-daec1269dcb0eed66a0bda6d777272a5358514b7.tar.gz
gnunet-daec1269dcb0eed66a0bda6d777272a5358514b7.zip
- new client handles
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/gnunet-service-mesh-enc.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mesh/gnunet-service-mesh-enc.c b/src/mesh/gnunet-service-mesh-enc.c
index d27cdca76..dee08ce8b 100644
--- a/src/mesh/gnunet-service-mesh-enc.c
+++ b/src/mesh/gnunet-service-mesh-enc.c
@@ -5109,6 +5109,7 @@ handle_local_client_connect (void *cls, struct GNUNET_SERVER_Client *client)
5109 return; 5109 return;
5110 c = GNUNET_malloc (sizeof (struct MeshClient)); 5110 c = GNUNET_malloc (sizeof (struct MeshClient));
5111 c->handle = client; 5111 c->handle = client;
5112 c->id = next_client_id++; /* overflow not important: just for debug */
5112 GNUNET_SERVER_client_keep (client); 5113 GNUNET_SERVER_client_keep (client);
5113 GNUNET_SERVER_client_set_user_context (client, c); 5114 GNUNET_SERVER_client_set_user_context (client, c);
5114 GNUNET_CONTAINER_DLL_insert (clients_head, clients_tail, c); 5115 GNUNET_CONTAINER_DLL_insert (clients_head, clients_tail, c);
@@ -5142,18 +5143,18 @@ handle_local_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
5142 c->id, c); 5143 c->id, c);
5143 GNUNET_SERVER_client_drop (c->handle); 5144 GNUNET_SERVER_client_drop (c->handle);
5144 c->shutting_down = GNUNET_YES; 5145 c->shutting_down = GNUNET_YES;
5145 if (NULL != c->own_tunnels) 5146 if (NULL != c->own_channels)
5146 { 5147 {
5147 GNUNET_CONTAINER_multihashmap32_iterate (c->own_tunnels, 5148 GNUNET_CONTAINER_multihashmap32_iterate (c->own_channels,
5148 &tunnel_destroy_iterator, c); 5149 &channel_destroy_iterator, c);
5149 GNUNET_CONTAINER_multihashmap32_destroy (c->own_tunnels); 5150 GNUNET_CONTAINER_multihashmap32_destroy (c->own_channels);
5150 } 5151 }
5151 5152
5152 if (NULL != c->incoming_tunnels) 5153 if (NULL != c->incoming_channels)
5153 { 5154 {
5154 GNUNET_CONTAINER_multihashmap32_iterate (c->incoming_tunnels, 5155 GNUNET_CONTAINER_multihashmap32_iterate (c->incoming_channels,
5155 &tunnel_destroy_iterator, c); 5156 &channel_destroy_iterator, c);
5156 GNUNET_CONTAINER_multihashmap32_destroy (c->incoming_tunnels); 5157 GNUNET_CONTAINER_multihashmap32_destroy (c->incoming_channels);
5157 } 5158 }
5158 5159
5159 if (NULL != c->ports) 5160 if (NULL != c->ports)
@@ -5164,9 +5165,9 @@ handle_local_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
5164 } 5165 }
5165 next = c->next; 5166 next = c->next;
5166 GNUNET_CONTAINER_DLL_remove (clients_head, clients_tail, c); 5167 GNUNET_CONTAINER_DLL_remove (clients_head, clients_tail, c);
5168 GNUNET_STATISTICS_update (stats, "# clients", -1, GNUNET_NO);
5167 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " client free (%p)\n", c); 5169 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " client free (%p)\n", c);
5168 GNUNET_free (c); 5170 GNUNET_free (c);
5169 GNUNET_STATISTICS_update (stats, "# clients", -1, GNUNET_NO);
5170 c = next; 5171 c = next;
5171 } 5172 }
5172 else 5173 else
@@ -5210,7 +5211,6 @@ handle_local_new_client (void *cls, struct GNUNET_SERVER_Client *client,
5210 5211
5211 /* Initialize new client structure */ 5212 /* Initialize new client structure */
5212 c = GNUNET_SERVER_client_get_user_context (client, struct MeshClient); 5213 c = GNUNET_SERVER_client_get_user_context (client, struct MeshClient);
5213 c->id = next_client_id++; /* overflow not important: just for debug */
5214 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " client id %u\n", c->id); 5214 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " client id %u\n", c->id);
5215 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " client has %u ports\n", size); 5215 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " client has %u ports\n", size);
5216 if (size > 0) 5216 if (size > 0)