From 94d362e7c457e7f98d543474b86f1ceb2d19f695 Mon Sep 17 00:00:00 2001 From: Christian Fuchs Date: Thu, 8 May 2014 10:52:37 +0000 Subject: [PATCH] - updated error reporting functionality for the service - client side initialization adapted --- src/scalarproduct/gnunet-service-scalarproduct.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/scalarproduct/gnunet-service-scalarproduct.c b/src/scalarproduct/gnunet-service-scalarproduct.c index 21cbafe5b..14711bf0c 100644 --- a/src/scalarproduct/gnunet-service-scalarproduct.c +++ b/src/scalarproduct/gnunet-service-scalarproduct.c @@ -771,6 +771,7 @@ prepare_bobs_cryptodata_message_multipart (void *cls) } if (s->transferred_element_count == s->used_element_count) { // final part + s->active = GNUNET_NO; GNUNET_free (s->r_prime); GNUNET_free (s->r); s->r_prime = NULL; @@ -867,6 +868,7 @@ prepare_bobs_cryptodata_message (void *cls, } else { //singlepart + s->active = GNUNET_NO; GNUNET_free (s->r); s->r = NULL; GNUNET_free (s->r_prime); @@ -1607,6 +1609,7 @@ handle_client_message (void *cls, } s = GNUNET_new (struct ServiceSession); + s->active = GNUNET_YES; s->client_notification_task = GNUNET_SCHEDULER_NO_TASK; s->client = client; s->total = total_count; @@ -2220,6 +2223,10 @@ invalid_msg: // send message with product to client if (NULL != s->client){ //Alice + if (NULL != s->product) + s->active = GNUNET_NO; + else + s->active = GNUNET_SYSERR; s->client_notification_task = GNUNET_SCHEDULER_add_now (&prepare_client_response, s); @@ -2360,7 +2367,7 @@ shutdown_task (void *cls, // terminate all owned open channels. for (s = from_client_head; NULL != s; s = s->next) { - if ((0/*//TODO: not finalized*/) && (NULL != s->channel)) { + if ((GNUNET_NO != s->active) && (NULL != s->channel)) { GNUNET_CADET_channel_destroy (s->channel); s->channel = NULL; } -- 2.25.1