Hackish changes to debug Windows Transfers...

Committing these so others can run tests.
Most of these changes will be removed once the problem is fixed!
 * Fixed formatting of various serialiser item::print() fns.
 * Disabled printout of TlvBinaryData - data.
 * added AccurateTimeString() function to util/rsprint.cc
 * print serialise / deserialise of FileRequest & FileData + Timestamps.
 * added print + timestamp in ftFileProvider::getFileData()
 * #define TRANSFER_DEBUG to isolate these changes.
 * enabled debugging in fttransfermodule.cc



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3779 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2010-11-11 20:51:17 +00:00
parent 9397491634
commit 06273fa775
6 changed files with 109 additions and 3 deletions

View file

@ -80,3 +80,44 @@ std::string RsUtil::HashId(std::string id, bool reverse)
return hash;
}
#ifdef WINDOWS_SYS
#include <time.h>
#include <sys/timeb.h>
#endif
#include <sys/time.h>
#include <sstream>
#include <iomanip>
static double getCurrentTS();
// Little fn to get current timestamp in an independent manner.
std::string RsUtil::AccurateTimeString()
{
std::ostringstream out;
out << std::setprecision(15) << getCurrentTS();
return out.str();
}
static double getCurrentTS()
{
#ifndef WINDOWS_SYS
struct timeval cts_tmp;
gettimeofday(&cts_tmp, NULL);
double cts = (cts_tmp.tv_sec) + ((double) cts_tmp.tv_usec) / 1000000.0;
#else
struct _timeb timebuf;
_ftime( &timebuf);
double cts = (timebuf.time) + ((double) timebuf.millitm) / 1000.0;
#endif
return cts;
}