[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r33809 - gnunet/src/cadet
From: |
gnunet |
Subject: |
[GNUnet-SVN] r33809 - gnunet/src/cadet |
Date: |
Tue, 24 Jun 2014 03:54:12 +0200 |
Author: bartpolot
Date: 2014-06-24 03:54:12 +0200 (Tue, 24 Jun 2014)
New Revision: 33809
Modified:
gnunet/src/cadet/gnunet-service-cadet_local.c
gnunet/src/cadet/gnunet-service-cadet_peer.c
gnunet/src/cadet/gnunet-service-cadet_peer.h
Log:
- add a peer debug function
Modified: gnunet/src/cadet/gnunet-service-cadet_local.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_local.c 2014-06-23 21:48:38 UTC
(rev 33808)
+++ gnunet/src/cadet/gnunet-service-cadet_local.c 2014-06-24 01:54:12 UTC
(rev 33809)
@@ -630,8 +630,7 @@
struct CadetPeer *p = value;
struct CadetTunnel *t;
- LOG (GNUNET_ERROR_TYPE_ERROR, "Peer %s\n", GCP_2s (p));
- LOG (GNUNET_ERROR_TYPE_ERROR, " %u paths\n", GCP_count_paths (p));
+ GCP_debug (p, GNUNET_ERROR_TYPE_ERROR);
t = GCP_get_tunnel (p);
if (NULL != t)
Modified: gnunet/src/cadet/gnunet-service-cadet_peer.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_peer.c 2014-06-23 21:48:38 UTC
(rev 33808)
+++ gnunet/src/cadet/gnunet-service-cadet_peer.c 2014-06-24 01:54:12 UTC
(rev 33809)
@@ -2224,3 +2224,46 @@
return "(NULL)";
return GNUNET_i2s (GNUNET_PEER_resolve2 (peer->id));
}
+
+
+/**
+ * Log all kinds of info about a peer.
+ *
+ * @param peer Peer.
+ */
+void
+GCP_debug (const struct CadetPeer *p, enum GNUNET_ErrorType level)
+{
+ struct CadetPeerPath *path;
+ struct CadetPeerQueue *q;
+ unsigned int conns;
+
+ if (NULL == p)
+ {
+ LOG (level, "PPP DEBUG PEER NULL\n");
+ return;
+ }
+
+ LOG (level, "PPP DEBUG PEER %s\n", GCP_2s (p));
+ for (path = p->path_head; NULL != path; path = path->next)
+ {
+ char *s;
+
+ s = path_2s (path);
+ LOG (level, "PPP path: %s\n", s);
+ GNUNET_free (s);
+ }
+
+ LOG (level, "PPP core transmit handle %p\n", p->core_transmit);
+ conns = GNUNET_CONTAINER_multihashmap_size (p->connections);
+ LOG (level, "PPP # connections over link to peer: %u\n", conns);
+ LOG (level, "PPP queue length: %u\n", p->queue_n);
+ for (q = p->queue_head; NULL != q; q = q->next)
+ {
+ LOG (level, "PPP - %s [payload %s, %u] on connection %s, %u bytes\n",
+ GC_m2s (q->type), GC_m2s (q->payload_type), q->payload_id,
+ GCC_2s (q->c), q->size);
+ }
+ LOG (level, "PPP DEBUG END\n");
+
+}
Modified: gnunet/src/cadet/gnunet-service-cadet_peer.h
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_peer.h 2014-06-23 21:48:38 UTC
(rev 33808)
+++ gnunet/src/cadet/gnunet-service-cadet_peer.h 2014-06-24 01:54:12 UTC
(rev 33809)
@@ -405,7 +405,15 @@
const char *
GCP_2s (const struct CadetPeer *peer);
+/**
+ * Log all kinds of info about a peer.
+ *
+ * @param peer Peer.
+ */
+void
+GCP_debug (const struct CadetPeer *p, enum GNUNET_ErrorType level);
+
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r33809 - gnunet/src/cadet,
gnunet <=