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:
drbob 2010-11-13 11:46:17 +00:00
parent 9ef2260dd4
commit 7203229126
5 changed files with 16 additions and 21 deletions

View File

@ -11,10 +11,9 @@
/******** /********
* #define DEBUG_FT_FILE_PROVIDER 1 * #define DEBUG_FT_FILE_PROVIDER 1
* #define DEBUG_TRANSFERS 1 // TO GET TIMESTAMPS of DATA READING
********/ ********/
/***** TO GET TIMESTAMPS of DATA READING ****/
#define DEBUG_TRANSFERS 1
#ifdef DEBUG_TRANSFERS #ifdef DEBUG_TRANSFERS
#include "util/rsprint.h" #include "util/rsprint.h"

View File

@ -27,8 +27,6 @@
* #define FT_DEBUG 1 * #define FT_DEBUG 1
*****/ *****/
#define FT_DEBUG 1
#include "retroshare/rsturtle.h" #include "retroshare/rsturtle.h"
#include "fttransfermodule.h" #include "fttransfermodule.h"

View File

@ -43,11 +43,11 @@ const int PQISTREAM_ABS_MAX = 100000000; /* 100 MB/sec (actually per loop) */
/* This removes the print statements (which hammer pqidebug) */ /* This removes the print statements (which hammer pqidebug) */
/*** /***
#define RSITEM_DEBUG 1 #define RSITEM_DEBUG 1
#define DEBUG_TRANSFERS 1
***/ ***/
#define DEBUG_TRANSFER 1
#ifdef DEBUG_TRANSFER #ifdef DEBUG_TRANSFERS
#include "util/rsprint.h" #include "util/rsprint.h"
#endif #endif
@ -458,7 +458,7 @@ int pqistreamer::handleoutgoing()
if ((!(bio->cansend())) || (maxbytes < sentbytes)) if ((!(bio->cansend())) || (maxbytes < sentbytes))
{ {
#ifdef DEBUG_TRANSFER #ifdef DEBUG_TRANSFERS
if (maxbytes < sentbytes) if (maxbytes < sentbytes)
{ {
std::cerr << "pqistreamer::handleoutgoing() Stopped sending sentbytes > maxbytes. Sent " << sentbytes << " bytes "; std::cerr << "pqistreamer::handleoutgoing() Stopped sending sentbytes > maxbytes. Sent " << sentbytes << " bytes ";
@ -483,7 +483,7 @@ int pqistreamer::handleoutgoing()
{ {
pkt_wpending = *(out_pkt.begin()); pkt_wpending = *(out_pkt.begin());
out_pkt.pop_front(); out_pkt.pop_front();
#ifdef DEBUG_TRANSFER #ifdef DEBUG_TRANSFERS
std::cerr << "pqistreamer::handleoutgoing() getting next pkt from out_pkt queue"; std::cerr << "pqistreamer::handleoutgoing() getting next pkt from out_pkt queue";
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
@ -493,7 +493,7 @@ int pqistreamer::handleoutgoing()
{ {
pkt_wpending = *(out_data.begin()); pkt_wpending = *(out_data.begin());
out_data.pop_front(); out_data.pop_front();
#ifdef DEBUG_TRANSFER #ifdef DEBUG_TRANSFERS
std::cerr << "pqistreamer::handleoutgoing() getting next pkt from out_data queue"; std::cerr << "pqistreamer::handleoutgoing() getting next pkt from out_data queue";
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
@ -523,7 +523,7 @@ int pqistreamer::handleoutgoing()
return -1; return -1;
} }
#ifdef DEBUG_TRANSFER #ifdef DEBUG_TRANSFERS
std::cerr << "pqistreamer::handleoutgoing() Sent Packet len: " << len << " @ " << RsUtil::AccurateTimeString(); std::cerr << "pqistreamer::handleoutgoing() Sent Packet len: " << len << " @ " << RsUtil::AccurateTimeString();
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
@ -820,7 +820,7 @@ continue_packet:
if(maxin > readbytes && bio->moretoread()) if(maxin > readbytes && bio->moretoread())
goto start_packet_read ; goto start_packet_read ;
#ifdef DEBUG_TRANSFER #ifdef DEBUG_TRANSFERS
if (readbytes >= maxin) if (readbytes >= maxin)
{ {
std::cerr << "pqistreamer::handleincoming() Stopped reading as readbytes >= maxin. Read " << readbytes << " bytes "; std::cerr << "pqistreamer::handleincoming() Stopped reading as readbytes >= maxin. Read " << readbytes << " bytes ";

View File

@ -29,12 +29,12 @@
#include "serialiser/rstlvbase.h" #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" #include "util/rsprint.h"
#endif #endif
@ -232,7 +232,7 @@ bool RsFileItemSerialiser::serialiseReq(RsFileRequest *item, void *data, uin
* print timestamp, and file details so we can workout packet lags. * 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; std::cerr << "RsFileItemSerialiser::serialiseReq() at: " << RsUtil::AccurateTimeString() << std::endl;
item->print(std::cerr, 10); item->print(std::cerr, 10);
#endif #endif
@ -295,7 +295,7 @@ RsFileRequest *RsFileItemSerialiser::deserialiseReq(void *data, uint32_t *pktsiz
* print timestamp, and file details so we can workout packet lags. * 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; std::cerr << "RsFileItemSerialiser::deserialiseReq() at: " << RsUtil::AccurateTimeString() << std::endl;
item->print(std::cerr, 10); item->print(std::cerr, 10);
#endif #endif
@ -404,7 +404,7 @@ bool RsFileItemSerialiser::serialiseData(RsFileData *item, void *data, uint3
#endif #endif
} }
#ifdef TRANSFER_DEBUG #ifdef DEBUG_TRANSFERS
std::cerr << "RsFileItemSerialiser::serialiseData() at: " << RsUtil::AccurateTimeString() << std::endl; std::cerr << "RsFileItemSerialiser::serialiseData() at: " << RsUtil::AccurateTimeString() << std::endl;
item->print(std::cerr, 10); item->print(std::cerr, 10);
#endif #endif
@ -460,7 +460,7 @@ RsFileData *RsFileItemSerialiser::deserialiseData(void *data, uint32_t *pktsize)
return NULL; return NULL;
} }
#ifdef TRANSFER_DEBUG #ifdef DEBUG_TRANSFERS
std::cerr << "RsFileItemSerialiser::deserialiseData() at: " << RsUtil::AccurateTimeString() << std::endl; std::cerr << "RsFileItemSerialiser::deserialiseData() at: " << RsUtil::AccurateTimeString() << std::endl;
item->print(std::cerr, 10); item->print(std::cerr, 10);
#endif #endif

View File

@ -213,7 +213,6 @@ std::ostream &RsTlvBinaryData::print(std::ostream &out, uint16_t indent)
sout << "RsTlvBinaryData: Type: " << tlvtype << " Size: " << bin_len; sout << "RsTlvBinaryData: Type: " << tlvtype << " Size: " << bin_len;
sout << std::hex; sout << std::hex;
#if 0
for(i = 0; i < bin_len; i++) for(i = 0; i < bin_len; i++)
{ {
if (i % 16 == 0) 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') sout << std::setw(2) << std::setfill('0')
<< (int) (((unsigned char *) bin_data)[i]) << ":"; << (int) (((unsigned char *) bin_data)[i]) << ":";
} }
#endif
sout << std::endl;
sout << std::endl;
out << sout.str(); out << sout.str();
printEnd(out, "RsTlvBinaryData", indent); printEnd(out, "RsTlvBinaryData", indent);