aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-03-17 11:02:54 +0000
committerBart Polot <bart@net.in.tum.de>2014-03-17 11:02:54 +0000
commit6e1fa63832742e5b1a5480f97f4ebf3654996b9a (patch)
tree4bfa3c9fd34aeac25bb36491bdc8ac670577e672 /src
parentd8824219557a50f5a7343b172b5727e3505402e6 (diff)
downloadgnunet-6e1fa63832742e5b1a5480f97f4ebf3654996b9a.tar.gz
gnunet-6e1fa63832742e5b1a5480f97f4ebf3654996b9a.zip
- debug log
Diffstat (limited to 'src')
-rw-r--r--src/mesh/gnunet-service-mesh_peer.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/mesh/gnunet-service-mesh_peer.c b/src/mesh/gnunet-service-mesh_peer.c
index f1a3cf5d0..99e36ec61 100644
--- a/src/mesh/gnunet-service-mesh_peer.c
+++ b/src/mesh/gnunet-service-mesh_peer.c
@@ -276,18 +276,19 @@ core_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
276{ 276{
277 struct MeshPeer *mp; 277 struct MeshPeer *mp;
278 struct MeshPeerPath *path; 278 struct MeshPeerPath *path;
279 char own_id[16];
279 280
280 LOG (GNUNET_ERROR_TYPE_DEBUG, "Peer connected\n"); 281 strncpy (own_id, GNUNET_i2s (&my_full_id), 15);
281 LOG (GNUNET_ERROR_TYPE_DEBUG, " %s\n", GNUNET_i2s (&my_full_id));
282 mp = GMP_get (peer); 282 mp = GMP_get (peer);
283 if (myid == mp->id) 283 if (myid == mp->id)
284 { 284 {
285 LOG (GNUNET_ERROR_TYPE_DEBUG, " (self)\n"); 285 LOG (GNUNET_ERROR_TYPE_INFO, "CONNECTED %s (self)\n", own_id);
286 path = path_new (1); 286 path = path_new (1);
287 } 287 }
288 else 288 else
289 { 289 {
290 LOG (GNUNET_ERROR_TYPE_DEBUG, " %s\n", GNUNET_i2s (peer)); 290 LOG (GNUNET_ERROR_TYPE_DEBUG, "CONNECTED %s <= %s\n",
291 own_id, GNUNET_i2s (peer));
291 path = path_new (2); 292 path = path_new (2);
292 path->peers[1] = mp->id; 293 path->peers[1] = mp->id;
293 GNUNET_PEER_change_rc (mp->id, 1); 294 GNUNET_PEER_change_rc (mp->id, 1);
@@ -313,8 +314,9 @@ core_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
313{ 314{
314 struct MeshPeer *p; 315 struct MeshPeer *p;
315 struct MeshPeerPath *direct_path; 316 struct MeshPeerPath *direct_path;
317 char own_id[16];
316 318
317 LOG (GNUNET_ERROR_TYPE_DEBUG, "Peer disconnected\n"); 319 strncpy (own_id, GNUNET_i2s (&my_full_id), 15);
318 p = GNUNET_CONTAINER_multipeermap_get (peers, peer); 320 p = GNUNET_CONTAINER_multipeermap_get (peers, peer);
319 if (NULL == p) 321 if (NULL == p)
320 { 322 {
@@ -322,10 +324,10 @@ core_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
322 return; 324 return;
323 } 325 }
324 if (myid == p->id) 326 if (myid == p->id)
325 LOG (GNUNET_ERROR_TYPE_DEBUG, " (self: %s)\n", GMP_2s (p)); 327 LOG (GNUNET_ERROR_TYPE_INFO, "DISCONNECTED %s (self)\n", own_id);
326 else 328 else
327 LOG (GNUNET_ERROR_TYPE_DEBUG, " %s\n", GMP_2s (p)); 329 LOG (GNUNET_ERROR_TYPE_DEBUG, "DISCONNECTED %s <= %s\n",
328 330 own_id, GNUNET_i2s (peer));
329 direct_path = pop_direct_path (p); 331 direct_path = pop_direct_path (p);
330 GNUNET_CONTAINER_multihashmap_iterate (p->connections, &notify_broken, p); 332 GNUNET_CONTAINER_multihashmap_iterate (p->connections, &notify_broken, p);
331 GNUNET_CONTAINER_multihashmap_destroy (p->connections); 333 GNUNET_CONTAINER_multihashmap_destroy (p->connections);