projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4a918fb
)
WiP
author
Bart Polot
<bart@net.in.tum.de>
Fri, 14 Oct 2011 16:23:32 +0000
(16:23 +0000)
committer
Bart Polot
<bart@net.in.tum.de>
Fri, 14 Oct 2011 16:23:32 +0000
(16:23 +0000)
src/mesh/gnunet-service-mesh.c
patch
|
blob
|
history
diff --git
a/src/mesh/gnunet-service-mesh.c
b/src/mesh/gnunet-service-mesh.c
index 2fb1070ae4c5e06fb6abdd090320cc679a287f8a..7a49c3be8458784c53320c3fcb46f277e400170c 100644
(file)
--- a/
src/mesh/gnunet-service-mesh.c
+++ b/
src/mesh/gnunet-service-mesh.c
@@
-66,6
+66,10
@@
GNUNET_TIME_UNIT_SECONDS,\
5)
GNUNET_TIME_UNIT_SECONDS,\
5)
+#define UNACKNOWLEDGED_WAIT GNUNET_TIME_relative_multiply(\
+ GNUNET_TIME_UNIT_SECONDS,\
+ 2)
+
/******************************************************************************/
/************************ DATA STRUCTURES ****************************/
/******************************************************************************/
/******************************************************************************/
/************************ DATA STRUCTURES ****************************/
/******************************************************************************/
@@
-103,6
+107,9
@@
struct MeshDataDescriptor
/** Size of the data */
size_t size;
/** 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;
};
};
@@
-674,6
+681,17
@@
client_is_subscribed (uint16_t message_type, struct MeshClient *c)
return GNUNET_CONTAINER_multihashmap_contains (c->types, &hc);
}
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
/**
* Search for a tunnel by global ID using full PeerIdentities
@@
-2279,6
+2297,9
@@
handle_mesh_data_multicast (void *cls, const struct GNUNET_PeerIdentity *peer,
info->size = size;
info->copies = copies;
info->client = t->client->handle;
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);
info->destination = n->peer;
id = path_get_first_hop(t->tree, n->peer);
info->peer = peer_info_get(id);