diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-04-11 15:30:35 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-04-11 15:30:35 +0000 |
commit | 93f3e41fe67027640256f28154f39f50e1b1b41a (patch) | |
tree | 21218c718f73070439dc82aa50a6abe1990fd0c9 /src/mesh | |
parent | e3a5e63344963c203220af18059777bf8a98a9cf (diff) | |
download | gnunet-93f3e41fe67027640256f28154f39f50e1b1b41a.tar.gz gnunet-93f3e41fe67027640256f28154f39f50e1b1b41a.zip |
- add debug function to inspect queues
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/gnunet-service-mesh_peer.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/mesh/gnunet-service-mesh_peer.c b/src/mesh/gnunet-service-mesh_peer.c index a98bf568f..67e4117be 100644 --- a/src/mesh/gnunet-service-mesh_peer.c +++ b/src/mesh/gnunet-service-mesh_peer.c | |||
@@ -212,8 +212,31 @@ static struct GNUNET_CORE_Handle *core_handle; | |||
212 | */ | 212 | */ |
213 | static struct GNUNET_TRANSPORT_Handle *transport_handle; | 213 | static struct GNUNET_TRANSPORT_Handle *transport_handle; |
214 | 214 | ||
215 | |||
215 | /******************************************************************************/ | 216 | /******************************************************************************/ |
216 | /***************************** CORE CALLBACKS *********************************/ | 217 | /***************************** DEBUG *********************************/ |
218 | /******************************************************************************/ | ||
219 | |||
220 | static void | ||
221 | queue_debug (struct MeshPeer *peer) | ||
222 | { | ||
223 | struct MeshPeerQueue *q; | ||
224 | |||
225 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Messages queued towards %s\n", GMP_2s (peer)); | ||
226 | LOG (GNUNET_ERROR_TYPE_DEBUG, " core tmt rdy: %p\n", peer->core_transmit); | ||
227 | |||
228 | for (q = peer->queue_head; NULL != q; q = q->next) | ||
229 | { | ||
230 | LOG (GNUNET_ERROR_TYPE_DEBUG, " - %s %s on %s\n", | ||
231 | GM_m2s (q->type), GM_f2s (q->fwd), GMC_2s (q->c)); | ||
232 | } | ||
233 | |||
234 | LOG (GNUNET_ERROR_TYPE_DEBUG, "End queued towards %s\n", GMP_2s (peer)); | ||
235 | } | ||
236 | |||
237 | |||
238 | /******************************************************************************/ | ||
239 | /***************************** CORE HELPERS *********************************/ | ||
217 | /******************************************************************************/ | 240 | /******************************************************************************/ |
218 | 241 | ||
219 | 242 | ||
@@ -266,6 +289,9 @@ pop_direct_path (struct MeshPeer *peer) | |||
266 | } | 289 | } |
267 | 290 | ||
268 | 291 | ||
292 | /******************************************************************************/ | ||
293 | /***************************** CORE CALLBACKS *********************************/ | ||
294 | /******************************************************************************/ | ||
269 | 295 | ||
270 | /** | 296 | /** |
271 | * Method called whenever a given peer connects. | 297 | * Method called whenever a given peer connects. |
@@ -411,6 +437,7 @@ core_init (void *cls, | |||
411 | return; | 437 | return; |
412 | } | 438 | } |
413 | 439 | ||
440 | |||
414 | /** | 441 | /** |
415 | * Core callback to write a pre-constructed data packet to core buffer | 442 | * Core callback to write a pre-constructed data packet to core buffer |
416 | * | 443 | * |