gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r29331 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r29331 - gnunet/src/transport
Date: Mon, 16 Sep 2013 18:31:25 +0200

Author: wachs
Date: 2013-09-16 18:31:25 +0200 (Mon, 16 Sep 2013)
New Revision: 29331

Modified:
   gnunet/src/transport/plugin_transport_udp.c
Log:
fix: upd has to use the session with fragmentation context when receiving ACKs


Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2013-09-16 16:05:58 UTC (rev 
29330)
+++ gnunet/src/transport/plugin_transport_udp.c 2013-09-16 16:31:25 UTC (rev 
29331)
@@ -2126,11 +2126,13 @@
 
 struct LookupContext
 {
+  struct Session *res;
+
   const struct sockaddr * addr;
 
-  struct Session *res;
+  size_t addrlen;
 
-  size_t addrlen;
+  int must_have_frag_ctx;
 };
 
 
@@ -2140,11 +2142,21 @@
   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 @@
   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 @@
   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",




reply via email to

[Prev in Thread] Current Thread [Next in Thread]