improved debug info in a few places

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8584 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-07-09 20:55:11 +00:00
parent c0ad7d3e46
commit 249c827f95
6 changed files with 15 additions and 10 deletions

View File

@ -170,9 +170,9 @@ void ftController::addFileSource(const RsFileHash& hash,const RsPeerId& peer_id)
std::map<RsFileHash, ftFileControl*>::iterator it = mDownloads.find(hash);
//#ifdef CONTROL_DEBUG
#ifdef CONTROL_DEBUG
std::cerr << "ftController: Adding source " << peer_id << " to current download hash=" << hash ;
//#endif
#endif
if(it != mDownloads.end())
{
it->second->mTransfer->addFileSource(peer_id);

View File

@ -1516,9 +1516,9 @@ void p3GRouter::handleIncomingDataItem(RsGRouterGenericDataItem *data_item)
#endif
if(!verifySignedDataItem(data_item)) // we should get proper flags out of this
{
#ifdef GROUTER_DEBUG
std::cerr << " verifying item signature: FAILED! Droping that item" ;
#endif
std::cerr << " You probably received a message from a person you don't have key." << std::endl;
std::cerr << " Signature key ID: " << data_item->signature.keyId << std::endl;
return ;
}
#ifdef GROUTER_DEBUG
@ -1814,11 +1814,12 @@ bool p3GRouter::verifySignedDataItem(RsGRouterAbstractMsgItem *item)
{
switch(error_status)
{
case RsGixs::RS_GIXS_ERROR_KEY_NOT_AVAILABLE: std::cerr << "(EE) Key is not available. Cannot verify." << std::endl;
case RsGixs::RS_GIXS_ERROR_KEY_NOT_AVAILABLE: std::cerr << "(EE) Key for GXS Id " << item->signature.keyId << " is not available. Cannot verify." << std::endl;
break ;
case RsGixs::RS_GIXS_ERROR_SIGNATURE_MISMATCH: std::cerr << "(EE) Signature mismatch. Spoofing/Corrupted/MITM?." << std::endl;
break ;
default: break ;
default: std::cerr << "(EE) Signature verification failed on GRouter message. Unknown error status: " << error_status << std::endl;
break ;
}
return false;
}

View File

@ -29,7 +29,7 @@
#include "serialiser/rstlvbase.h"
#include "serialiser/rsbaseserial.h"
#define GXSCOMMENT_DEBUG 1
//#define GXSCOMMENT_DEBUG 1
uint32_t RsGxsCommentSerialiser::size(RsItem *item)

View File

@ -939,11 +939,15 @@ bool SSGxsChannelGroup::load(const std::string &input)
}
else
{
#ifdef GXSCHANNELS_DEBUG
std::cerr << "SSGxsChannelGroup::load(): could not parse string \"" << input << "\"" << std::endl;
#endif
return false ;
}
#ifdef GXSCHANNELS_DEBUG
std::cerr << "DECODED STRING: autoDL=" << mAutoDownload << ", directory=\"" << mDownloadDirectory << "\"" << std::endl;
#endif
return true;
}
@ -965,7 +969,9 @@ std::string SSGxsChannelGroup::save() const
output += " {P:" + encoded_str + "}";
}
#ifdef GXSCHANNELS_DEBUG
std::cerr << "ENCODED STRING: " << output << std::endl;
#endif
return output;
}

View File

@ -718,9 +718,7 @@ bool p3IdService::validateData(const uint8_t *data,uint32_t data_size,const RsTl
if(signature_key.keyData.bin_data == NULL)
{
#ifdef DEBUG_IDS
std::cerr << "(EE) Cannot validate signature for unknown key " << signature.keyId << std::endl;
#endif
signing_error = RS_GIXS_ERROR_KEY_NOT_AVAILABLE ;
return false;
}

View File

@ -470,7 +470,7 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *)
QString remote_status = remotely_allowed?tr("Enabled by remote peer"):tr("Disabled by remote peer") ;
if(!service_perms.mDefaultAllowed)
local_status = tr("Switched Off") ;
local_status = tr("Globally switched Off") ;
const QFont& font(_painter->font()) ;
QFontMetrics fm(font);