+ case PHASE_INITIAL:
+ GNUNET_break_op (0);
+ fail_intersection_operation (op);
+ break;
+ case PHASE_COUNT_SENT:
+ case PHASE_BF_EXCHANGE:
+ bf_size = ntohl (msg->bloomfilter_total_length);
+ bf_bits_per_element = ntohl (msg->bits_per_element);
+ chunk_size = msize - sizeof (struct BFMessage);
+ op->state->other_xor = msg->element_xor_hash;
+ if (bf_size == chunk_size)
+ {
+ if (NULL != op->state->bf_data)
+ {
+ GNUNET_break_op (0);
+ fail_intersection_operation (op);
+ return;
+ }
+ /* single part, done here immediately */
+ op->state->remote_bf
+ = GNUNET_CONTAINER_bloomfilter_init ((const char*) &msg[1],
+ bf_size,
+ bf_bits_per_element);
+ op->state->salt = ntohl (msg->sender_mutator);
+ op->spec->remote_element_count = ntohl (msg->sender_element_count);
+ process_bf (op);
+ return;
+ }
+ /* multipart chunk */
+ if (NULL == op->state->bf_data)
+ {
+ /* first chunk, initialize */
+ op->state->bf_data = GNUNET_malloc (bf_size);
+ op->state->bf_data_size = bf_size;
+ op->state->bf_bits_per_element = bf_bits_per_element;
+ op->state->bf_data_offset = 0;
+ op->state->salt = ntohl (msg->sender_mutator);
+ op->spec->remote_element_count = ntohl (msg->sender_element_count);
+ }
+ else
+ {
+ /* increment */
+ if ( (op->state->bf_data_size != bf_size) ||
+ (op->state->bf_bits_per_element != bf_bits_per_element) ||
+ (op->state->bf_data_offset + chunk_size > bf_size) ||
+ (op->state->salt != ntohl (msg->sender_mutator)) ||
+ (op->spec->remote_element_count != ntohl (msg->sender_element_count)) )
+ {
+ GNUNET_break_op (0);
+ fail_intersection_operation (op);
+ return;
+ }
+ }
+ GNUNET_memcpy (&op->state->bf_data[op->state->bf_data_offset],
+ (const char*) &msg[1],
+ chunk_size);
+ op->state->bf_data_offset += chunk_size;
+ if (op->state->bf_data_offset == bf_size)
+ {
+ /* last chunk, run! */
+ op->state->remote_bf
+ = GNUNET_CONTAINER_bloomfilter_init (op->state->bf_data,
+ bf_size,
+ bf_bits_per_element);
+ GNUNET_free (op->state->bf_data);
+ op->state->bf_data = NULL;
+ op->state->bf_data_size = 0;
+ process_bf (op);
+ }
+ break;
+ default:
+ GNUNET_break_op (0);
+ fail_intersection_operation (op);
+ break;