diff options
-rw-r--r-- | src/cadet/gnunet-service-cadet_local.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/cadet/gnunet-service-cadet_local.c b/src/cadet/gnunet-service-cadet_local.c index c6e2fe30d..4213ad278 100644 --- a/src/cadet/gnunet-service-cadet_local.c +++ b/src/cadet/gnunet-service-cadet_local.c | |||
@@ -379,7 +379,36 @@ static void | |||
379 | handle_port_close (void *cls, struct GNUNET_SERVER_Client *client, | 379 | handle_port_close (void *cls, struct GNUNET_SERVER_Client *client, |
380 | const struct GNUNET_MessageHeader *message) | 380 | const struct GNUNET_MessageHeader *message) |
381 | { | 381 | { |
382 | // FIXME | 382 | struct CadetClient *c; |
383 | struct GNUNET_CADET_PortMessage *pmsg; | ||
384 | int removed; | ||
385 | |||
386 | LOG (GNUNET_ERROR_TYPE_DEBUG, "close port requested\n"); | ||
387 | |||
388 | /* Sanity check for client registration */ | ||
389 | if (NULL == (c = GML_client_get (client))) | ||
390 | { | ||
391 | GNUNET_break (0); | ||
392 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | ||
393 | return; | ||
394 | } | ||
395 | LOG (GNUNET_ERROR_TYPE_DEBUG, " by client %u\n", c->id); | ||
396 | |||
397 | /* Message size sanity check */ | ||
398 | if (sizeof (struct GNUNET_CADET_PortMessage) != ntohs (message->size)) | ||
399 | { | ||
400 | GNUNET_break (0); | ||
401 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | ||
402 | return; | ||
403 | } | ||
404 | |||
405 | pmsg = (struct GNUNET_CADET_PortMessage *) message; | ||
406 | removed = GNUNET_CONTAINER_multihashmap_remove (c->ports, &pmsg->port, c); | ||
407 | GNUNET_break_op (GNUNET_YES == removed); | ||
408 | removed = GNUNET_CONTAINER_multihashmap_remove (ports, &pmsg->port, c); | ||
409 | GNUNET_break_op (GNUNET_YES == removed); | ||
410 | |||
411 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | ||
383 | } | 412 | } |
384 | 413 | ||
385 | 414 | ||