aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-02-02 16:13:56 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-02-02 16:13:56 +0000
commit9ef26c1cdc2c9aad5314ac1f2dfc5eb14c6c8215 (patch)
tree7b59cfef1f950b6183d4948909019644e04e91e4 /src
parentf3a2f0e7405a3e616968391c26be5fd1b995d623 (diff)
downloadgnunet-9ef26c1cdc2c9aad5314ac1f2dfc5eb14c6c8215.tar.gz
gnunet-9ef26c1cdc2c9aad5314ac1f2dfc5eb14c6c8215.zip
- changes
Diffstat (limited to 'src')
-rw-r--r--src/transport/plugin_transport_udp_new.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/transport/plugin_transport_udp_new.c b/src/transport/plugin_transport_udp_new.c
index 05e6a0582..db5d14ed1 100644
--- a/src/transport/plugin_transport_udp_new.c
+++ b/src/transport/plugin_transport_udp_new.c
@@ -109,6 +109,11 @@ struct Session
109 */ 109 */
110 struct GNUNET_TIME_Absolute flow_delay_from_other_peer; 110 struct GNUNET_TIME_Absolute flow_delay_from_other_peer;
111 111
112 /**
113 * expected delay for ACKs
114 */
115 struct GNUNET_TIME_Relative last_expected_delay;
116
112 117
113 struct GNUNET_ATS_Information ats; 118 struct GNUNET_ATS_Information ats;
114 119
@@ -537,7 +542,7 @@ disconnect_and_free_it (void *cls, const GNUNET_HashCode * key, void *value)
537#endif 542#endif
538 plugin->env->session_end (plugin->env->cls, &s->target, s); 543 plugin->env->session_end (plugin->env->cls, &s->target, s);
539 544
540 while (s->frag_ctx != NULL) 545 if (s->frag_ctx != NULL)
541 { 546 {
542 GNUNET_FRAGMENT_context_destroy(s->frag_ctx->frag); 547 GNUNET_FRAGMENT_context_destroy(s->frag_ctx->frag);
543 GNUNET_free (s->frag_ctx); 548 GNUNET_free (s->frag_ctx);
@@ -654,6 +659,7 @@ create_session (struct Plugin *plugin, const struct GNUNET_PeerIdentity *target,
654 s->sock_addr = (const struct sockaddr *) &s[1]; 659 s->sock_addr = (const struct sockaddr *) &s[1];
655 s->flow_delay_for_other_peer = GNUNET_TIME_relative_get_zero(); 660 s->flow_delay_for_other_peer = GNUNET_TIME_relative_get_zero();
656 s->flow_delay_from_other_peer = GNUNET_TIME_absolute_get_zero(); 661 s->flow_delay_from_other_peer = GNUNET_TIME_absolute_get_zero();
662 s->last_expected_delay = GNUNET_TIME_UNIT_SECONDS;
657 663
658 return s; 664 return s;
659} 665}
@@ -911,7 +917,7 @@ udp_plugin_send (void *cls,
911 frag_ctx->frag = GNUNET_FRAGMENT_context_create (plugin->env->stats, 917 frag_ctx->frag = GNUNET_FRAGMENT_context_create (plugin->env->stats,
912 UDP_MTU, 918 UDP_MTU,
913 &plugin->tracker, 919 &plugin->tracker,
914 plugin->last_expected_delay, 920 s->last_expected_delay,
915 &udp->header, 921 &udp->header,
916 &enqueue_fragment, 922 &enqueue_fragment,
917 frag_ctx); 923 frag_ctx);
@@ -1328,7 +1334,7 @@ static void read_process_ack (struct Plugin *plugin,
1328 (unsigned int) ntohs (msg->size), GNUNET_i2s (&udp_ack->sender), 1334 (unsigned int) ntohs (msg->size), GNUNET_i2s (&udp_ack->sender),
1329 GNUNET_a2s ((const struct sockaddr *) addr, fromlen)); 1335 GNUNET_a2s ((const struct sockaddr *) addr, fromlen));
1330#endif 1336#endif
1331 plugin->last_expected_delay = GNUNET_FRAGMENT_context_destroy (s->frag_ctx->frag); 1337 s->last_expected_delay = GNUNET_FRAGMENT_context_destroy (s->frag_ctx->frag);
1332 1338
1333 struct UDPMessageWrapper * udpw = plugin->msg_head; 1339 struct UDPMessageWrapper * udpw = plugin->msg_head;
1334 while (udpw!= NULL) 1340 while (udpw!= NULL)
@@ -1513,7 +1519,9 @@ udp_select_send (struct Plugin *plugin)
1513 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fragmented message for peer `%s' with size %u timed out\n", 1519 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fragmented message for peer `%s' with size %u timed out\n",
1514 GNUNET_i2s(&udpw->session->target), udpw->frag_ctx->bytes_to_send); 1520 GNUNET_i2s(&udpw->session->target), udpw->frag_ctx->bytes_to_send);
1515#endif 1521#endif
1516 GNUNET_FRAGMENT_context_destroy(udpw->frag_ctx->frag); 1522 udpw->session->last_expected_delay = GNUNET_FRAGMENT_context_destroy(udpw->frag_ctx->frag);
1523 GNUNET_free (udpw->frag_ctx);
1524 udpw->session->frag_ctx = NULL;
1517 } 1525 }
1518 else 1526 else
1519 { 1527 {
@@ -1533,14 +1541,15 @@ udp_select_send (struct Plugin *plugin)
1533 if (delta.rel_value == 0) 1541 if (delta.rel_value == 0)
1534 { 1542 {
1535 /* this message is not delayed */ 1543 /* this message is not delayed */
1536 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Message is not delayed for %llu \n", 1544 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message for peer `%s' (%u bytes) is not delayed \n",
1537 delta); 1545 GNUNET_i2s(&udpw->session->target), udpw->msg_size);
1538 break; 1546 break;
1539 } 1547 }
1540 else 1548 else
1541 { 1549 {
1542 /* this message is delayed, try next */ 1550 /* this message is delayed, try next */
1543 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Message is delayed for %llu \n", 1551 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message for peer `%s' (%u bytes) is delayed for %llu \n",
1552 GNUNET_i2s(&udpw->session->target), udpw->msg_size,
1544 delta); 1553 delta);
1545 udpw = udpw->next; 1554 udpw = udpw->next;
1546 } 1555 }
@@ -1917,7 +1926,6 @@ libgnunet_plugin_transport_udp_init (void *cls)
1917 plugin->mst = GNUNET_SERVER_mst_create (&process_inbound_tokenized_messages, plugin); 1926 plugin->mst = GNUNET_SERVER_mst_create (&process_inbound_tokenized_messages, plugin);
1918 plugin->port = port; 1927 plugin->port = port;
1919 plugin->aport = aport; 1928 plugin->aport = aport;
1920 plugin->last_expected_delay = GNUNET_TIME_UNIT_SECONDS;
1921 plugin->broadcast_interval = interval; 1929 plugin->broadcast_interval = interval;
1922 plugin->enable_ipv6 = enable_v6; 1930 plugin->enable_ipv6 = enable_v6;
1923 plugin->env = env; 1931 plugin->env = env;