gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r30746 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r30746 - gnunet/src/mesh
Date: Sat, 16 Nov 2013 18:24:20 +0100

Author: grothoff
Date: 2013-11-16 18:24:20 +0100 (Sat, 16 Nov 2013)
New Revision: 30746

Modified:
   gnunet/src/mesh/mesh_api.c
Log:
-only notify AFTER sending is really close to finished, not before

Modified: gnunet/src/mesh/mesh_api.c
===================================================================
--- gnunet/src/mesh/mesh_api.c  2013-11-16 17:13:37 UTC (rev 30745)
+++ gnunet/src/mesh/mesh_api.c  2013-11-16 17:24:20 UTC (rev 30746)
@@ -971,15 +971,15 @@
 //                      const struct GNUNET_MessageHeader *message)
 // {
 //   struct GNUNET_MESH_LocalMonitor *msg;
-// 
+//
 //   GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Get Channels messasge received\n");
-// 
+//
 //   if (NULL == h->channels_cb)
 //   {
 //     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "  ignored\n");
 //     return;
 //   }
-// 
+//
 //   msg = (struct GNUNET_MESH_LocalMonitor *) message;
 //   if (ntohs (message->size) !=
 //       (sizeof (struct GNUNET_MESH_LocalMonitor) +
@@ -1012,15 +1012,15 @@
 // {
 //   struct GNUNET_MESH_LocalMonitor *msg;
 //   size_t esize;
-// 
+//
 //   GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Show Channel messasge received\n");
-// 
+//
 //   if (NULL == h->channel_cb)
 //   {
 //     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "  ignored\n");
 //     return;
 //   }
-// 
+//
 //   /* Verify message sanity */
 //   msg = (struct GNUNET_MESH_LocalMonitor *) message;
 //   esize = sizeof (struct GNUNET_MESH_LocalMonitor);
@@ -1031,14 +1031,14 @@
 //                 "Show channel message: size %hu - expected %u\n",
 //                 ntohs (message->size),
 //                 esize);
-// 
+//
 //     h->channel_cb (h->channel_cls, NULL, NULL);
 //     h->channel_cb = NULL;
 //     h->channel_cls = NULL;
-// 
+//
 //     return;
 //   }
-// 
+//
 //   h->channel_cb (h->channel_cls,
 //                  &msg->destination,
 //                  &msg->owner);
@@ -1591,6 +1591,7 @@
   }
 }
 
+
 void
 GNUNET_MESH_receive_done (struct GNUNET_MESH_Channel *channel)
 {
@@ -1625,8 +1626,6 @@
   send_packet (h, &msg, NULL);
   h->channels_cb = callback;
   h->channels_cls = callback_cls;
-
-  return;
 }
 
 
@@ -1678,8 +1677,6 @@
   send_packet (h, &msg.header, NULL);
   h->channel_cb = callback;
   h->channel_cls = callback_cls;
-
-  return;
 }
 
 
@@ -1713,6 +1710,7 @@
   GNUNET_assert (msize <= size);
   memcpy (buf, msg, msize);
   GNUNET_MQ_impl_send_continue (mq);
+  GNUNET_MQ_impl_send_commit (mq);
   return msize;
 }
 
@@ -1732,7 +1730,6 @@
   struct MeshMQState *state = impl_state;
 
   GNUNET_assert (NULL == state->th);
-  GNUNET_MQ_impl_send_commit (mq);
   state->th =
       GNUNET_MESH_notify_transmit_ready (state->channel,
                                          /* FIXME: add option for corking */




reply via email to

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