Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
-
/**
* @file set/gnunet-service-set_intersection.c
* @brief two-peer set intersection
struct GNUNET_CONTAINER_BloomFilter *local_bf;
/**
- * for multipart msgs we have to store the bloomfilter-data until we fully sent it.
- */
- char * bf_data;
-
- /**
- * size of the bloomfilter
+ * Iterator for sending elements on the key to element mapping to the client.
*/
- uint32_t bf_data_size;
+ struct GNUNET_CONTAINER_MultiHashMapIterator *full_result_iter;
/**
- * size of the bloomfilter
+ * Evaluate operations are held in a linked list.
*/
- uint32_t bf_bits_per_element;
+ struct OperationState *next;
/**
- * Current state of the operation.
+ * Evaluate operations are held in a linked list.
*/
- enum IntersectionOperationPhase phase;
+ struct OperationState *prev;
/**
- * Generation in which the operation handle
- * was created.
+ * for multipart msgs we have to store the bloomfilter-data until we fully sent it.
*/
- unsigned int generation_created;
+ char *bf_data;
/**
* Maps element-id-hashes to 'elements in our set'.
struct GNUNET_CONTAINER_MultiHashMap *my_elements;
/**
- * Current element count contained within contained_elements
+ * Current element count contained within @e my_elements
*/
uint32_t my_element_count;
/**
- * Iterator for sending elements on the key to element mapping to the client.
+ * size of the bloomfilter in @e bf_data.
*/
- struct GNUNET_CONTAINER_MultiHashMapIterator *full_result_iter;
+ uint32_t bf_data_size;
/**
- * Evaluate operations are held in
- * a linked list.
+ * size of the bloomfilter
*/
- struct OperationState *next;
+ uint32_t bf_bits_per_element;
- /**
- * Evaluate operations are held in
- * a linked list.
- */
- struct OperationState *prev;
+ /**
+ * Current state of the operation.
+ */
+ enum IntersectionOperationPhase phase;
+
+ /**
+ * Generation in which the operation handle
+ * was created.
+ */
+ unsigned int generation_created;
/**
* Did we send the client that we are done?
return GNUNET_YES;
}
+
/**
* fills the contained-elements hashmap with all relevant
* elements and adds their mutated hashes to our local bloomfilter
msg->request_id = htonl (op->spec->client_request_id);
msg->element_type = htons (0);
GNUNET_MQ_send (op->spec->set->client_mq, ev);
- _GSS_operation_destroy (op);
+ _GSS_operation_destroy (op, GNUNET_YES);
}
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);
+ _GSS_operation_destroy (op, GNUNET_YES);
}
GNUNET_MQ_send (op->spec->set->client_mq, ev);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"other peer disconnected prematurely\n");
- _GSS_operation_destroy (op);
+ _GSS_operation_destroy (op, GNUNET_YES);
return;
}
// else: the session has already been concluded
}*/
GNUNET_free (op->state);
op->state = NULL;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "destroying intersection op done\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "destroying intersection op done\n");
}
+
+/**
+ * Get the table with implementing functions for set intersection.
+ *
+ * @return the operation specific VTable
+ */
const struct SetVT *
_GSS_intersection_vt ()
{