diff options
-rw-r--r-- | src/consensus/gnunet-service-consensus.c | 7 | ||||
-rw-r--r-- | src/include/gnunet_protocols.h | 16 | ||||
-rw-r--r-- | src/include/gnunet_set_service.h | 11 |
3 files changed, 30 insertions, 4 deletions
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c index 40abf912a9..acae74eafb 100644 --- a/src/consensus/gnunet-service-consensus.c +++ b/src/consensus/gnunet-service-consensus.c @@ -324,8 +324,6 @@ have_exp_subround_finished (const struct ConsensusSession *session) static void destroy_session (struct ConsensusSession *session) { - int i; - GNUNET_CONTAINER_DLL_remove (sessions_head, sessions_tail, session); if (NULL != session->element_set) { @@ -359,6 +357,7 @@ destroy_session (struct ConsensusSession *session) } if (NULL != session->info) { + int i; for (i = 0; i < session->num_peers; i++) { struct ConsensusPeerInformation *cpi; @@ -1349,9 +1348,9 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "client disconnected, destroying session\n"); destroy_session (session); + return; } - else - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "client disconnected, but waiting for consensus to finish\n"); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "client disconnected, but waiting for consensus to finish\n"); } diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index de585c9af8..bf8d4cf7f8 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h @@ -1918,6 +1918,22 @@ extern "C" */ #define GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_DONE 593 +/** + * Ask the set service to prepare a copy of a set. + */ +#define GNUNET_MESSAGE_TYPE_SET_COPY_LAZY_PREPARE 594 + +/** + * Give the client an ID for connecting to the set's copy. + */ +#define GNUNET_MESSAGE_TYPE_SET_COPY_LAZY_RESPONSE 595 + +/** + * Sent by the client to the server to connect to an existing, + * lazily copied set. + */ +#define GNUNET_MESSAGE_TYPE_SET_COPY_LAZY_CONNECT 596 + /******************************************************************************* * TESTBED LOGGER message types diff --git a/src/include/gnunet_set_service.h b/src/include/gnunet_set_service.h index e28fad754c..1000aea7b1 100644 --- a/src/include/gnunet_set_service.h +++ b/src/include/gnunet_set_service.h @@ -223,6 +223,11 @@ typedef void +typedef void +(*GNUNET_SET_CopyReadyCallback) (void *cls, + struct GNUNET_SET_Handle *copy); + + /** * Create an empty set, supporting the specified operation. * @@ -279,6 +284,12 @@ GNUNET_SET_remove_element (struct GNUNET_SET_Handle *set, void *cont_cls); +void +GNUNET_SET_copy_lazy (struct GNUNET_SET_Handle *set, + GNUNET_SET_CopyReadyCallback cb, + void *cls); + + /** * Destroy the set handle, and free all associated resources. * Iterations must have completed (or be explicitly canceled) |