aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-10-18 15:12:25 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-10-18 15:12:25 +0000
commit2f4061710116e83083786754768bdf92a97866c0 (patch)
tree48cfb54bbbd5774657d7cd4e5ec0a4fb3724cf19
parent846b6a5bee7dc3e42a8664f01890d59cefaedb8a (diff)
downloadgnunet-2f4061710116e83083786754768bdf92a97866c0.tar.gz
gnunet-2f4061710116e83083786754768bdf92a97866c0.zip
preliminary workaround for 0002549
-rw-r--r--src/transport/gnunet-service-transport_validation.c3
-rw-r--r--src/transport/plugin_transport_udp.c25
2 files changed, 25 insertions, 3 deletions
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c
index ab334013d..c345e9255 100644
--- a/src/transport/gnunet-service-transport_validation.c
+++ b/src/transport/gnunet-service-transport_validation.c
@@ -1150,10 +1150,11 @@ GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender,
1150 &ve->public_key)) 1150 &ve->public_key))
1151 { 1151 {
1152 GNUNET_break_op (0); 1152 GNUNET_break_op (0);
1153 /*
1153 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1154 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1154 "Invalid signature on address %s:%s from peer `%s'\n", 1155 "Invalid signature on address %s:%s from peer `%s'\n",
1155 tname, GST_plugins_a2s (ve->address), 1156 tname, GST_plugins_a2s (ve->address),
1156 GNUNET_i2s (sender)); 1157 GNUNET_i2s (sender));*/
1157 return; 1158 return;
1158 } 1159 }
1159 1160
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index 69acb50fd..c456bd461 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -288,6 +288,9 @@ struct UDP_FragmentationContext
288 * Bytes used to send all fragments on wire including UDP overhead 288 * Bytes used to send all fragments on wire including UDP overhead
289 */ 289 */
290 size_t on_wire_size; 290 size_t on_wire_size;
291
292 unsigned int fragments_used;
293 struct GNUNET_TIME_Relative exp_delay;
291}; 294};
292 295
293 296
@@ -1408,6 +1411,7 @@ enqueue_fragment (void *cls, const struct GNUNET_MessageHeader *msg)
1408 1411
1409 LOG (GNUNET_ERROR_TYPE_DEBUG, 1412 LOG (GNUNET_ERROR_TYPE_DEBUG,
1410 "Enqueuing fragment with %u bytes\n", msg_len); 1413 "Enqueuing fragment with %u bytes\n", msg_len);
1414 frag_ctx->fragments_used ++;
1411 udpw = GNUNET_malloc (sizeof (struct UDP_MessageWrapper) + msg_len); 1415 udpw = GNUNET_malloc (sizeof (struct UDP_MessageWrapper) + msg_len);
1412 udpw->session = frag_ctx->session; 1416 udpw->session = frag_ctx->session;
1413 udpw->msg_buf = (char *) &udpw[1]; 1417 udpw->msg_buf = (char *) &udpw[1];
@@ -1538,13 +1542,18 @@ udp_plugin_send (void *cls,
1538 frag_ctx->frag = GNUNET_FRAGMENT_context_create (plugin->env->stats, 1542 frag_ctx->frag = GNUNET_FRAGMENT_context_create (plugin->env->stats,
1539 UDP_MTU, 1543 UDP_MTU,
1540 &plugin->tracker, 1544 &plugin->tracker,
1541 s->last_expected_delay, 1545 GNUNET_TIME_relative_max (s->last_expected_delay, GNUNET_TIME_UNIT_SECONDS),
1542 &udp->header, 1546 &udp->header,
1543 &enqueue_fragment, 1547 &enqueue_fragment,
1544 frag_ctx); 1548 frag_ctx);
1549
1550 frag_ctx->exp_delay = s->last_expected_delay;
1545 s->frag_ctx = frag_ctx; 1551 s->frag_ctx = frag_ctx;
1546 1552
1547 GNUNET_STATISTICS_update (plugin->env->stats, 1553 GNUNET_STATISTICS_update (plugin->env->stats,
1554 "# UDP, fragmented msgs, messages, pending",
1555 1, GNUNET_NO);
1556 GNUNET_STATISTICS_update (plugin->env->stats,
1548 "# UDP, fragmented msgs, messages, attempt", 1557 "# UDP, fragmented msgs, messages, attempt",
1549 1, GNUNET_NO); 1558 1, GNUNET_NO);
1550 GNUNET_STATISTICS_update (plugin->env->stats, 1559 GNUNET_STATISTICS_update (plugin->env->stats,
@@ -1963,7 +1972,15 @@ read_process_ack (struct Plugin *plugin,
1963 udpw = tmp; 1972 udpw = tmp;
1964 } 1973 }
1965 } 1974 }
1966 1975/*
1976 LOG (GNUNET_ERROR_TYPE_ERROR,
1977 "Fragmented message sent: fragments needed: %u , payload %u bytes, used on wire %u bytes, overhead: %f, expected delay: %llu\n",
1978 s->frag_ctx->fragments_used,
1979 s->frag_ctx->payload_size,
1980 s->frag_ctx->on_wire_size,
1981 ((float) s->frag_ctx->on_wire_size) / s->frag_ctx->payload_size,
1982 s->frag_ctx->exp_delay.rel_value);
1983*/
1967 dummy.msg_type = MSG_FRAGMENTED_COMPLETE; 1984 dummy.msg_type = MSG_FRAGMENTED_COMPLETE;
1968 dummy.msg_buf = NULL; 1985 dummy.msg_buf = NULL;
1969 dummy.msg_size = s->frag_ctx->on_wire_size; 1986 dummy.msg_size = s->frag_ctx->on_wire_size;
@@ -1971,6 +1988,10 @@ read_process_ack (struct Plugin *plugin,
1971 dummy.frag_ctx = s->frag_ctx; 1988 dummy.frag_ctx = s->frag_ctx;
1972 dummy.session = s; 1989 dummy.session = s;
1973 1990
1991 GNUNET_STATISTICS_update (plugin->env->stats,
1992 "# UDP, fragmented msgs, messages, pending",
1993 -1, GNUNET_NO);
1994
1974 call_continuation (&dummy, GNUNET_OK); 1995 call_continuation (&dummy, GNUNET_OK);
1975 1996
1976 GNUNET_free (s->frag_ctx); 1997 GNUNET_free (s->frag_ctx);