"-%" PRIu32 ": %s",
i,
sampler->sampler_elements[i]->file_name);
- GNUNET_free (sampler->sampler_elements[i]);
+ RPS_sampler_elem_destroy (sampler->sampler_elements[i]);
}
GNUNET_array_grow (sampler->sampler_elements,
}
+/**
+ * Destroy a sampler element.
+ *
+ * @param sampler_elem the element to destroy
+ */
+void
+RPS_sampler_elem_destroy (struct RPS_SamplerElement *sampler_elem)
+{
+ #ifdef TO_FILE
+ if (NULL != sampler_elem->file_name)
+ {
+ GNUNET_free (sampler_elem->file_name);
+ }
+ #endif /* TO_FILE */
+ GNUNET_free (sampler_elem);
+}
+
+
/**
* Input an PeerID into the given sampler element.
*
s_elem->num_peers++;
+ #ifdef TO_FILE
to_file (s_elem->file_name,
"Got id %s",
GNUNET_i2s_full (other));
+ #endif /* TO_FILE */
if (0 == GNUNET_CRYPTO_cmp_peer_identity (other, &(s_elem->peer_id)))
{
}
s_elem->is_empty = NOT_EMPTY;
+ #ifdef TO_FILE
to_file (s_elem->file_name,
"Now holding %s",
GNUNET_i2s_full (&s_elem->peer_id));
+ #endif /* TO_FILE */
}
/**
RPS_sampler_elem_create (void);
+/**
+ * Destroy a sampler element.
+ *
+ * @param sampler_elem the element to destroy
+ */
+void
+RPS_sampler_elem_destroy (struct RPS_SamplerElement *sampler_elem);
+
+
/**
* Input an PeerID into the given sampler element.
*