aboutsummaryrefslogtreecommitdiff
path: root/src/set/gnunet-service-set_union.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/set/gnunet-service-set_union.c')
-rw-r--r--src/set/gnunet-service-set_union.c39
1 files changed, 34 insertions, 5 deletions
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c
index 8c0c52d64..73d3f5c83 100644
--- a/src/set/gnunet-service-set_union.c
+++ b/src/set/gnunet-service-set_union.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -758,8 +758,8 @@ get_order_from_difference (unsigned int diff)
758 */ 758 */
759static int 759static int
760send_full_element_iterator (void *cls, 760send_full_element_iterator (void *cls,
761 const struct GNUNET_HashCode *key, 761 const struct GNUNET_HashCode *key,
762 void *value) 762 void *value)
763{ 763{
764 struct Operation *op = cls; 764 struct Operation *op = cls;
765 struct GNUNET_SET_ElementMessage *emsg; 765 struct GNUNET_SET_ElementMessage *emsg;
@@ -1367,6 +1367,26 @@ send_client_element (struct Operation *op,
1367 1367
1368 1368
1369/** 1369/**
1370 * Destroy remote channel.
1371 *
1372 * @param op operation
1373 */
1374static void
1375destroy_channel (struct Operation *op)
1376{
1377 struct GNUNET_CADET_Channel *channel;
1378
1379 if (NULL != (channel = op->channel))
1380 {
1381 /* This will free op; called conditionally as this helper function
1382 is also called from within the channel disconnect handler. */
1383 op->channel = NULL;
1384 GNUNET_CADET_channel_destroy (channel);
1385 }
1386}
1387
1388
1389/**
1370 * Signal to the client that the operation has finished and 1390 * Signal to the client that the operation has finished and
1371 * destroy the operation. 1391 * destroy the operation.
1372 * 1392 *
@@ -1379,13 +1399,18 @@ send_client_done (void *cls)
1379 struct GNUNET_MQ_Envelope *ev; 1399 struct GNUNET_MQ_Envelope *ev;
1380 struct GNUNET_SET_ResultMessage *rm; 1400 struct GNUNET_SET_ResultMessage *rm;
1381 1401
1382 if (GNUNET_YES == op->state->client_done_sent) { 1402 if (GNUNET_YES == op->state->client_done_sent)
1403 {
1383 return; 1404 return;
1384 } 1405 }
1385 1406
1386 if (PHASE_DONE != op->state->phase) { 1407 if (PHASE_DONE != op->state->phase) {
1387 LOG (GNUNET_ERROR_TYPE_WARNING, 1408 LOG (GNUNET_ERROR_TYPE_WARNING,
1388 "union operation failed\n"); 1409 "Union operation failed\n");
1410 GNUNET_STATISTICS_update (_GSS_statistics,
1411 "# Union operations failed",
1412 1,
1413 GNUNET_NO);
1389 ev = GNUNET_MQ_msg (rm, GNUNET_MESSAGE_TYPE_SET_RESULT); 1414 ev = GNUNET_MQ_msg (rm, GNUNET_MESSAGE_TYPE_SET_RESULT);
1390 rm->result_status = htons (GNUNET_SET_STATUS_FAILURE); 1415 rm->result_status = htons (GNUNET_SET_STATUS_FAILURE);
1391 rm->request_id = htonl (op->client_request_id); 1416 rm->request_id = htonl (op->client_request_id);
@@ -1397,6 +1422,10 @@ send_client_done (void *cls)
1397 1422
1398 op->state->client_done_sent = GNUNET_YES; 1423 op->state->client_done_sent = GNUNET_YES;
1399 1424
1425 GNUNET_STATISTICS_update (_GSS_statistics,
1426 "# Union operations succeeded",
1427 1,
1428 GNUNET_NO);
1400 LOG (GNUNET_ERROR_TYPE_INFO, 1429 LOG (GNUNET_ERROR_TYPE_INFO,
1401 "Signalling client that union operation is done\n"); 1430 "Signalling client that union operation is done\n");
1402 ev = GNUNET_MQ_msg (rm, 1431 ev = GNUNET_MQ_msg (rm,