aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-tng.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/gnunet-service-tng.c')
-rw-r--r--src/transport/gnunet-service-tng.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c
index 56cf61c2b..59575da79 100644
--- a/src/transport/gnunet-service-tng.c
+++ b/src/transport/gnunet-service-tng.c
@@ -7764,11 +7764,9 @@ select_best_pending_from_link (struct PendingMessageScoreContext *sc,
7764 struct DistanceVectorHop *dvh, 7764 struct DistanceVectorHop *dvh,
7765 size_t overhead) 7765 size_t overhead)
7766{ 7766{
7767 /* FIXME-NEXT: right now we ignore all the 'fancy' sorting 7767 struct GNUNET_TIME_Absolute now;
7768 we do on the pending message list, resulting in a 7768
7769 linear time algorithm (PLUS linear time list management). 7769 now = GNUNET_TIME_absolute_get ();
7770 So we should probably either avoid keeping a sorted list,
7771 or find a way to make the sorting useful here! */
7772 for (struct PendingMessage *pos = vl->pending_msg_head; NULL != pos; 7770 for (struct PendingMessage *pos = vl->pending_msg_head; NULL != pos;
7773 pos = pos->next_vl) 7771 pos = pos->next_vl)
7774 { 7772 {
@@ -7776,6 +7774,8 @@ select_best_pending_from_link (struct PendingMessageScoreContext *sc,
7776 int frag; 7774 int frag;
7777 int relb; 7775 int relb;
7778 7776
7777 if (pos->next_attempt.abs_value_us > now.abs_value_us)
7778 break; /* too early for all messages, they are sorted by next_attempt */
7779 if (NULL != pos->qe) 7779 if (NULL != pos->qe)
7780 continue; /* not eligible */ 7780 continue; /* not eligible */
7781 sc->consideration_counter++; 7781 sc->consideration_counter++;
@@ -7946,9 +7946,11 @@ transmit_on_queue (void *cls)
7946 characteristics (i.e. RTT); it takes one RTT for the message to 7946 characteristics (i.e. RTT); it takes one RTT for the message to
7947 arrive and the ACK to come back in the best case; but the other 7947 arrive and the ACK to come back in the best case; but the other
7948 side is allowed to delay ACKs by 2 RTTs, so we use 4 RTT before 7948 side is allowed to delay ACKs by 2 RTTs, so we use 4 RTT before
7949 retransmitting. Note that in the future this heuristic should 7949 retransmitting.
7950 likely be improved further (measure RTT stability, consider 7950
7951 message urgency and size when delaying ACKs, etc.) */ 7951 OPTIMIZE: Note that in the future this heuristic should likely
7952 be improved further (measure RTT stability, consider message
7953 urgency and size when delaying ACKs, etc.) */
7952 update_pm_next_attempt (pm, 7954 update_pm_next_attempt (pm,
7953 GNUNET_TIME_relative_to_absolute ( 7955 GNUNET_TIME_relative_to_absolute (
7954 GNUNET_TIME_relative_multiply (queue->pd.aged_rtt, 7956 GNUNET_TIME_relative_multiply (queue->pd.aged_rtt,