aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet-new_connection.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-31 17:54:48 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-31 17:54:48 +0100
commit448a5370373e9dcef449c53aee6c078c7d3395d9 (patch)
treeaf1507380c0173773aa5e9e4722b2088a42bfd20 /src/cadet/gnunet-service-cadet-new_connection.c
parent24dc41dd58c67b53829888c21bbcaffc7cab5a05 (diff)
downloadgnunet-448a5370373e9dcef449c53aee6c078c7d3395d9.tar.gz
gnunet-448a5370373e9dcef449c53aee6c078c7d3395d9.zip
use observed RTT as starting point for retransmissions
Diffstat (limited to 'src/cadet/gnunet-service-cadet-new_connection.c')
-rw-r--r--src/cadet/gnunet-service-cadet-new_connection.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/cadet/gnunet-service-cadet-new_connection.c b/src/cadet/gnunet-service-cadet-new_connection.c
index 0ccfe8b45..6976e66e4 100644
--- a/src/cadet/gnunet-service-cadet-new_connection.c
+++ b/src/cadet/gnunet-service-cadet-new_connection.c
@@ -169,6 +169,20 @@ struct CadetConnection
169 169
170 170
171/** 171/**
172 * Lookup a connection by its identifier.
173 *
174 * @param cid identifier to resolve
175 * @return NULL if connection was not found
176 */
177struct CadetConnection *
178GCC_lookup (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid)
179{
180 return GNUNET_CONTAINER_multishortmap_get (connections,
181 &cid->connection_of_tunnel);
182}
183
184
185/**
172 * Update the connection state. Also triggers the necessary 186 * Update the connection state. Also triggers the necessary
173 * MQM notifications. 187 * MQM notifications.
174 * 188 *
@@ -405,8 +419,7 @@ GCC_ack_expected (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid)
405{ 419{
406 struct CadetConnection *cc; 420 struct CadetConnection *cc;
407 421
408 cc = GNUNET_CONTAINER_multishortmap_get (connections, 422 cc = GCC_lookup (cid);
409 &cid->connection_of_tunnel);
410 if (NULL == cc) 423 if (NULL == cc)
411 return; /* whopise, connection alredy down? */ 424 return; /* whopise, connection alredy down? */
412 cc->metrics.num_acked_transmissions++; 425 cc->metrics.num_acked_transmissions++;
@@ -426,8 +439,7 @@ GCC_ack_observed (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid)
426{ 439{
427 struct CadetConnection *cc; 440 struct CadetConnection *cc;
428 441
429 cc = GNUNET_CONTAINER_multishortmap_get (connections, 442 cc = GCC_lookup (cid);
430 &cid->connection_of_tunnel);
431 if (NULL == cc) 443 if (NULL == cc)
432 return; /* whopise, connection alredy down? */ 444 return; /* whopise, connection alredy down? */
433 cc->metrics.num_successes++; 445 cc->metrics.num_successes++;
@@ -450,8 +462,7 @@ GCC_latency_observed (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid,
450 double weight; 462 double weight;
451 double result; 463 double result;
452 464
453 cc = GNUNET_CONTAINER_multishortmap_get (connections, 465 cc = GCC_lookup (cid);
454 &cid->connection_of_tunnel);
455 if (NULL == cc) 466 if (NULL == cc)
456 return; /* whopise, connection alredy down? */ 467 return; /* whopise, connection alredy down? */
457 GNUNET_STATISTICS_update (stats, 468 GNUNET_STATISTICS_update (stats,