gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] 01/02: logging fixes, nicer comments


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 01/02: logging fixes, nicer comments
Date: Sat, 18 Feb 2017 19:00:22 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

commit 6fa8e1c652f447ebd94e144314ce55412dab80c8
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Feb 18 18:59:01 2017 +0100

    logging fixes, nicer comments
---
 src/util/client.c |  2 +-
 src/util/mq.c     | 17 +++++++----------
 src/util/mst.c    |  8 ++++----
 3 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/src/util/client.c b/src/util/client.c
index 1cf819f9d..06f6ebc32 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -879,4 +879,4 @@ GNUNET_CLIENT_connect (const struct 
GNUNET_CONFIGURATION_Handle *cfg,
   return cstate->mq;
 }
 
-/* end of client_new.c */
+/* end of client.c */
diff --git a/src/util/mq.c b/src/util/mq.c
index 265e4744b..43926ed64 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -368,6 +368,7 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq,
                                       ev);
     return;
   }
+  GNUNET_assert (NULL == mq->envelope_head);
   mq->current_envelope = ev;
   mq->send_impl (mq,
                 ev->mh,
@@ -960,20 +961,16 @@ GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev)
 
   if (mq->current_envelope == ev)
   {
-    // complex case, we already started with transmitting
-    // the message
+    /* complex case, we already started with transmitting
+       the message using the callbacks. */
     GNUNET_assert (0 < mq->queue_length);
     mq->queue_length--;
     mq->cancel_impl (mq,
                     mq->impl_state);
-    // continue sending the next message, if any
-    if (NULL == mq->envelope_head)
+    /* continue sending the next message, if any */
+    mq->current_envelope = mq->envelope_head;
+    if (NULL != mq->current_envelope)
     {
-      mq->current_envelope = NULL;
-    }
-    else
-    {
-      mq->current_envelope = mq->envelope_head;
       GNUNET_CONTAINER_DLL_remove (mq->envelope_head,
                                    mq->envelope_tail,
                                    mq->current_envelope);
@@ -984,7 +981,7 @@ GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev)
   }
   else
   {
-    // simple case, message is still waiting in the queue
+    /* simple case, message is still waiting in the queue */
     GNUNET_CONTAINER_DLL_remove (mq->envelope_head,
                                 mq->envelope_tail,
                                 ev);
diff --git a/src/util/mst.c b/src/util/mst.c
index 82a21b880..1422c248e 100644
--- a/src/util/mst.c
+++ b/src/util/mst.c
@@ -130,7 +130,7 @@ GNUNET_MST_from_buffer (struct 
GNUNET_MessageStreamTokenizer *mst,
   GNUNET_assert (mst->off <= mst->pos);
   GNUNET_assert (mst->pos <= mst->curr_buf);
   LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "Server-mst receives %u bytes with %u bytes already in private 
buffer\n",
+       "MST receives %u bytes with %u bytes already in private buffer\n",
        (unsigned int) size,
        (unsigned int) (mst->pos - mst->off));
   ret = GNUNET_OK;
@@ -151,7 +151,7 @@ do_align:
     }
     if (mst->pos - mst->off < sizeof (struct GNUNET_MessageHeader))
     {
-      delta 
+      delta
        = GNUNET_MIN (sizeof (struct GNUNET_MessageHeader)
                      - (mst->pos - mst->off),
                      size);
@@ -229,8 +229,8 @@ do_align:
     if (one_shot == GNUNET_YES)
       one_shot = GNUNET_SYSERR;
     mst->off += want;
-    if (GNUNET_SYSERR == mst->cb (mst->cb_cls,
-                                  hdr))
+  if (GNUNET_SYSERR == mst->cb (mst->cb_cls,
+                                hdr))
       return GNUNET_SYSERR;
     if (mst->off == mst->pos)
     {

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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