Added some debugging to dht

This commit is contained in:
John Jones 2017-04-03 17:36:51 -05:00
parent f1c8ceedbd
commit 1489e4fbf8
2 changed files with 6 additions and 2 deletions

View file

@ -253,8 +253,11 @@ int libp2p_routing_dht_handle_message(struct SessionContext* session, struct Pee
break; break;
} }
// if we have something to send, send it. // if we have something to send, send it.
if (result_buffer != NULL && !session->default_stream->write(session, result_buffer, result_buffer_size)) if (result_buffer != NULL) {
goto exit; 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; retVal = 1;
exit: exit:
if (buffer != NULL) if (buffer != NULL)

View file

@ -19,6 +19,7 @@ void libp2p_logger_init() {
logger_classes = libp2p_utils_vector_new(1); logger_classes = libp2p_utils_vector_new(1);
libp2p_logger_add_class("secio"); libp2p_logger_add_class("secio");
libp2p_logger_add_class("null"); libp2p_logger_add_class("null");
libp2p_logger_add_class("dht_protocol");
} }
/*** /***