[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r24321 - gnunet/src/testbed
From: |
gnunet |
Subject: |
[GNUnet-SVN] r24321 - gnunet/src/testbed |
Date: |
Mon, 15 Oct 2012 12:51:47 +0200 |
Author: harsha
Date: 2012-10-15 12:51:47 +0200 (Mon, 15 Oct 2012)
New Revision: 24321
Modified:
gnunet/src/testbed/gnunet-service-testbed.c
Log:
timeouts during forwarded overlay connects
Modified: gnunet/src/testbed/gnunet-service-testbed.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed.c 2012-10-15 08:58:25 UTC (rev
24320)
+++ gnunet/src/testbed/gnunet-service-testbed.c 2012-10-15 10:51:47 UTC (rev
24321)
@@ -579,6 +579,11 @@
uint64_t operation_id;
/**
+ * Id of the timeout task;
+ */
+ GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+
+ /**
* Enumeration of states for this context
*/
enum FOCCState {
@@ -1250,6 +1255,8 @@
static void
cleanup_focc (struct ForwardedOverlayConnectContext *focc)
{
+ if (GNUNET_SCHEDULER_NO_TASK != focc->timeout_task)
+ GNUNET_SCHEDULER_cancel (focc->timeout_task);
if (NULL != focc->sub_op)
GNUNET_TESTBED_operation_done (focc->sub_op);
if (NULL != focc->client)
@@ -1855,7 +1862,6 @@
peer_create_success_cb (void *cls, const struct GNUNET_MessageHeader *msg)
{
struct ForwardedOperationContext *fo_ctxt = cls;
- const struct GNUNET_TESTBED_PeerCreateSuccessEventMessage *success_msg;
struct GNUNET_MessageHeader *dup_msg;
struct Peer *remote_peer;
uint16_t msize;
@@ -1863,8 +1869,6 @@
GNUNET_SCHEDULER_cancel (fo_ctxt->timeout_task);
if (ntohs (msg->type) == GNUNET_MESSAGE_TYPE_TESTBED_PEERCREATESUCCESS)
{
- success_msg =
- (const struct GNUNET_TESTBED_PeerCreateSuccessEventMessage *) msg;
GNUNET_assert (NULL != fo_ctxt->cls);
remote_peer = fo_ctxt->cls;
peer_list_add (remote_peer);
@@ -2701,6 +2705,25 @@
/**
+ * Timeout task for cancelling a forwarded overlay connect connect
+ *
+ * @param cls the ForwardedOverlayConnectContext
+ * @param tc the task context from the scheduler
+ */
+static void
+forwarded_overlay_connect_timeout (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext
+ *tc)
+{
+ struct ForwardedOverlayConnectContext *focc = cls;
+
+ focc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ send_operation_fail_msg (focc->client, focc->operation_id, "Timeout");
+ cleanup_focc (focc);
+}
+
+
+/**
* Handler for GNUNET_MESSAGE_TYPE_TESTBED_OLCONNECT messages
*
* @param cls NULL
@@ -2771,6 +2794,9 @@
focc->client = client;
focc->operation_id = operation_id;
fopc->cls = focc;
+ fopc->timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
+
&forwarded_overlay_connect_timeout,
+ fopc);
}
}
fopc->opc =
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r24321 - gnunet/src/testbed,
gnunet <=