aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh_local.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-10-11 12:16:22 +0000
committerBart Polot <bart@net.in.tum.de>2013-10-11 12:16:22 +0000
commit0619087fbfdc6d93d421edee1a1320c494f18079 (patch)
treec7c8ad6c6d2dd820bf9ec2af5e8836987f4853f7 /src/mesh/gnunet-service-mesh_local.c
parent15ec6e9eb5e1ec86c1db2135b62abe0ac36f8daf (diff)
downloadgnunet-0619087fbfdc6d93d421edee1a1320c494f18079.tar.gz
gnunet-0619087fbfdc6d93d421edee1a1320c494f18079.zip
- fix compile errors in local
Diffstat (limited to 'src/mesh/gnunet-service-mesh_local.c')
-rw-r--r--src/mesh/gnunet-service-mesh_local.c37
1 files changed, 34 insertions, 3 deletions
diff --git a/src/mesh/gnunet-service-mesh_local.c b/src/mesh/gnunet-service-mesh_local.c
index b77b7be8d..0fe98f448 100644
--- a/src/mesh/gnunet-service-mesh_local.c
+++ b/src/mesh/gnunet-service-mesh_local.c
@@ -192,6 +192,31 @@ handle_client_connect (void *cls, struct GNUNET_SERVER_Client *client)
192 192
193 193
194/** 194/**
195 * Iterator for deleting each channel whose client endpoint disconnected.
196 *
197 * @param cls Closure (client that has disconnected).
198 * @param key The local channel id (used to access the hashmap).
199 * @param value The value stored at the key (channel to destroy).
200 *
201 * @return GNUNET_OK, keep iterating.
202 */
203static int
204channel_destroy_iterator (void *cls,
205 uint32_t key,
206 void *value)
207{
208 struct MeshChannel *ch = value;
209 struct MeshClient *c = cls;
210
211 LOG (GNUNET_ERROR_TYPE_DEBUG,
212 " Channel %s destroy, due to client %s shutdown.\n",
213 GMCH_2s (ch), GML_2s (c));
214
215 GMCH_handle_local_destroy (ch, c);
216 return GNUNET_OK;
217}
218
219/**
195 * Handler for client disconnection 220 * Handler for client disconnection
196 * 221 *
197 * @param cls closure 222 * @param cls closure
@@ -210,7 +235,7 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
210 return; 235 return;
211 } 236 }
212 237
213 c = client_get (client); 238 c = GML_client_get (client);
214 if (NULL != c) 239 if (NULL != c)
215 { 240 {
216 LOG (GNUNET_ERROR_TYPE_DEBUG, "matching client found (%u, %p)\n", 241 LOG (GNUNET_ERROR_TYPE_DEBUG, "matching client found (%u, %p)\n",
@@ -349,7 +374,13 @@ handle_channel_create (void *cls, struct GNUNET_SERVER_Client *client,
349 return; 374 return;
350 } 375 }
351 376
352 GMCH_handle_local_create (c, (struct GNUNET_MESH_ChannelMessage *) message); 377 if (GNUNET_OK !=
378 GMCH_handle_local_create (c,
379 (struct GNUNET_MESH_ChannelMessage *) message))
380 {
381 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
382 return;
383 }
353 384
354 GNUNET_SERVER_receive_done (client, GNUNET_OK); 385 GNUNET_SERVER_receive_done (client, GNUNET_OK);
355 return; 386 return;
@@ -405,7 +436,7 @@ handle_channel_destroy (void *cls, struct GNUNET_SERVER_Client *client,
405 return; 436 return;
406 } 437 }
407 438
408 GMCH_handle_local_destroy (ch, c, chid); 439 GMCH_handle_local_destroy (ch, c);
409 440
410 GNUNET_SERVER_receive_done (client, GNUNET_OK); 441 GNUNET_SERVER_receive_done (client, GNUNET_OK);
411 return; 442 return;