gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r21430 - gnunet/src/transport
Date: Fri, 11 May 2012 00:09:36 +0200

Author: grothoff
Date: 2012-05-11 00:09:36 +0200 (Fri, 11 May 2012)
New Revision: 21430

Modified:
   gnunet/src/transport/plugin_transport_udp.c
Log:
-trying to fix #2342

Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2012-05-10 21:26:09 UTC (rev 
21429)
+++ gnunet/src/transport/plugin_transport_udp.c 2012-05-10 22:09:36 UTC (rev 
21430)
@@ -963,7 +963,27 @@
     GNUNET_CONTAINER_DLL_insert(plugin->ipv6_queue_head, 
plugin->ipv6_queue_tail, udpw);
 }
 
+
 /**
+ * Fragment message was transmitted via UDP, let fragmentation know
+ * to send the next fragment now.
+ *
+ * @param cls the 'struct UDPMessageWrapper' of the fragment
+ * @param target destination peer (ignored)
+ * @param result GNUNET_OK on success (ignored)
+ */
+static void
+send_next_fragment (void *cls,
+                   const struct GNUNET_PeerIdentity *target,
+                   int result)
+{
+  struct UDPMessageWrapper *udpw = cls;
+
+  GNUNET_FRAGMENT_context_transmission_done (udpw->frag_ctx->frag);  
+}
+
+
+/**
  * Function that is called with messages created by the fragmentation
  * module.  In the case of the 'proc' callback of the
  * GNUNET_FRAGMENT_context_create function, this function must
@@ -992,8 +1012,8 @@
   udpw->udp = (char *) &udpw[1];
 
   udpw->msg_size = msg_len;
-  udpw->cont = frag_ctx->cont;
-  udpw->cont_cls = frag_ctx->cont_cls;
+  udpw->cont = &send_next_fragment;
+  udpw->cont_cls = udpw;
   udpw->timeout = frag_ctx->timeout;
   udpw->frag_ctx = frag_ctx;
   memcpy (udpw->udp, msg, msg_len);
@@ -1850,15 +1870,8 @@
          "UDP transmitted %u-byte message to `%s' (%d: %s)\n",
          (unsigned int) (udpw->msg_size), GNUNET_a2s (sa, slen), (int) sent,
          (sent < 0) ? STRERROR (errno) : "ok");
+    call_continuation(udpw, GNUNET_OK);
   }
-  /* This was just a message fragment */
-  if (udpw->frag_ctx != NULL)
-  {
-    GNUNET_FRAGMENT_context_transmission_done (udpw->frag_ctx->frag);
-  }
-  /* This was a complete message*/
-  else
-    call_continuation(udpw, GNUNET_OK);
 
   if (sock == plugin->sockv4)
     GNUNET_CONTAINER_DLL_remove(plugin->ipv4_queue_head, 
plugin->ipv4_queue_tail, udpw);




reply via email to

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