aboutsummaryrefslogtreecommitdiff
path: root/src/cadet
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-12-15 07:18:27 +0000
committerBart Polot <bart@net.in.tum.de>2014-12-15 07:18:27 +0000
commit01d34009ff06462df2ced8045565adff5cb21bde (patch)
treec1fcdc0d3068bfdd2739c76ab13dd5ea60853881 /src/cadet
parent1017fd2db6ab73a8f2c823f5ca21f3f87058f842 (diff)
downloadgnunet-01d34009ff06462df2ced8045565adff5cb21bde.tar.gz
gnunet-01d34009ff06462df2ced8045565adff5cb21bde.zip
- always allow an ACK
Diffstat (limited to 'src/cadet')
-rw-r--r--src/cadet/gnunet-service-cadet_peer.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c
index 3f2cbd1de..5ad4fffc8 100644
--- a/src/cadet/gnunet-service-cadet_peer.c
+++ b/src/cadet/gnunet-service-cadet_peer.c
@@ -961,6 +961,20 @@ search_handler (void *cls, const struct CadetPeerPath *path)
961 961
962 962
963/** 963/**
964 * Adjust core requested size to accomodate an ACK.
965 *
966 * @param message_size Requested size.
967 *
968 * @return Size enough to fit @c message_size and an ACK.
969 */
970static size_t
971get_core_size (size_t message_size)
972{
973 return message_size + sizeof (struct GNUNET_CADET_ACK);
974}
975
976
977/**
964 * Fill a core buffer with the appropriate data for the queued message. 978 * Fill a core buffer with the appropriate data for the queued message.
965 * 979 *
966 * @param queue Queue element for the message. 980 * @param queue Queue element for the message.
@@ -1136,7 +1150,7 @@ queue_send (void *cls, size_t size, void *buf)
1136 GNUNET_NO, get_priority (queue), 1150 GNUNET_NO, get_priority (queue),
1137 GNUNET_TIME_UNIT_FOREVER_REL, 1151 GNUNET_TIME_UNIT_FOREVER_REL,
1138 dst_id, 1152 dst_id,
1139 queue->size, 1153 get_core_size (queue->size),
1140 &queue_send, 1154 &queue_send,
1141 peer); 1155 peer);
1142 peer->tmt_time = GNUNET_TIME_absolute_get (); 1156 peer->tmt_time = GNUNET_TIME_absolute_get ();
@@ -1342,7 +1356,8 @@ GCP_queue_add (struct CadetPeer *peer, void *cls, uint16_t type,
1342 GNUNET_NO, get_priority (q), 1356 GNUNET_NO, get_priority (q),
1343 GNUNET_TIME_UNIT_FOREVER_REL, 1357 GNUNET_TIME_UNIT_FOREVER_REL,
1344 GNUNET_PEER_resolve2 (peer->id), 1358 GNUNET_PEER_resolve2 (peer->id),
1345 size, &queue_send, peer); 1359 get_core_size (size),
1360 &queue_send, peer);
1346 peer->tmt_time = GNUNET_TIME_absolute_get (); 1361 peer->tmt_time = GNUNET_TIME_absolute_get ();
1347 } 1362 }
1348 else if (GNUNET_NO == call_core) 1363 else if (GNUNET_NO == call_core)
@@ -1553,7 +1568,7 @@ GCP_queue_unlock (struct CadetPeer *peer, struct CadetConnection *c)
1553 GNUNET_NO, get_priority (q), 1568 GNUNET_NO, get_priority (q),
1554 GNUNET_TIME_UNIT_FOREVER_REL, 1569 GNUNET_TIME_UNIT_FOREVER_REL,
1555 GNUNET_PEER_resolve2 (peer->id), 1570 GNUNET_PEER_resolve2 (peer->id),
1556 size, 1571 get_core_size (size),
1557 &queue_send, 1572 &queue_send,
1558 peer); 1573 peer);
1559 peer->tmt_time = GNUNET_TIME_absolute_get (); 1574 peer->tmt_time = GNUNET_TIME_absolute_get ();