From f08bcc153ef7317814244ad5e244454fed665346 Mon Sep 17 00:00:00 2001 From: drbob Date: Fri, 20 Jan 2012 17:30:16 +0000 Subject: [PATCH] * Disabled Thread debugging. * Fixed up bdProxyId initialisation * Improved Error Code translation (for unknown entries) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4826 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libbitdht/src/bitdht/bdconnection.cc | 12 ++++++++++++ libbitdht/src/bitdht/bdconnection.h | 4 ++-- libbitdht/src/util/bdthreads.cc | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/libbitdht/src/bitdht/bdconnection.cc b/libbitdht/src/bitdht/bdconnection.cc index 1a79bd284..a301395c4 100644 --- a/libbitdht/src/bitdht/bdconnection.cc +++ b/libbitdht/src/bitdht/bdconnection.cc @@ -34,6 +34,8 @@ #include "util/bdnet.h" #include "util/bdrandom.h" +#include + /* * #define DEBUG_PROXY_CONNECTION 1 * #define DEBUG_NODE_CONNECTION 1 @@ -3375,6 +3377,11 @@ std::string decodeConnectionErrorType(uint32_t errcode) switch(errtype) { default: + { + std::ostringstream out; + out << "(" << errtype << ")"; + namedtype += out.str(); + } break; case BITDHT_CONNECT_ERROR_GENERIC: namedtype = "GENERIC"; @@ -3427,6 +3434,11 @@ std::string decodeConnectionErrorSource(uint32_t errcode) switch(errsrc) { default: + { + std::ostringstream out; + out << "(" << errsrc << ")"; + namedtype += out.str(); + } break; case BITDHT_CONNECT_ERROR_SOURCE_START: namedtype = "START"; diff --git a/libbitdht/src/bitdht/bdconnection.h b/libbitdht/src/bitdht/bdconnection.h index d8df77659..989e09eb0 100644 --- a/libbitdht/src/bitdht/bdconnection.h +++ b/libbitdht/src/bitdht/bdconnection.h @@ -153,8 +153,8 @@ class bdProxyId { public: - bdProxyId(const bdId &in_id, uint32_t in_srctype, uint32_t errcode) - :id(in_id), srcType(in_srctype) { return; } + bdProxyId(const bdId &in_id, uint32_t in_srctype, uint32_t in_errcode) + :id(in_id), srcType(in_srctype), errcode(in_errcode) { return; } bdProxyId() :srcType(BD_PI_SRC_UNKNOWN) { return; } diff --git a/libbitdht/src/util/bdthreads.cc b/libbitdht/src/util/bdthreads.cc index 2d70e7f31..b52d152da 100644 --- a/libbitdht/src/util/bdthreads.cc +++ b/libbitdht/src/util/bdthreads.cc @@ -32,7 +32,7 @@ * #define DEBUG_THREADS 1 *******/ -#define DEBUG_THREADS 1 +//#define DEBUG_THREADS 1 #ifdef DEBUG_THREADS #include