diff options
author | bartpolot <bartpolot@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-12-10 12:50:48 +0000 |
---|---|---|
committer | bartpolot <bartpolot@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-12-10 12:50:48 +0000 |
commit | e2e32002afa4d5a450261f23f7e9a70fc9d559c3 (patch) | |
tree | 13d4ced5a57787a9de084bb758d56389692e93e9 | |
parent | 9da9a86327c7b1566e51eebc91ac5fc37d8ad20c (diff) |
- handle errors more gracefully, be more verbose for debug
git-svn-id: https://gnunet.org/svn/gnunet@25350 140774ce-b5e7-0310-ab8b-a85725594a96
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 6bd5f4372d..a31ffbd292 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -5955,6 +5955,7 @@ handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer, struct MeshPeerInfo *peer_info; struct MeshTunnel *t; struct MeshTunnelChildInfo *cinfo; + GNUNET_PEER_Id predecessor; size_t size; uint32_t pid; @@ -6034,7 +6035,24 @@ handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer, GNUNET_break (0); return GNUNET_OK; } - GNUNET_PEER_resolve (tree_get_predecessor (t->tree), &id); + predecessor = tree_get_predecessor (t->tree); + if (0 == predecessor) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "unknown to origin at %s\n", + GNUNET_i2s (&my_full_id)); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "from peer %s\n", + GNUNET_i2s (peer)); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "for tunnel %s [%X]\n", + GNUNET_i2s (&msg->oid), ntohl(msg->tid)); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "current tree:\n"); + tree_debug (t->tree); + return GNUNET_OK; + } + GNUNET_PEER_resolve (predecessor, &id); send_prebuilt_message (message, &id, t); GNUNET_STATISTICS_update (stats, "# to origin forwarded", 1, GNUNET_NO); |