From 1489e4fbf88ecb75eae2b9c49ea2ade6098ea0ec Mon Sep 17 00:00:00 2001 From: John Jones Date: Mon, 3 Apr 2017 17:36:51 -0500 Subject: [PATCH] Added some debugging to dht --- routing/dht_protocol.c | 7 +++++-- utils/logger.c | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/routing/dht_protocol.c b/routing/dht_protocol.c index 1d2d475..d5b92e0 100644 --- a/routing/dht_protocol.c +++ b/routing/dht_protocol.c @@ -253,8 +253,11 @@ int libp2p_routing_dht_handle_message(struct SessionContext* session, struct Pee break; } // if we have something to send, send it. - if (result_buffer != NULL && !session->default_stream->write(session, result_buffer, result_buffer_size)) - goto exit; + if (result_buffer != NULL) { + libp2p_logger_debug("dht_protocol", "Sending message back to caller\n"); + if (!session->default_stream->write(session, result_buffer, result_buffer_size)) + goto exit; + } retVal = 1; exit: if (buffer != NULL) diff --git a/utils/logger.c b/utils/logger.c index e84dac2..1876c0f 100644 --- a/utils/logger.c +++ b/utils/logger.c @@ -19,6 +19,7 @@ void libp2p_logger_init() { logger_classes = libp2p_utils_vector_new(1); libp2p_logger_add_class("secio"); libp2p_logger_add_class("null"); + libp2p_logger_add_class("dht_protocol"); } /***