From 8c5d59c31845c9bc333d46128f30b6b099d51c83 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 7 Apr 2014 12:00:43 +0000 Subject: [PATCH] log --- src/mesh/gnunet-service-mesh_channel.c | 8 +++++--- src/mesh/gnunet-service-mesh_connection.c | 8 +++++--- src/mesh/gnunet-service-mesh_peer.c | 10 +++++----- src/mesh/gnunet-service-mesh_tunnel.c | 8 +++++--- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/mesh/gnunet-service-mesh_channel.c b/src/mesh/gnunet-service-mesh_channel.c index b2330c592..206165487 100644 --- a/src/mesh/gnunet-service-mesh_channel.c +++ b/src/mesh/gnunet-service-mesh_channel.c @@ -733,6 +733,9 @@ ch_message_sent (void *cls, struct MeshReliableMessage *copy = chq->copy; struct MeshChannelReliability *rel; + LOG (GNUNET_ERROR_TYPE_DEBUG, "channel message sent callback %s\n", + GM_m2s (chq->type)); + switch (chq->type) { case GNUNET_MESSAGE_TYPE_MESH_DATA: @@ -837,8 +840,7 @@ send_ack (struct MeshChannel *ch, int fwd, int reaction) msg.header.size = htons (sizeof (msg)); msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_CHANNEL_ACK); - LOG (GNUNET_ERROR_TYPE_DEBUG, - " sending channel %s ack for channel %s\n", + LOG (GNUNET_ERROR_TYPE_DEBUG, " sending channel %s ack for channel %s\n", GM_f2s (fwd), GMCH_2s (ch)); msg.chid = htonl (ch->gid); @@ -2267,7 +2269,7 @@ GMCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message, payload = (struct GNUNET_MESH_Data *) message; LOG (GNUNET_ERROR_TYPE_INFO, "=> %s %u\n", - GM_m2s (type), ntohl(payload->mid)); + GM_m2s (type), ntohl (payload->mid)); if (GNUNET_YES == ch->reliable) { chq = GNUNET_new (struct MeshChannelQueue); diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index 5d1a32a44..a85cc84dd 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c @@ -575,16 +575,18 @@ message_sent (void *cls, double usecsperbyte; int forced; + LOG (GNUNET_ERROR_TYPE_DEBUG, "connection message_sent\n"); + fc = fwd ? &c->fwd_fc : &c->bck_fc; - LOG (GNUNET_ERROR_TYPE_DEBUG, "! %ssent %s %s\n", + LOG (GNUNET_ERROR_TYPE_DEBUG, " %ssent %s %s\n", sent ? "" : "not ", GM_f2s (fwd), GM_m2s (type)); - LOG (GNUNET_ERROR_TYPE_DEBUG, "! C_P- %p %u\n", c, c->pending_messages); + LOG (GNUNET_ERROR_TYPE_DEBUG, " C_P- %p %u\n", c, c->pending_messages); if (NULL != q) { forced = q->forced; if (NULL != q->cont) { - LOG (GNUNET_ERROR_TYPE_DEBUG, "! calling cont\n"); + LOG (GNUNET_ERROR_TYPE_DEBUG, " calling cont\n"); q->cont (q->cont_cls, c, q, type, fwd, size); } GNUNET_free (q); diff --git a/src/mesh/gnunet-service-mesh_peer.c b/src/mesh/gnunet-service-mesh_peer.c index 089b0da95..25962b618 100644 --- a/src/mesh/gnunet-service-mesh_peer.c +++ b/src/mesh/gnunet-service-mesh_peer.c @@ -1004,8 +1004,8 @@ GMP_queue_destroy (struct MeshPeerQueue *queue, int clear_cls, int sent) if (GNUNET_YES == clear_cls) { - LOG (GNUNET_ERROR_TYPE_DEBUG, "# queue destroy type %s\n", - GM_m2s (queue->type)); + LOG (GNUNET_ERROR_TYPE_DEBUG, "queue destroy type %s\n", + GM_m2s (queue->type)); switch (queue->type) { case GNUNET_MESSAGE_TYPE_MESH_CONNECTION_DESTROY: @@ -1024,8 +1024,8 @@ GMP_queue_destroy (struct MeshPeerQueue *queue, int clear_cls, int sent) default: GNUNET_break (0); - LOG (GNUNET_ERROR_TYPE_ERROR, "# type %s unknown!\n", - GM_m2s (queue->type)); + LOG (GNUNET_ERROR_TYPE_ERROR, " type %s unknown!\n", + GM_m2s (queue->type)); } } GNUNET_CONTAINER_DLL_remove (peer->queue_head, peer->queue_tail, queue); @@ -1038,7 +1038,7 @@ GMP_queue_destroy (struct MeshPeerQueue *queue, int clear_cls, int sent) if (NULL != queue->callback) { - LOG (GNUNET_ERROR_TYPE_DEBUG, "# Calling callback\n"); + LOG (GNUNET_ERROR_TYPE_DEBUG, " calling callback\n"); queue->callback (queue->callback_cls, queue->c, sent, queue->type, queue->fwd, queue->size, diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c index 6a86ad2d6..af9dc5385 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.c +++ b/src/mesh/gnunet-service-mesh_tunnel.c @@ -688,13 +688,15 @@ tunnel_get_connection (struct MeshTunnel3 *t) * @param size Size of the message. */ static void -message_sent (void *cls, +tun_message_sent (void *cls, struct MeshConnection *c, struct MeshConnectionQueue *q, uint16_t type, int fwd, size_t size) { struct MeshTunnel3Queue *qt = cls; + LOG (GNUNET_ERROR_TYPE_DEBUG, "tun_message_sent\n"); + GNUNET_assert (NULL != qt->cont); qt->cont (qt->cont_cls, GMC_get_tunnel (c), qt, type, size); GNUNET_free (qt); @@ -883,7 +885,7 @@ send_prebuilt_message (const struct GNUNET_MessageHeader *message, tq->tqd = NULL; } tq->cq = GMC_send_prebuilt_message (&msg->header, c, fwd, force, - &message_sent, tq); + &tun_message_sent, tq); tq->cont = cont; tq->cont_cls = cont_cls; @@ -2596,7 +2598,7 @@ GMT_cancel (struct MeshTunnel3Queue *q) if (NULL != q->cq) { GMC_cancel (q->cq); - /* message_sent() will be called and free q */ + /* tun_message_sent() will be called and free q */ } else if (NULL != q->tqd) { -- 2.25.1