gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: - added debug information


From: gnunet
Subject: [gnunet] branch master updated: - added debug information
Date: Mon, 25 Apr 2022 17:38:45 +0200

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

t3sserakt pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new b35022d6d - added debug information
b35022d6d is described below

commit b35022d6d82b62605ebbcb7db565371af720552f
Author: t3sserakt <t3ss@posteo.de>
AuthorDate: Mon Apr 25 17:38:31 2022 +0200

    - added debug information
---
 src/util/client.c | 10 ++++++----
 src/util/mst.c    | 19 +++++++++++++------
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/src/util/client.c b/src/util/client.c
index 4e5eca32a..9950c9e2f 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -261,12 +261,13 @@ transmit_ready (void *cls)
   len = ntohs (cstate->msg->size);
   GNUNET_assert (cstate->msg_off < len);
   LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "message of type %u trying to send with socket %p (MQ: %p\n",
+       "message of type %u and size %u trying to send with socket %p (MQ: 
%p\n",
        ntohs (cstate->msg->type),
+       ntohs (cstate->msg->size),
        cstate->sock,
        cstate->mq);
 
-RETRY:
+  RETRY:
   ret = GNUNET_NETWORK_socket_send (cstate->sock,
                                     &pos[cstate->msg_off],
                                     len - cstate->msg_off);
@@ -311,8 +312,9 @@ RETRY:
     return;
   }
   LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "sending message of type %u successful\n",
-       ntohs (cstate->msg->type));
+       "sending message of type %u and size %u successful\n",
+       ntohs (cstate->msg->type),
+       ntohs (cstate->msg->size));
   cstate->msg = NULL;
   GNUNET_MQ_impl_send_continue (cstate->mq);
 }
diff --git a/src/util/mst.c b/src/util/mst.c
index 13835ffd0..2236f2883 100644
--- a/src/util/mst.c
+++ b/src/util/mst.c
@@ -129,14 +129,16 @@ 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,
-       "MST receives %u bytes with %u bytes already in private buffer\n",
+       "MST receives %u bytes with %u (%u/%u) bytes already in private 
buffer\n",
        (unsigned int) size,
-       (unsigned int) (mst->pos - mst->off));
+       (unsigned int) (mst->pos - mst->off),
+       (unsigned int) mst->pos,
+       (unsigned int) mst->off);
   ret = GNUNET_OK;
   ibuf = (char *) mst->hdr;
   while (mst->pos > 0)
   {
-do_align:
+    do_align:
     GNUNET_assert (mst->pos >= mst->off);
     if ((mst->curr_buf - mst->off < sizeof(struct GNUNET_MessageHeader)) ||
         (0 != (mst->off % ALIGN_FACTOR)))
@@ -172,6 +174,9 @@ do_align:
     }
     hdr = (const struct GNUNET_MessageHeader *) &ibuf[mst->off];
     want = ntohs (hdr->size);
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+         "We want to read message of size %u\n",
+         want);
     if (want < sizeof(struct GNUNET_MessageHeader))
     {
       GNUNET_break_op (0);
@@ -299,7 +304,7 @@ do_align:
       goto do_align;
     }
   }
-copy:
+  copy:
   if ((size > 0) && (! purge))
   {
     if (size + mst->pos > mst->curr_buf)
@@ -321,8 +326,10 @@ copy:
     mst->pos = 0;
   }
   LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "Server-mst leaves %u bytes in private buffer\n",
-       (unsigned int) (mst->pos - mst->off));
+       "Server-mst leaves %u (%u/%u) bytes in private buffer\n",
+       (unsigned int) (mst->pos - mst->off),
+       (unsigned int) mst->pos,
+       (unsigned int) mst->off);
   return ret;
 }
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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