aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-02-18 18:59:01 +0100
committerChristian Grothoff <christian@grothoff.org>2017-02-18 19:00:18 +0100
commit6fa8e1c652f447ebd94e144314ce55412dab80c8 (patch)
tree14fb8d9a5f221d106ae8e2b2244aa859a7a7314e /src
parent0af32e03677ab1c8a819b376c8fa026d0ffa9144 (diff)
logging fixes, nicer comments
Diffstat (limited to 'src')
-rw-r--r--src/util/client.c2
-rw-r--r--src/util/mq.c17
-rw-r--r--src/util/mst.c8
3 files changed, 12 insertions, 15 deletions
diff --git a/src/util/client.c b/src/util/client.c
index 1cf819f9df..06f6ebc329 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 265e4744ba..43926ed649 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 82a21b8800..1422c248e2 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)
{