aboutsummaryrefslogtreecommitdiff
path: root/src/scalarproduct/gnunet-service-scalarproduct_bob.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-12-08 00:17:15 +0000
committerChristian Grothoff <christian@grothoff.org>2014-12-08 00:17:15 +0000
commit4d8d62298e1926c6f8bd26ad5a34b966ffeb188c (patch)
treef3bfc90e07d1af8bdc15b69663f03b3a07857e71 /src/scalarproduct/gnunet-service-scalarproduct_bob.c
parenta3c0efd4c0b4f30f4956e2e44d59bfb003b80c6f (diff)
downloadgnunet-4d8d62298e1926c6f8bd26ad5a34b966ffeb188c.tar.gz
gnunet-4d8d62298e1926c6f8bd26ad5a34b966ffeb188c.zip
-fix shutdown
Diffstat (limited to 'src/scalarproduct/gnunet-service-scalarproduct_bob.c')
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct_bob.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_bob.c b/src/scalarproduct/gnunet-service-scalarproduct_bob.c
index 414e2c603..38fc65f37 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct_bob.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct_bob.c
@@ -992,7 +992,7 @@ cb_intersection_element_removed (void *cls,
992 return; 992 return;
993 case GNUNET_SET_STATUS_DONE: 993 case GNUNET_SET_STATUS_DONE:
994 s->intersection_op = NULL; 994 s->intersection_op = NULL;
995 s->intersection_set = NULL; 995 GNUNET_break (NULL == s->intersection_set);
996 GNUNET_CADET_receive_done (s->cadet->channel); 996 GNUNET_CADET_receive_done (s->cadet->channel);
997 LOG (GNUNET_ERROR_TYPE_DEBUG, 997 LOG (GNUNET_ERROR_TYPE_DEBUG,
998 "Finished intersection, %d items remain\n", 998 "Finished intersection, %d items remain\n",
@@ -1014,7 +1014,11 @@ cb_intersection_element_removed (void *cls,
1014 LOG (GNUNET_ERROR_TYPE_DEBUG, 1014 LOG (GNUNET_ERROR_TYPE_DEBUG,
1015 "Set intersection failed!\n"); 1015 "Set intersection failed!\n");
1016 s->intersection_op = NULL; 1016 s->intersection_op = NULL;
1017 s->intersection_set = NULL; 1017 if (NULL != s->intersection_set)
1018 {
1019 GNUNET_SET_destroy (s->intersection_set);
1020 s->intersection_set = NULL;
1021 }
1018 s->status = GNUNET_SCALARPRODUCT_STATUS_FAILURE; 1022 s->status = GNUNET_SCALARPRODUCT_STATUS_FAILURE;
1019 prepare_client_end_notification (s); 1023 prepare_client_end_notification (s);
1020 return; 1024 return;
@@ -1046,8 +1050,17 @@ start_intersection (struct BobServiceSession *s)
1046 GNUNET_SET_RESULT_REMOVED, 1050 GNUNET_SET_RESULT_REMOVED,
1047 &cb_intersection_element_removed, 1051 &cb_intersection_element_removed,
1048 s); 1052 s);
1049 GNUNET_SET_commit (s->intersection_op, 1053 if (GNUNET_OK !=
1050 s->intersection_set); 1054 GNUNET_SET_commit (s->intersection_op,
1055 s->intersection_set))
1056 {
1057 GNUNET_break (0);
1058 s->status = GNUNET_SCALARPRODUCT_STATUS_FAILURE;
1059 prepare_client_end_notification (s);
1060 return;
1061 }
1062 GNUNET_SET_destroy (s->intersection_set);
1063 s->intersection_set = NULL;
1051} 1064}
1052 1065
1053 1066
@@ -1138,7 +1151,7 @@ cb_channel_incoming (void *cls,
1138 in = GNUNET_new (struct CadetIncomingSession); 1151 in = GNUNET_new (struct CadetIncomingSession);
1139 in->peer = *initiator; 1152 in->peer = *initiator;
1140 in->channel = channel; 1153 in->channel = channel;
1141 // in->cadet_mq = GNUNET_CADET_mq_create (in->channel); 1154 in->cadet_mq = GNUNET_CADET_mq_create (in->channel);
1142 return in; 1155 return in;
1143} 1156}
1144 1157