mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -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
@ -11,10 +11,9 @@
|
||||
|
||||
/********
|
||||
* #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
|
||||
#include "util/rsprint.h"
|
||||
|
@ -27,8 +27,6 @@
|
||||
* #define FT_DEBUG 1
|
||||
*****/
|
||||
|
||||
#define FT_DEBUG 1
|
||||
|
||||
#include "retroshare/rsturtle.h"
|
||||
#include "fttransfermodule.h"
|
||||
|
||||
|
@ -43,11 +43,11 @@ const int PQISTREAM_ABS_MAX = 100000000; /* 100 MB/sec (actually per loop) */
|
||||
/* This removes the print statements (which hammer pqidebug) */
|
||||
/***
|
||||
#define RSITEM_DEBUG 1
|
||||
#define DEBUG_TRANSFERS 1
|
||||
***/
|
||||
|
||||
#define DEBUG_TRANSFER 1
|
||||
|
||||
#ifdef DEBUG_TRANSFER
|
||||
#ifdef DEBUG_TRANSFERS
|
||||
#include "util/rsprint.h"
|
||||
#endif
|
||||
|
||||
@ -458,7 +458,7 @@ int pqistreamer::handleoutgoing()
|
||||
if ((!(bio->cansend())) || (maxbytes < sentbytes))
|
||||
{
|
||||
|
||||
#ifdef DEBUG_TRANSFER
|
||||
#ifdef DEBUG_TRANSFERS
|
||||
if (maxbytes < sentbytes)
|
||||
{
|
||||
std::cerr << "pqistreamer::handleoutgoing() Stopped sending sentbytes > maxbytes. Sent " << sentbytes << " bytes ";
|
||||
@ -483,7 +483,7 @@ int pqistreamer::handleoutgoing()
|
||||
{
|
||||
pkt_wpending = *(out_pkt.begin());
|
||||
out_pkt.pop_front();
|
||||
#ifdef DEBUG_TRANSFER
|
||||
#ifdef DEBUG_TRANSFERS
|
||||
std::cerr << "pqistreamer::handleoutgoing() getting next pkt from out_pkt queue";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
@ -493,7 +493,7 @@ int pqistreamer::handleoutgoing()
|
||||
{
|
||||
pkt_wpending = *(out_data.begin());
|
||||
out_data.pop_front();
|
||||
#ifdef DEBUG_TRANSFER
|
||||
#ifdef DEBUG_TRANSFERS
|
||||
std::cerr << "pqistreamer::handleoutgoing() getting next pkt from out_data queue";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
@ -523,7 +523,7 @@ int pqistreamer::handleoutgoing()
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_TRANSFER
|
||||
#ifdef DEBUG_TRANSFERS
|
||||
std::cerr << "pqistreamer::handleoutgoing() Sent Packet len: " << len << " @ " << RsUtil::AccurateTimeString();
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
@ -820,7 +820,7 @@ continue_packet:
|
||||
if(maxin > readbytes && bio->moretoread())
|
||||
goto start_packet_read ;
|
||||
|
||||
#ifdef DEBUG_TRANSFER
|
||||
#ifdef DEBUG_TRANSFERS
|
||||
if (readbytes >= maxin)
|
||||
{
|
||||
std::cerr << "pqistreamer::handleincoming() Stopped reading as readbytes >= maxin. Read " << readbytes << " bytes ";
|
||||
|
@ -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…
Reference in New Issue
Block a user