From 342fc65936bb2cccf4d39bfeb67b53e12f874719 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 --- src/bitdht/bdconnection.cc | 12 ++++++++++++ src/bitdht/bdconnection.h | 4 ++-- src/util/bdthreads.cc | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/bitdht/bdconnection.cc b/src/bitdht/bdconnection.cc index 1a79bd2..a301395 100644 --- a/src/bitdht/bdconnection.cc +++ b/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/src/bitdht/bdconnection.h b/src/bitdht/bdconnection.h index d8df776..989e09e 100644 --- a/src/bitdht/bdconnection.h +++ b/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/src/util/bdthreads.cc b/src/util/bdthreads.cc index 2d70e7f..b52d152d 100644 --- a/src/util/bdthreads.cc +++ b/src/util/bdthreads.cc @@ -32,7 +32,7 @@ * #define DEBUG_THREADS 1 *******/ -#define DEBUG_THREADS 1 +//#define DEBUG_THREADS 1 #ifdef DEBUG_THREADS #include