From 46b6921ddf9528aedb7bfaaf44f7e12fdb8e210a Mon Sep 17 00:00:00 2001 From: jmjatlanta Date: Thu, 3 Aug 2017 17:51:34 -0500 Subject: [PATCH] added more debugging messages --- core/null.c | 4 +++- exchange/bitswap/engine.c | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/null.c b/core/null.c index 4675fca..fad726d 100644 --- a/core/null.c +++ b/core/null.c @@ -105,8 +105,10 @@ int ipfs_multistream_marshal(const unsigned char* incoming, size_t incoming_size libp2p_logger_log("null", LOGLEVEL_DEBUG, "kademlia message handled\n"); } else if (protocol_compare(incoming, incoming_size, "/ipfs/bitswap/")) { libp2p_logger_debug("null", "Attempting bitswap connection...\n"); - if (!ipfs_bitswap_network_handle_message(local_node, session, incoming, incoming_size)) + if (!ipfs_bitswap_network_handle_message(local_node, session, incoming, incoming_size)) { + libp2p_logger_error("null", "Bitswap message handler reported a failure.\n"); return -1; + } } else { libp2p_logger_error("null", "There was a problem with this connection. It is nothing I can handle. Disconnecting.\n"); diff --git a/exchange/bitswap/engine.c b/exchange/bitswap/engine.c index 7ae39f8..d964913 100644 --- a/exchange/bitswap/engine.c +++ b/exchange/bitswap/engine.c @@ -101,8 +101,7 @@ void* ipfs_bitswap_engine_peer_request_processor_start(void* ctx) { did_some_processing = 1; if (retVal == -1) { // there was a problem. Clean up - current_peer_entry->connection_type = CONNECTION_TYPE_NOT_CONNECTED; - libp2p_session_context_free(current_peer_entry->sessionContext); + libp2p_peer_handle_connection_error(current_peer_entry); } } }