diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-07-12 11:22:50 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-07-12 11:22:50 +0000 |
commit | f7b950749a0b2cf525cd812576ecde4227f813a2 (patch) | |
tree | 671815ffdff23ae04c6b33c952f13cf8dddc733e /src/mesh/gnunet-service-mesh.c | |
parent | de4a07bc496f9267010837edbd135d73a6518fd0 (diff) | |
download | gnunet-f7b950749a0b2cf525cd812576ecde4227f813a2.tar.gz gnunet-f7b950749a0b2cf525cd812576ecde4227f813a2.zip |
- use API change from r27944
Diffstat (limited to 'src/mesh/gnunet-service-mesh.c')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 52c93998b..765ed1faa 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -973,16 +973,7 @@ announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
973 | static struct MeshClient * | 973 | static struct MeshClient * |
974 | client_get (struct GNUNET_SERVER_Client *client) | 974 | client_get (struct GNUNET_SERVER_Client *client) |
975 | { | 975 | { |
976 | struct MeshClient *c; | 976 | return GNUNET_SERVER_client_get_user_context (client, struct MeshClient); |
977 | |||
978 | c = clients_head; | ||
979 | while (NULL != c) | ||
980 | { | ||
981 | if (c->handle == client) | ||
982 | return c; | ||
983 | c = c->next; | ||
984 | } | ||
985 | return NULL; | ||
986 | } | 977 | } |
987 | 978 | ||
988 | 979 | ||
@@ -4409,17 +4400,9 @@ handle_local_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client) | |||
4409 | return; | 4400 | return; |
4410 | } | 4401 | } |
4411 | 4402 | ||
4412 | c = clients_head; | 4403 | c = client_get (client); |
4413 | while (NULL != c) | 4404 | if (NULL != c) |
4414 | { | 4405 | { |
4415 | if (c->handle != client) | ||
4416 | { | ||
4417 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
4418 | " ... searching %p (%u)\n", | ||
4419 | c->handle, c->id); | ||
4420 | c = c->next; | ||
4421 | continue; | ||
4422 | } | ||
4423 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "matching client found (%u)\n", | 4406 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "matching client found (%u)\n", |
4424 | c->id); | 4407 | c->id); |
4425 | GNUNET_SERVER_client_drop (c->handle); | 4408 | GNUNET_SERVER_client_drop (c->handle); |
@@ -4440,6 +4423,10 @@ handle_local_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client) | |||
4440 | GNUNET_STATISTICS_update (stats, "# clients", -1, GNUNET_NO); | 4423 | GNUNET_STATISTICS_update (stats, "# clients", -1, GNUNET_NO); |
4441 | c = next; | 4424 | c = next; |
4442 | } | 4425 | } |
4426 | else | ||
4427 | { | ||
4428 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, " context NULL!\n"); | ||
4429 | } | ||
4443 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "done!\n"); | 4430 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "done!\n"); |
4444 | return; | 4431 | return; |
4445 | } | 4432 | } |
@@ -4482,6 +4469,7 @@ handle_local_new_client (void *cls, struct GNUNET_SERVER_Client *client, | |||
4482 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " client has %u ports\n", size); | 4469 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " client has %u ports\n", size); |
4483 | c->handle = client; | 4470 | c->handle = client; |
4484 | GNUNET_SERVER_client_keep (client); | 4471 | GNUNET_SERVER_client_keep (client); |
4472 | GNUNET_SERVER_client_set_user_context (client, c); | ||
4485 | if (size > 0) | 4473 | if (size > 0) |
4486 | { | 4474 | { |
4487 | uint32_t u32; | 4475 | uint32_t u32; |