GNUNET_TIME_UNIT_SECONDS,\
5)
+#define UNACKNOWLEDGED_WAIT GNUNET_TIME_relative_multiply(\
+ GNUNET_TIME_UNIT_SECONDS,\
+ 2)
+
/******************************************************************************/
/************************ DATA STRUCTURES ****************************/
/******************************************************************************/
/** Size of the data */
size_t size;
+ /** Used to allow a client send more traffic to the service after a
+ * previous packet was tried to be sent to a neighbor and couldn't */
+ GNUNET_SCHEDULER_TaskIdentifier timeout_task;
};
return GNUNET_CONTAINER_multihashmap_contains (c->types, &hc);
}
+static void
+client_allow_send(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ struct MeshDataDescriptor *info = cls;
+
+ if (GNUNET_SCHEDULER_REASON_SHUTDOWN == tc->reason)
+ return;
+ info->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ GNUNET_SERVER_receive_done(info->client, GNUNET_OK);
+}
+
/**
* Search for a tunnel by global ID using full PeerIdentities
info->size = size;
info->copies = copies;
info->client = t->client->handle;
+ info->timeout_task = GNUNET_SCHEDULER_add_delayed(UNACKNOWLEDGED_WAIT,
+ &client_allow_send,
+ t->client->handle);
info->destination = n->peer;
id = path_get_first_hop(t->tree, n->peer);
info->peer = peer_info_get(id);