aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-09-16 16:31:25 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-09-16 16:31:25 +0000
commit5fd4317460e74a023998bca6e1b2edec532f1eba (patch)
treea19add1d2f7b00e2665fcf3432fdbcd4e82d6630 /src/transport
parent6ea3d4aca0abfd35bfba6759c1655cbac057b68f (diff)
fix: upd has to use the session with fragmentation context when receiving ACKs
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/plugin_transport_udp.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index 25760255b3..bc64fd5d25 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -2126,11 +2126,13 @@ fragment_msg_proc (void *cls, const struct GNUNET_MessageHeader *msg)
struct LookupContext
{
- const struct sockaddr * addr;
-
struct Session *res;
+ const struct sockaddr * addr;
+
size_t addrlen;
+
+ int must_have_frag_ctx;
};
@@ -2140,11 +2142,21 @@ lookup_session_by_addr_it (void *cls, const struct GNUNET_HashCode * key, void *
struct LookupContext *l_ctx = cls;
struct Session * s = value;
+ if ((GNUNET_YES == l_ctx->must_have_frag_ctx) && (NULL == s->frag_ctx))
+ return GNUNET_YES;
+
+ /*
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Comparing session: have %s %s %p<-> want %s\n",
+ GNUNET_a2s(s->sock_addr, s->addrlen),
+ (GNUNET_YES == s->inbound) ? "inbound" : "outbound",
+ s->frag_ctx,
+ GNUNET_a2s(l_ctx->addr, l_ctx->addrlen));
+ */
if ((s->addrlen == l_ctx->addrlen) &&
(0 == memcmp (s->sock_addr, l_ctx->addr, s->addrlen)))
{
l_ctx->res = s;
- return GNUNET_NO;
+ return GNUNET_YES;
}
return GNUNET_YES;
}
@@ -2171,6 +2183,7 @@ ack_proc (void *cls, uint32_t id, const struct GNUNET_MessageHeader *msg)
l_ctx.addr = rc->src_addr;
l_ctx.addrlen = rc->addr_len;
l_ctx.res = NULL;
+ l_ctx.must_have_frag_ctx = GNUNET_NO;
GNUNET_CONTAINER_multihashmap_iterate (rc->plugin->sessions,
&lookup_session_by_addr_it,
&l_ctx);
@@ -2245,16 +2258,17 @@ read_process_ack (struct Plugin *plugin,
l_ctx.addr = (const struct sockaddr *) addr;
l_ctx.addrlen = fromlen;
l_ctx.res = NULL;
+ l_ctx.must_have_frag_ctx = GNUNET_YES;
GNUNET_CONTAINER_multihashmap_iterate (plugin->sessions,
&lookup_session_by_addr_it,
&l_ctx);
s = l_ctx.res;
-
if ((NULL == s) || (NULL == s->frag_ctx))
{
return;
}
+
flow_delay.rel_value_us = (uint64_t) ntohl (udp_ack->delay);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"We received a sending delay of %s\n",