[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r31529 - gnunet/src/dv
From: |
gnunet |
Subject: |
[GNUnet-SVN] r31529 - gnunet/src/dv |
Date: |
Wed, 18 Dec 2013 14:43:40 +0100 |
Author: grothoff
Date: 2013-12-18 14:43:39 +0100 (Wed, 18 Dec 2013)
New Revision: 31529
Modified:
gnunet/src/dv/gnunet-service-dv.c
gnunet/src/dv/plugin_transport_dv.c
Log:
-more debugging, fixing targets
Modified: gnunet/src/dv/gnunet-service-dv.c
===================================================================
--- gnunet/src/dv/gnunet-service-dv.c 2013-12-18 13:43:19 UTC (rev 31528)
+++ gnunet/src/dv/gnunet-service-dv.c 2013-12-18 13:43:39 UTC (rev 31529)
@@ -651,8 +651,8 @@
* @param target where to send the message
* @param distance expected (remaining) distance to the target
* @param uid unique ID for the message
+ * @param sender original sender of the message
* @param actual_target ultimate recipient for the message
- * @param sender original sender of the message
* @param payload payload of the message
*/
static void
@@ -1758,16 +1758,27 @@
struct Route *route;
struct DirectNeighbor *neighbor;
uint32_t distance;
+ char me[5];
+ char src[5];
+ char prev[5];
+ char dst[5];
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Handling DV message from %s\n",
- GNUNET_i2s (peer));
if (ntohs (message->size) < sizeof (struct RouteMessage) + sizeof (struct
GNUNET_MessageHeader))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
rm = (const struct RouteMessage *) message;
+ strncpy (prev, GNUNET_i2s (peer), 4);
+ strncpy (me, GNUNET_i2s (&my_identity), 4);
+ strncpy (src, GNUNET_i2s (&rm->sender), 4);
+ strncpy (dst, GNUNET_i2s (&rm->target), 4);
+ prev[4] = me[4] = src[4] = dst[4] = '\0';
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Handling DV message from %s to %s routed by %s to me (%s)\n",
+ src, dst,
+ prev, me);
+
payload = (const struct GNUNET_MessageHeader *) &rm[1];
if (ntohs (message->size) != sizeof (struct RouteMessage) + ntohs
(payload->size))
{
@@ -1806,7 +1817,7 @@
if (NULL == route)
{
neighbor = GNUNET_CONTAINER_multipeermap_get (direct_neighbors,
- peer);
+ &rm->target);
if (NULL == neighbor)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1837,12 +1848,12 @@
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Forwarding message to %s\n",
- GNUNET_i2s (&rm->target));
+ GNUNET_i2s (&neighbor->peer));
forward_payload (neighbor,
distance,
0,
+ &rm->sender,
&rm->target,
- &rm->sender,
payload);
return GNUNET_OK;
}
@@ -1899,8 +1910,8 @@
forward_payload (route->next_hop,
ntohl (route->target.distance),
htonl (msg->uid),
+ &my_identity,
&msg->target,
- &my_identity,
payload);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
Modified: gnunet/src/dv/plugin_transport_dv.c
===================================================================
--- gnunet/src/dv/plugin_transport_dv.c 2013-12-18 13:43:19 UTC (rev 31528)
+++ gnunet/src/dv/plugin_transport_dv.c 2013-12-18 13:43:39 UTC (rev 31529)
@@ -329,9 +329,10 @@
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Creating new session %p for peer `%s'\n",
+ "Creating new DV session %p for peer `%s' at distance %u\n",
session,
- GNUNET_i2s (peer));
+ GNUNET_i2s (peer),
+ distance);
/* Notify transport and ats about new connection */
ats[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r31529 - gnunet/src/dv,
gnunet <=