[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r31591 - gnunet/src/mesh
From: |
gnunet |
Subject: |
[GNUnet-SVN] r31591 - gnunet/src/mesh |
Date: |
Fri, 20 Dec 2013 05:17:08 +0100 |
Author: bartpolot
Date: 2013-12-20 05:17:08 +0100 (Fri, 20 Dec 2013)
New Revision: 31591
Modified:
gnunet/src/mesh/gnunet-mesh.c
gnunet/src/mesh/gnunet-service-mesh_connection.c
gnunet/src/mesh/mesh_api.c
Log:
- debug
Modified: gnunet/src/mesh/gnunet-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-mesh.c 2013-12-20 03:20:11 UTC (rev 31590)
+++ gnunet/src/mesh/gnunet-mesh.c 2013-12-20 04:17:08 UTC (rev 31591)
@@ -179,6 +179,12 @@
data_size = read (0, buf, 60000);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "stdio read %u bytes\n", data_size);
+ {
+ struct GNUNET_HashCode hash;
+ GNUNET_CRYPTO_hash (buf, data_size, &hash);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " hash SEND %s (%u)\n",
+ GNUNET_h2s_full (&hash), data_size);
+ }
if (data_size < 1)
{
GNUNET_SCHEDULER_shutdown();
@@ -334,7 +340,17 @@
len = ntohs (message->size) - sizeof (*message);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got %u bytes\n", len);
- write (1, (char *) &message[1], len);
+ GNUNET_BIO_write (1, (char *) &message[1], len);
+ {
+ struct GNUNET_HashCode hash;
+
+ GNUNET_CRYPTO_hash (message, ntohs (message->size), &hash);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " api hash RECV %s (%u)\n",
+ GNUNET_h2s_full (&hash), ntohs (message->size));
+ GNUNET_CRYPTO_hash (&message[1], len, &hash);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " hash RECV %s (%u)\n",
+ GNUNET_h2s_full (&hash), len);
+ }
return GNUNET_OK;
}
Modified: gnunet/src/mesh/gnunet-service-mesh_connection.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_connection.c 2013-12-20 03:20:11 UTC
(rev 31590)
+++ gnunet/src/mesh/gnunet-service-mesh_connection.c 2013-12-20 04:17:08 UTC
(rev 31591)
@@ -1652,6 +1652,7 @@
fwd = is_fwd (c, id);
if (GMC_is_terminal (c, fwd))
{
+ path_invalidate (c->path);
if (0 < c->pending_messages)
c->destroy = GNUNET_YES;
else
Modified: gnunet/src/mesh/mesh_api.c
===================================================================
--- gnunet/src/mesh/mesh_api.c 2013-12-20 03:20:11 UTC (rev 31590)
+++ gnunet/src/mesh/mesh_api.c 2013-12-20 04:17:08 UTC (rev 31591)
@@ -832,6 +832,8 @@
const struct GNUNET_MESH_MessageHandler *handler;
struct GNUNET_MESH_LocalData *dmsg;
struct GNUNET_MESH_Channel *ch;
+ struct GNUNET_HashCode hash;
+ size_t size;
unsigned int i;
uint16_t type;
@@ -842,7 +844,10 @@
LOG (GNUNET_ERROR_TYPE_DEBUG, " %s data on channel %s [%X]\n",
GM_f2s (ch->chid >= GNUNET_MESH_LOCAL_CHANNEL_ID_SERV),
GNUNET_i2s (GNUNET_PEER_resolve2 (ch->peer)), ntohl (dmsg->id));
- LOG (GNUNET_ERROR_TYPE_DEBUG, " %u bytes\n", ntohs (message->size));
+
+ size = ntohs (message->size);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " %u bytes\n", size);
+
if (NULL == ch)
{
/* Channel was ignored/destroyed, probably service didn't get it yet */
@@ -850,6 +855,7 @@
return;
}
type = ntohs (payload->type);
+ size = ntohs (payload->size);
LOG (GNUNET_ERROR_TYPE_DEBUG, " payload type %u\n", type);
for (i = 0; i < h->n_handlers; i++)
{
@@ -859,6 +865,9 @@
handler->type);
if (handler->type == type)
{
+ GNUNET_CRYPTO_hash (payload, size, &hash);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " hash recv %s (%u)\n",
+ GNUNET_h2s_full (&hash), size);
if (GNUNET_OK !=
handler->callback (h->cls, ch, &ch->ctx, payload))
{
@@ -1124,6 +1133,12 @@
psize = th->notify (th->notify_cls,
size - sizeof (struct GNUNET_MESH_LocalData),
mh);
+ {
+ struct GNUNET_HashCode hash;
+ GNUNET_CRYPTO_hash (mh, psize, &hash);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "# hash send %s (%u)\n",
+ GNUNET_h2s_full (&hash), psize);
+ }
if (psize > 0)
{
psize += sizeof (struct GNUNET_MESH_LocalData);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r31591 - gnunet/src/mesh,
gnunet <=