-/**
- * Signal to the client that the operation has finished and
- * destroy the operation.
- *
- * @param cls operation to destroy
- */
-static void
-send_client_done_and_destroy (void *cls)
-{
- struct Operation *op = cls;
- struct GNUNET_MQ_Envelope *ev;
- struct GNUNET_SET_ResultMessage *rm;
- ev = GNUNET_MQ_msg (rm, GNUNET_MESSAGE_TYPE_SET_RESULT);
- rm->request_id = htonl (op->spec->client_request_id);
- rm->result_status = htons (GNUNET_SET_STATUS_DONE);
- rm->element_type = htons (0);
- GNUNET_MQ_send (op->spec->set->client_mq, ev);
- _GSS_operation_destroy (op);
-}
-/**
- * Send all elements in the full result iterator.
- *
- * @param cls operation
- */
-static void
-send_remaining_elements (void *cls)
-{
- struct Operation *op = cls;
- struct ElementEntry *remaining; //TODO rework this, key entry does not exist here
- struct GNUNET_MQ_Envelope *ev;
- struct GNUNET_SET_ResultMessage *rm;
- struct GNUNET_SET_Element *element;
- int res;
-
- res = GNUNET_CONTAINER_multihashmap32_iterator_next (op->state->full_result_iter, NULL, (const void **) &remaining);
- if (GNUNET_NO == res) {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "sending done and destroy because iterator ran out\n");
- send_client_done_and_destroy (op);
- return;
- }
-
- element = &remaining->element;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "sending element (size %u) to client (full set)\n", element->size);
- GNUNET_assert (0 != op->spec->client_request_id);
-
- ev = GNUNET_MQ_msg_extra (rm, element->size, GNUNET_MESSAGE_TYPE_SET_RESULT);
- GNUNET_assert (NULL != ev);
-
- rm->result_status = htons (GNUNET_SET_STATUS_OK);
- rm->request_id = htonl (op->spec->client_request_id);
- rm->element_type = element->type;
- memcpy (&rm[1], element->data, element->size);
-
- GNUNET_MQ_notify_sent (ev, send_remaining_elements, op);
- GNUNET_MQ_send (op->spec->set->client_mq, ev);
-}