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

@ -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 ";