aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-02-06 17:52:28 +0000
committerBart Polot <bart@net.in.tum.de>2014-02-06 17:52:28 +0000
commit82674594c523b7a328a21c37a007eb6f9b1bbad8 (patch)
tree8329aa13c229c6767a62774f7f38bd433c505f3f
parent955ca13213a17a22dfe1a9163b33126f46a687b3 (diff)
downloadgnunet-82674594c523b7a328a21c37a007eb6f9b1bbad8.tar.gz
gnunet-82674594c523b7a328a21c37a007eb6f9b1bbad8.zip
- log
-rw-r--r--src/mesh/gnunet-service-mesh_connection.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c
index abe4bd820..654abb529 100644
--- a/src/mesh/gnunet-service-mesh_connection.c
+++ b/src/mesh/gnunet-service-mesh_connection.c
@@ -673,21 +673,16 @@ get_prev_hop (const struct MeshConnection *c)
673{ 673{
674 GNUNET_PEER_Id id; 674 GNUNET_PEER_Id id;
675 675
676 LOG (GNUNET_ERROR_TYPE_DEBUG, " get prev hop %s [%u/%u]\n", 676 LOG (GNUNET_ERROR_TYPE_DEBUG, " get prev hop %s [%u/%u]\n",
677 GMC_2s (c), c->own_pos, c->path->length); 677 GMC_2s (c), c->own_pos, c->path->length);
678 if (0 == c->own_pos || c->path->length < 2) 678 if (0 == c->own_pos || c->path->length < 2)
679 {
680 LOG (GNUNET_ERROR_TYPE_DEBUG, " own pos is zero\n");
681 id = c->path->peers[0]; 679 id = c->path->peers[0];
682 }
683 else 680 else
684 {
685 LOG (GNUNET_ERROR_TYPE_DEBUG, " own pos is NOT zero\n");
686 id = c->path->peers[c->own_pos - 1]; 681 id = c->path->peers[c->own_pos - 1];
687 }
688 682
689 LOG (GNUNET_ERROR_TYPE_DEBUG, " id: %u\n", id); 683 LOG (GNUNET_ERROR_TYPE_DEBUG, " ID: %s (%u)\n",
690 LOG (GNUNET_ERROR_TYPE_DEBUG, " ID: %s\n", GNUNET_i2s (GNUNET_PEER_resolve2 (id))); 684 GNUNET_i2s (GNUNET_PEER_resolve2 (id)), id);
685
691 return GMP_get_short (id); 686 return GMP_get_short (id);
692} 687}
693 688
@@ -704,21 +699,15 @@ get_next_hop (const struct MeshConnection *c)
704{ 699{
705 GNUNET_PEER_Id id; 700 GNUNET_PEER_Id id;
706 701
707 LOG (GNUNET_ERROR_TYPE_DEBUG, " get next hop %s [%u/%u]\n", 702 LOG (GNUNET_ERROR_TYPE_DEBUG, " get next hop %s [%u/%u]\n",
708 GMC_2s (c), c->own_pos, c->path->length); 703 GMC_2s (c), c->own_pos, c->path->length);
709 if ((c->path->length - 1) == c->own_pos || c->path->length < 2) 704 if ((c->path->length - 1) == c->own_pos || c->path->length < 2)
710 {
711 LOG (GNUNET_ERROR_TYPE_DEBUG, " own pos is end\n");
712 id = c->path->peers[c->path->length - 1]; 705 id = c->path->peers[c->path->length - 1];
713 }
714 else 706 else
715 {
716 LOG (GNUNET_ERROR_TYPE_DEBUG, " own pos is NOT end\n");
717 id = c->path->peers[c->own_pos + 1]; 707 id = c->path->peers[c->own_pos + 1];
718 }
719 708
720 LOG (GNUNET_ERROR_TYPE_DEBUG, " id: %u\n", id); 709 LOG (GNUNET_ERROR_TYPE_DEBUG, " ID: %s (%u)\n",
721 LOG (GNUNET_ERROR_TYPE_DEBUG, " ID: %s\n", GNUNET_i2s (GNUNET_PEER_resolve2 (id))); 710 GNUNET_i2s (GNUNET_PEER_resolve2 (id)), id);
722 711
723 return GMP_get_short (id); 712 return GMP_get_short (id);
724} 713}