mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-14 12:02:29 -04:00
Cleaned up Transfer debug, now that we've found the windows bug.
* new uniform #define DEBUG_TRANSFERS to switch on packet timings. * switched off by default. * enabled BinData printing again. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3785 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9ef2260dd4
commit
7203229126
5 changed files with 16 additions and 21 deletions
|
@ -29,12 +29,12 @@
|
|||
#include "serialiser/rstlvbase.h"
|
||||
|
||||
/***
|
||||
#define RSSERIAL_DEBUG 1
|
||||
* #define RSSERIAL_DEBUG 1
|
||||
* #define DEBUG_TRANSFERS 1
|
||||
***/
|
||||
|
||||
#define TRANSFER_DEBUG 1
|
||||
|
||||
#ifdef TRANSFER_DEBUG
|
||||
#ifdef DEBUG_TRANSFERS
|
||||
#include "util/rsprint.h"
|
||||
#endif
|
||||
|
||||
|
@ -232,7 +232,7 @@ bool RsFileItemSerialiser::serialiseReq(RsFileRequest *item, void *data, uin
|
|||
* print timestamp, and file details so we can workout packet lags.
|
||||
***/
|
||||
|
||||
#ifdef TRANSFER_DEBUG
|
||||
#ifdef DEBUG_TRANSFERS
|
||||
std::cerr << "RsFileItemSerialiser::serialiseReq() at: " << RsUtil::AccurateTimeString() << std::endl;
|
||||
item->print(std::cerr, 10);
|
||||
#endif
|
||||
|
@ -295,7 +295,7 @@ RsFileRequest *RsFileItemSerialiser::deserialiseReq(void *data, uint32_t *pktsiz
|
|||
* print timestamp, and file details so we can workout packet lags.
|
||||
***/
|
||||
|
||||
#ifdef TRANSFER_DEBUG
|
||||
#ifdef DEBUG_TRANSFERS
|
||||
std::cerr << "RsFileItemSerialiser::deserialiseReq() at: " << RsUtil::AccurateTimeString() << std::endl;
|
||||
item->print(std::cerr, 10);
|
||||
#endif
|
||||
|
@ -404,7 +404,7 @@ bool RsFileItemSerialiser::serialiseData(RsFileData *item, void *data, uint3
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef TRANSFER_DEBUG
|
||||
#ifdef DEBUG_TRANSFERS
|
||||
std::cerr << "RsFileItemSerialiser::serialiseData() at: " << RsUtil::AccurateTimeString() << std::endl;
|
||||
item->print(std::cerr, 10);
|
||||
#endif
|
||||
|
@ -460,7 +460,7 @@ RsFileData *RsFileItemSerialiser::deserialiseData(void *data, uint32_t *pktsize)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef TRANSFER_DEBUG
|
||||
#ifdef DEBUG_TRANSFERS
|
||||
std::cerr << "RsFileItemSerialiser::deserialiseData() at: " << RsUtil::AccurateTimeString() << std::endl;
|
||||
item->print(std::cerr, 10);
|
||||
#endif
|
||||
|
|
|
@ -213,7 +213,6 @@ std::ostream &RsTlvBinaryData::print(std::ostream &out, uint16_t indent)
|
|||
sout << "RsTlvBinaryData: Type: " << tlvtype << " Size: " << bin_len;
|
||||
sout << std::hex;
|
||||
|
||||
#if 0
|
||||
for(i = 0; i < bin_len; i++)
|
||||
{
|
||||
if (i % 16 == 0)
|
||||
|
@ -224,9 +223,8 @@ std::ostream &RsTlvBinaryData::print(std::ostream &out, uint16_t indent)
|
|||
sout << std::setw(2) << std::setfill('0')
|
||||
<< (int) (((unsigned char *) bin_data)[i]) << ":";
|
||||
}
|
||||
#endif
|
||||
sout << std::endl;
|
||||
|
||||
sout << std::endl;
|
||||
out << sout.str();
|
||||
|
||||
printEnd(out, "RsTlvBinaryData", indent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue