[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: CONSENSUS/SET: even uglier
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: CONSENSUS/SET: even uglier CADET workarounds |
Date: |
Sun, 18 Jun 2017 02:24:13 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new ab4573d4f CONSENSUS/SET: even uglier CADET workarounds
ab4573d4f is described below
commit ab4573d4f7dafe44d414a6d1f23397682ac0ca70
Author: Florian Dold <address@hidden>
AuthorDate: Sun Jun 18 02:24:03 2017 +0200
CONSENSUS/SET: even uglier CADET workarounds
---
src/consensus/gnunet-service-consensus.c | 15 ++++++++--
src/set/gnunet-service-set_union.c | 49 +++++++++++++++++++++-----------
2 files changed, 46 insertions(+), 18 deletions(-)
diff --git a/src/consensus/gnunet-service-consensus.c
b/src/consensus/gnunet-service-consensus.c
index 4af7199aa..6b76efb18 100644
--- a/src/consensus/gnunet-service-consensus.c
+++ b/src/consensus/gnunet-service-consensus.c
@@ -1133,8 +1133,11 @@ set_result_cb (void *cls,
// XXX: check first if any changes to the underlying
// set are still pending
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Finishing setop in Task {%s}\n",
- debug_str_task_key (&task->key));
+ "P%u: Finishing setop in Task {%s} (%u/%u)\n",
+ session->local_peer_idx,
+ debug_str_task_key (&task->key),
+ (unsigned int) task->step->finished_tasks,
+ (unsigned int) task->step->tasks_len);
if (NULL != output_rfn)
{
rfn_commit (output_rfn, task_other_peer (task));
@@ -1470,6 +1473,7 @@ commit_set (struct ConsensusSession *session,
peers to wait. */
GNUNET_SET_operation_cancel (setop->op);
setop->op = NULL;
+ finish_task (task);
}
#endif
}
@@ -2378,6 +2382,13 @@ finish_task (struct TaskEntry *task)
task->step->finished_tasks++;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "P%u: Finishing setop in Task {%s} (now %u/%u tasks finished in
step)\n",
+ task->step->session->local_peer_idx,
+ debug_str_task_key (&task->key),
+ (unsigned int) task->step->finished_tasks,
+ (unsigned int) task->step->tasks_len);
+
if (task->step->finished_tasks == task->step->tasks_len)
finish_step (task->step);
}
diff --git a/src/set/gnunet-service-set_union.c
b/src/set/gnunet-service-set_union.c
index 94910dd02..3e18bf08e 100644
--- a/src/set/gnunet-service-set_union.c
+++ b/src/set/gnunet-service-set_union.c
@@ -1381,6 +1381,24 @@ send_client_done (void *cls)
struct GNUNET_MQ_Envelope *ev;
struct GNUNET_SET_ResultMessage *rm;
+ if (GNUNET_YES == op->state->client_done_sent) {
+ return;
+ }
+
+ if (PHASE_DONE != op->state->phase) {
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ "union operation failed\n");
+ ev = GNUNET_MQ_msg (rm, GNUNET_MESSAGE_TYPE_SET_RESULT);
+ rm->result_status = htons (GNUNET_SET_STATUS_FAILURE);
+ rm->request_id = htonl (op->client_request_id);
+ rm->element_type = htons (0);
+ GNUNET_MQ_send (op->set->cs->mq,
+ ev);
+ return;
+ }
+
+ op->state->client_done_sent = GNUNET_YES;
+
LOG (GNUNET_ERROR_TYPE_INFO,
"Signalling client that union operation is done\n");
ev = GNUNET_MQ_msg (rm,
@@ -1393,22 +1411,6 @@ send_client_done (void *cls)
ev);
}
-/**
- * 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;
- send_client_done (cls);
- /* Will also call the union-specific cancel function. */
- _GSS_operation_destroy (op,
- GNUNET_YES);
-}
-
/**
* Tests if the operation is finished, and if so notify.
@@ -1449,6 +1451,13 @@ maybe_finish (struct Operation *op)
struct GNUNET_MQ_Envelope *ev;
op->state->phase = PHASE_DONE;
+ /* FIXME: temporary hack, send message twice and add notification to
second message,
+ * so we can be pretty sure that the other party gets at least one of
these
+ * (since tunnel end handler is currently broken).
+ */
+ ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_OVER);
+ GNUNET_MQ_send (op->mq,
+ ev);
ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_OVER);
GNUNET_MQ_notify_sent (ev,
&send_client_done,
@@ -1884,6 +1893,13 @@ handle_union_p2p_full_done (void *cls,
/* We sent the full set, and got the response for that. We're done. */
op->state->phase = PHASE_DONE;
GNUNET_CADET_receive_done (op->channel);
+ /* FIXME: temporary hack, send message twice and add notification to
second message,
+ * so we can be pretty sure that the other party gets at least one of
these
+ * (since tunnel end handler is currently broken).
+ */
+ ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_OVER);
+ GNUNET_MQ_send (op->mq,
+ ev);
ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_OVER);
GNUNET_MQ_notify_sent (ev,
&send_client_done,
@@ -2409,6 +2425,7 @@ union_copy_state (struct SetState *state)
static void
union_channel_death (struct Operation *op)
{
+ send_client_done (op);
_GSS_operation_destroy (op,
GNUNET_YES);
}
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: CONSENSUS/SET: even uglier CADET workarounds,
gnunet <=